// voices // Created with Processing 68 alpha on Nobember 21 , 2004 // http://www.harukit.com/ Sample voice; Sample voice2; float[] data; float x1=0; float y1=25; float x2=0; float y2=75; float s1=3; float s2; void setup(){ size(300,100); background(0); ellipseMode(CENTER_DIAMETER); noStroke(); fill(255,255,255,90); Sonia.start(this); voice = new Sample("pres3.aiff"); voice.setVolume(0.7); voice2 = new Sample("pres2.aiff"); voice2.setVolume(0.7); voice.repeat(); voice2.repeat(); } void loop(){ background(0); voice2.setRate(44000+mouseX*50); ellipse(x1,y1,20,20); ellipse(x2,y2,20,20); s2=3+mouseX*0.005; if(voice.getCurrentFrame()<1000){ x1=0; }else{ x1+=s1; } if(voice2.getCurrentFrame()<1000){ x2=0; }else{ x2+=s2; } } public void stop(){ Sonia.stop(); super.stop(); }