Rainy Day Flower Video

For my final, I went back and forth between a few ideas, but ultimately, I decided to address the two elements that I had wanted to try but hadn’t figured out yet: movie and minim. The video is simple because my intention was to include more opportunities for user interaction, but at least it is functional. I had to make the choice between something that works and something that is complex…and I chose something that works. I used some random video that I shot the other day on an iPhone (this is not the video I had originally planned to use) because it is pretty and simple. I chose Youth Lagoon’s “17” to accompany it, as both the movie and the music are nice and calm. To add a bit more complexity, I added a mouseClick function, which simultaneously pauses the movie and the music. This turns the project into a music video player! When the mouse is released, both the movie and music return. I have a key pressed function that evaluates the brightness of the video and then colors the sky blue while the key is pressed to give the appearance of a rainy day/thunderstorm. For this part, I hoped to manipulate the video by tracking someone’s movement with the webcam, but ultimately, I couldn’t figure out how to do this. Thought that I could change the pitch and/or volume of the music that way, or the playback speed of the video. Since I struggled to translate the data from the computer’s vision into manipulation of the video on screen, I replaced that portion with a keyPressed function so when the spacebar is pressed, the video speeds up and the sky turns blue like a rainstorm! I know this looks like a pretty simple project, but for my final,  I really wanted to make something entirely functional and visually appealing.

import processing.video.*;
Movie myMovie;

import ddf.minim.*;
Minim minim;
AudioPlayer song;

void setup() {
  size(960, 540);
  myMovie = new Movie(this, "TreeCircle.mov");
  myMovie.loop();

  minim=new Minim(this);
  song= minim.loadFile("17.mp3");
  song.play();

}

void draw() {
  image(myMovie, 0,0, 960, 540);

    }

void mousePressed() {
  myMovie.pause();
  song.pause();
}

void mouseReleased() {
  myMovie.play();
  song.play();

}

void keyPressed() {
 for (int i = 0; i < myMovie.pixels.length;  i++) {  //you can ask the pixel array how long it is
    if ( brightness(myMovie.pixels[i]) > 200) {  //check the brightness of the pixel
      myMovie.pixels[i] = color(0, 200, 250,150);  //
      myMovie.speed(4.0);
    }}}

// Called every time a new frame is available to read
void movieEvent(Movie m) {
  m.read();

}

void stop() {
  song.close();
  minim.stop();

  super.stop();
}

 

Leave a Reply