Minim and assign character

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;

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 () {
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); ();
s2. play ();
// (); ();
s5. play ();
s4. loop (1);
s2.loop (4);


void draw () {

fill(0, 20);
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);

fill (random(255), random (255), random (255));
//fill(#00ccff, 90); //Light Blue


n += 0.008 ;
n3 += speed2;
n5 += speed2;

exit ();

-a- please post your code by using the
</> Preformatted text button in the editor

-b- as long you have a


inside your draw() loop
you might see a short flicker of the canvas
and no sound will be played

-c- as the drum sample file are possibly short
and all play once ( or 4 times ) from setup
not much to hear,
why you not start with 2 and link them to 2 keys

 void keyPressed() {
 if ( key == 'q' );
 if ( key == 'w' );

so you can experiment.

-d- ignore the show question until the DRUM works.