import processing.sound.*;
SoundFile summer;
SoundFile a;
SoundFile b;
void setup() {
size(640, 480);
summer = new SoundFile(this, “summer.wav”);
a = new SoundFile(this, “a.aif”);
b = new SoundFile(this, “b.wav”);
}
void draw() {
background(255);
pushMatrix();
float aa = random(0,width-100);
float bb = random(0,height-100);
float cc = random(0,50);
ellipse(aa, bb, 55, 55);
fill(#23238E);
noStroke();
popMatrix();
delay(500);
}
void keyPressed() {
switch(key) {
case ‘a’:
summer.play();
background(100, 50, 0);
break;
case ‘g’:
a.play();
background(10, 200, 50);
break;
case ‘l’:
b.play();
background(200, 0, 50);
break;
}
}
Leave a Reply
You must be logged in to post a comment.