Color Shifting

import ddf.minim.*;
import processing.video.*;
Capture cam;
Minim minim;
AudioInput in;

//shift
float left;
float right;

void setup(){
size(1280,720);

//audio
minim = new Minim(this);
in = minim.getLineIn();

//camera
cam = new Capture(this,width,height,15);
cam.start();

}

void draw(){

//read
if(cam.available()){
cam.read();
}

//shift
for(int i = 0; i < in.bufferSize() – 1; i++){
left = in.left.get(i)*-10000;
right = in.right.get(i)*10000;
}

//base
tint(255,128);
image(cam,0,0);
//red
tint(255,0,0,75);
image(cam,left,0);
//blue
tint(0,0,255,75);
image(cam,right,0);
//green
tint(0,255,0,50);
image(cam,0,0);

}

Advertisements
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s