// the simplest possible minim sketch! // Adam Parrish import ddf.minim.*; AudioSample samp; // declare audiosample object void setup() { size(200, 200); Minim.start(this); // start minim with reference to our applet ("this") samp = Minim.loadSample("bleep.mp3"); // "bleep.mp3" must be in your data folder } void draw() { background(0); if (mousePressed) { background(255); } } // simple as pie: trigger the sample when the mouse is clicked void mousePressed() { samp.trigger(); } void stop() { samp.close(); // you must close() every sample you open! super.stop(); // this ensures that processing's default stop() functionality happens }