Friday, April 25, 2008

Rough Cut Two














Again, more Processing experimentation, this time with a series of motion clips and some sound I recorded during a rainstorm. This is another interactive performance. Here's the code:

import processing.video.*;

int size = 4;
int bright = 25;
Movie []movies = new Movie[size];
Movie []mLoop = new Movie[size];
int overlay = 0;
int loopIndex = 0;
MovieMaker output;

void setup(){
size(320, 240);
mLoop[0] = new Movie(this, "hose.mov");
mLoop[1] = new Movie(this, "right-change.mov");
mLoop[2] = new Movie(this, "stonesup.mov");
mLoop[3] = new Movie(this, "hoseup.mov");
movies[0] = new Movie(this, "mossy-compost.mov");
movies[1] = new Movie(this, "leaves.mov");
movies[2] = new Movie(this, "weird-plant.mov");
movies[3] = new Movie(this, "pull-back.mov");
mLoop[0].loop();
mLoop[1].loop();
mLoop[2].loop();
mLoop[3].loop();
movies[0].loop();
movies[1].loop();
movies[2].loop();
movies[2].speed(0.5);
movies[3].loop();

output = new MovieMaker(this, width, height,
"output.mov", 15, MovieMaker.H263,
MovieMaker.LOW);
}

void draw(){
image(mLoop[loopIndex], 0, 0, width / 3, height);
image(movies[overlay], width / 3, 0, width / 2, height);
image(movies[abs(overlay - 1)], (width / 3) * 2, 0, width / 3, height);
output.addFrame();
}

void movieEvent(Movie m){
m.read();
}

void mousePressed(){
++overlay;
if(overlay >= size){
overlay = 0;
}
mLoop[loopIndex].speed((random(10) / 20));
}

void keyPressed(){
if(key == 'n'){
loopIndex++;
if(loopIndex >= size){
loopIndex = 0;
}
}
mLoop[loopIndex].jump(random(mLoop[0].duration()));
bright = (int)random(255);
if(key == 's'){
output.finish();
}
}

No comments: