I'm wanting to develop a prototype for the following demonstration in processing.
It would involve blowing into a speaker which picks up noise, creating a visualization of white mist
on a black background. The sort of look when you mist up a window using your breath on a cold winters day.
I would then like to be able to draw on this white mist. clearing or erasing the white (where a finger has been) so one can write a message in it.
I know I might have to use processing and minim to complete this.
But just needed help direct me in a more specific direction.
Here is the code I have so far, but would need it to be sound activated and to be able to draw over the white mist!:
void setup(){
background(0);
size(400, 400);
noStroke();
smooth();
}
void draw(){
if(frameCount % 20 == 0){
fill(0, 5);
rect(0, 0, width, height);
filter(BLUR, 1.0);
}
if (mousePressed && mouseButton == LEFT){
fill(255, 5);
int r = int(random(50, 200));
int x = mouseX + int(random(-10, 10));
int y = mouseY + int(random(-10, 10));
ellipse(x, y, r, r);
}
else if (mousePressed && mouseButton == RIGHT){
fill(0);
ellipse(mouseX, mouseY, 10, 10);
}
}
background(0);
size(400, 400);
noStroke();
smooth();
}
void draw(){
if(frameCount % 20 == 0){
fill(0, 5);
rect(0, 0, width, height);
filter(BLUR, 1.0);
}
if (mousePressed && mouseButton == LEFT){
fill(255, 5);
int r = int(random(50, 200));
int x = mouseX + int(random(-10, 10));
int y = mouseY + int(random(-10, 10));
ellipse(x, y, r, r);
}
else if (mousePressed && mouseButton == RIGHT){
fill(0);
ellipse(mouseX, mouseY, 10, 10);
}
}
1