use Sampler
@author
import ddf.minim.spi.*;
import ddf.minim.signals.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.ugens.*;
import ddf.minim.effects.*;
Minim minim;
AudioOutput out;
Sampler kick;
Sampler snare;
Sampler hihat;
void setup(){
size(300, 200);
minim = new Minim(this);
out = minim.getLineOut();
kick = new Sampler("kick.wav", 4, minim);
kick.patch(out);
snare = new Sampler("snare.wav", 4, minim);
snare.patch(out);
hihat = new Sampler("hihat.wav", 4, minim);
hihat.patch(out);
}
void draw(){
}
void keyPressed(){
switch(key){
case 'z':
kick.trigger();
case 'x':
snare.trigger();
case 'c':
hihat.trigger();
}
}