import processing.sound.*;
SoundFile sound;
Amplitude a;
int width, height;
void setup(){
width = 600;
height = 600;
size(600, 600);
background(0);
sound = new SoundFile(this, "happy.wav");
a = new Amplitude(this);
a.input(sound);
// sound.loop();
sound.play();
}
int counter = 0;
void draw()
{
background(255);
noStroke();
float current = a.analyze() * 1000;
ellipse(width/2, height/2, int(current + random(20)), int(current + random(20)));
counter ++;
if (counter > 15){
counter = 0;
fill(random(255), random(255), random(255));
}
}
At least by random I can somehow see the effect – but on my laptop it is not working due to some unknown issues. Processing even cannot play sample sounds from lib.
Leave a Reply
You must be logged in to post a comment.