Slide:
import processing.video.*; Movie myMovie; int previousX = 0; int distance; void setup() { background(0); size(640, 480); myMovie = new Movie(this, "music.mp4"); myMovie.loop(); } void movieEvent(Movie movie) { myMovie.read(); } void draw() { if (myMovie.available()) { //read my file when it can be read myMovie.read(); //read the current frame of the video } image(myMovie, 0, 0); distance = mouseX - previousX; float newSpeed = map(distance, -width, width, 0.1, 5); myMovie.speed(newSpeed); previousX = mouseX; }