I made this code for a interactive installation. This is the idea of the installation: the visitor comes into a empty room (only music is playing), his shadow is projected on a wall, because of a lamp. When the visitor steps on a foot tile, his shadow is captured by a webcam and projected on the wall. (the lamp is switched off, and a beamer is projecting your freezed shadow on the wall). Now a movie is playing with people who are tearing you apart. When the movie stops, the whole proces can start all over again.
Now, that's a problem for me. I made a code that works, but because this is my first code I ever made in Processing and I didn't make a very good flow chart, I don't know how I can loop the whole proces.
I hope someone of you can help me a bit where to start. Thanks anyway!
if (mousePressed == true) {
if (state=='B') {
if (millis()-m>HowLongIsItWaiting1) {
fill(255);
rect(0, 0, 640, 480);
m = millis();
state='A';
imagestarted = true;
} // if
} // if
else if (state=='A') {
if (millis()-m>HowLongIsItWaiting2) {
image (e, 0, 0);
m = millis();
state='B';
} // if
} // if
} // func
}
I want that Processing plays a song, but when you click on your mouse the song stops.
I've tried a several things, but nothing worked :(
I must say I'm still not very practised inProcessing.
This is the latest code I made:
_________________________________________________________________________________________________
I've got this little problem, I want to play a song and when you press your mouse I want to let it stop of pause.
I guess it's a very stupid little mistake I make. But Processing said it couldn't find anything named 'musicPlays.'
Here's the code:
_____________________________________________
import ddf.minim.*;
boolean music = true;
Minim minim;
AudioPlayer player;
void musicPlays() {
if (music == true) {
minim = new Minim(this);
player = minim.loadFile("liedje.mp3");
player.loop();
}
}
void mousePressed(){
if (music == false) {
musicPlays.stop();
}
}
Here I am again. I made this following code in Processing, but nothing occurs. I think it have something to do with the booleans. I think I did something wrong in the void captureSave, movieShades and showImage with the 'if's,' but I can't figure out what :(
This is the code:
____________________________________________________________________________________________
//Pre-setup
//Videos
import processing.video.*;
Movie Shades;
Capture myCapture;
//booleans
boolean a = false;
boolean b = false;
boolean c = false;
//Images
PImage d, e;
//Setup
void setup() {
//workspace
size(640, 480, P2D);
//loadimages
d = loadImage("bg.jpg");
e = loadImage("createimage.jpg");
//Capture setup
myCapture = new Capture(this, width, height, 30);
//Movie Shades setup
Shades = new Movie(this, "film.mov");
}
Here I am again. I've got a little problem. I've got the following idea: I want that processing makes a picture (of your shadow which is projected on a white wall), saves it in the data directory, put it back into processing with a blendmode (the white wall will be subtracted, and only your silhouette will be displayed) and BEHIND this silhouette I want to play a video.
But the problem is that the picture from the silhouette is been shown behind the video, instead of the silhoutte in front of the video.
a = a white background
b = the picture which is made with the webcam
Hello, I'm new here and not very experienced in Processing. But I hope someone will help me a bit.
I know how to capture a webcam and I know how to freeze the image when my mouse is pressed, like so:
import processing.video.*;
Capture myCapture;
int value = 0;
void setup ()
{
size (640, 480);
myCapture = new Capture(this, width, height, 30);
}
But I want that processing saves the freezed image and put it into the 'data' directory. Next I want to put that saved image back into processing with a blendmode.
So, first does anyone of you know how to save an image and put it into the data directory?
You will help me a lot! :D