hi there, do help me, first of all, I have problem to add more than 1 sound and make sound that I add detect the beat of it. my sound is in different file because I want to do wearable electronic using fingers and assign one by sound by each fingers, that one after coding part is done I’m connecting it with arduino . I am using drum sound which is drum bass, cymbal , hi hat, clap and snare. So when one fingers is move so come out with one sound… I just dont get the solution for adding more than one sound and to make the sound detect the beat of image pattern. Here is the coding
float n;
float n3;
float n5;
float speed2;
//MUSIC
import ddf.minim.;
import ddf.minim.signals.;
import ddf.minim.analysis.;
import ddf.minim.effects.;
Minim minim;
AudioPlayer s1, s2, s3, s4, s5;
void setup () {
fullScreen(P3D);
noCursor();
smooth();
background (0);
minim = new Minim(this);
s1= minim.loadFile (“hihat.mp3”, 1024);
s2 = minim.loadFile (“cymbal.mp3”,1024);
s3 = minim.loadFile (“bassdrum.mp3”,1024);
s4 = minim.loadFile (“snare.mp3”,1024);
s5 = minim.loadFile (“clap.mp3”,1024);
s1.play ();
s2. play ();
//s3.play ();
s4.play ();
s5. play ();
s4. loop (1);
s2.loop (4);
}
void draw () {
fill(0, 20);
noStroke();
rect(0, 0, width, height);
translate(width/2, height/2);
for (int i = 0; i <s1 .bufferSize() -1; i++) {
float angle = sin(i+(n-2))*40;
float x = sin(radians(i))*(n/angle);
float leftLevel = s1.left.level() * 20;
ellipse(i, i, leftLevel, leftLevel);
rotateZ(n*-PI/3*0.05);
fill (random(255), random (255), random (255));
//fill(#00ccff, 90); //Light Blue
}
n += 0.008 ;
n3 += speed2;
n5 += speed2;
exit ();
}