For now i'm only trying to do some keyPressed to change music. But this is showing me an error, that i dont kow how tot fix it. Error name is "ArrayIndexOutOfBoundsExceptation:1".
<
pre lang="c"> import ddf.minim.*; import ddf.minim.analysis.*;
Minim minim; AudioPlayer[] som=new AudioPlayer[1];
void setup() { size(1280, 720);
minim = new Minim(this);
som[1]=minim.loadFile("C:/Users/User/Documents/Processing/brain_colors/som/Jason - Timeflip.wav"); som[2]=minim.loadFile("C:/Users/User/Documents/Processing/brain_colors/som/metal/Slipknot - The Devil In I.mp3");
for (int i =0; i<som.length; i++) {
som[i].play();
}
}
void draw() { background(0);
//BRAIN SKETCH }
void keyPressed () { if (key == '0') exit(); else { if (key == '2') { som[2].play(); } } }
void stop() {
for (int i =0; i<som.length; i++) {
som[i].play();
}
{
minim.stop();
}
}