We are about to switch to a new forum software. Until then we have removed the registration on this forum.
import processing.sound.*;
Amplitude amp;
AudioIn in;
float z = 0;
int value = 0;
void setup() {
size(800, 800);
background(255);
// Create an Input stream which is routed into the Amplitude analyzer
amp = new Amplitude(this);
in = new AudioIn(this, 0);
in.start();
amp.input(in);
}
void draw()
{
noStroke();
fill(0, 10);
stroke(0, 100, value);
println(amp.analyze());
if (amp.analyze() > 0.03){
for (float y = 0; y < height; y = y + 20) {
for (float x = 0; x < width; x = x + 1) {
point(x, y + map(noise(x/150, y/150, z), 0, 1, -100, 100));
}
}
// when y is 500 the program will move forward. In this case increment z
z = z + 0.02;
} else {
background(255);
}}
Answers
"Is the mouse over a line?" is point-line collision detection.