For this recitation, I went to Leon’ session, media manipulation workshop. The main reason was that for our final project, we need to apply a lot media, such as videos, audios and images. Some interesting things I found on class was many other functions that I’ve never used before, like the time(); function which is also used later in my exercise and further in my final project.
For the in-class exercise, I used the material I may use for the final project and created a short video. Here’s a clip for the project:
Here’s the code:
import processing.video.*;
import processing.sound.*;
SoundFile location;
FFT fft;
int bands = 64;
float smoothingFactor = 0.2;
float[] sum = new float[bands];
int scale = 1;
float barWidth;
PImage car;
Movie nyc;
Movie spd;
boolean stop = false;
boolean spdover = false;
void setup() {
size(1440, 855);
location = new SoundFile(this, “location.mp3”);
location.play();
barWidth = 250/float(bands);
fft = new FFT(this, bands);
fft.input(location);
car = loadImage(“3.png”);
nyc = new Movie(this, “nyc.mp4”);
spd = new Movie(this, “spd.mp4”);
}
void draw() {
nyc.play();
image(nyc, 0, 0, width, height);
filter(POSTERIZE, 10);
image(car, 630, 600);
if (time2 > 5) {
textSize(32);
fill(255);
text(“WANT A FAST RIDE:) ?”, 1020, 810);
}
}
if (stop == true) {
spd.play();
image(spd, 0, 0, width, height);
image(car, 630, 600);
}
if (time3 > 10) {
spdover = true;
}
}
void keyPressed() {
if (key == ‘y’) {
nyc.stop();
stop = true;
}
}
void movieEvent(Movie m) {
m.read();
}