//instantiate a SmpPlay object defined in our class definition //name it salad SmpPlay salad; //declare an array of strings and fill it with //the paths to our sound files //make sure you enclose them in " " and put commas between [ "../jrmy/samples/marimba/marimba0.wav", "../jrmy/samples/marimba/marimba7.wav", "../jrmy/samples/marimba/marimba10.wav", "../jrmy/samples/marimba/marimba13.wav", "../jrmy/samples/marimba/marimba23.wav", "../jrmy/samples/marimba/marimba27.wav", "../jrmy/samples/marimba/marimba31.wav", "../jrmy/samples/marimba/marimba37.wav", "../jrmy/samples/marimba/marimba41.wav", "../jrmy/samples/marimba/marimba43.wav", "../jrmy/samples/marimba/marimba51.wav", "../jrmy/samples/marimba/marimba67.wav" ] @=> string files[]; //define a function that uses the play method of our object fun void proc() { //use a time loop to keep playing files while ( true ) { //randomly access (call) the values of our //files[] array with the Math.rand2 function salad.play( files[Math.rand2(0, 11)] ); } } //this sporks our function //in other words, adds our function to the virtual machine //as its own process (ie shred) spork ~ proc(); //if we don't loop this shred (ie process) to keep it in //the chuck virtual machine then our child shred above //gets canceled too while ( true ) { 1::second => now; }