>>>
10. SOUNDREACTIVE(TEST) from Jihyeon Kim on Vimeo.
(Tested on Processing)
import processing.video.*;
import ddf.minim.*;
Minim minim;
AudioInput in;
Movie myMovie;
float movie_length;
float sp;
float md;//duration
float mt;//time
void setup() {
// frameRate(15);
size(640,480,P2D);
myMovie = new Movie(this,"bbbb.mov");
md=myMovie.duration();
myMovie.loop();
// movie_length=myMovie.duration();
// myMovie.jump(movie_length/2.0);
minim = new Minim(this);
minim.debugOn();
// get a line in from Minim, default bit depth is 16
in = minim.getLineIn(Minim.STEREO, 512);
}
void draw() {
image(myMovie,0,0,1024,768);
// println(in.mix.level());
sp=(in.mix.level()*640)/50.0-4.0;
mt = myMovie.time();
myMovie.speed(sp);
if(sp<0 && mt==0) {
myMovie.jump(md);
}
//myMovie.jump(random(myMovie.duration()));
}
void movieEvent(Movie m) {
m.read();
}
void stop()
{
// always close Minim audio classes when you are done with them
in.close();
minim.stop();
super.stop();
}
>>>
As sound getting bigger, the movie is going forward, but if sound is getting smaller, the movie is going reward.
the effect is not that clean, so video itself has to be cleaned or reshoot.
>>>
0 comments:
Post a Comment