SoundCipher sc = new SoundCipher(this);
int PIANO = 0,
XYLOPHONE = 13,
ELECTRIC_GUITAR = 27,
ACOUSTIC_BASS = 32,
STRINGS = 48,
ORCHESTRA_HIT = 55,
TRUMPET = 56,
TUBA = 58,
BRASS = 61,
ALTO_SAX = 65,
CLARINET = 71,
FLUTE = 73,
TAIKO = 116,
SYNTH_DRUM = 118;
int[] instruments = {PIANO, XYLOPHONE, ELECTRIC_GUITAR, ACOUSTIC_BASS, STRINGS, ORCHESTRA_HIT, TRUMPET, TUBA, BRASS, ALTO_SAX, CLARINET, FLUTE, TAIKO, SYNTH_DRUM};
void setup() {
size(480, 360);
}
void mousePressed() {
sc.instrument = instruments[(int)random(instruments.length)];
sc.playNote(60, 50, 0.5);
background(random(255), random(255), random(255));
}