/* skeleton example which demonstrates "clip" concept its clips don't play any sounds themselves but just print when they fire and report how long they will exist the program starts a sequence of clips at time0 and ends when it has nothing left to do */ // define a "clip" as a function fun void clip1(dur myDur) { <<<"clip1 stuff is now playing for",myDur/second,"seconds">>>; myDur => now; } // define another "clip" fun void clip2(dur myDur) { <<<"clip2 stuff is now playing for",myDur/second,"seconds">>>; myDur => now; } // start a sequence of clips now => time time0; spork ~clip1(5::second); 1::second => now; spork ~clip2(5::second); 5::second => now; spork ~clip1(1::second); 1::second => now; now => time time1; // last item in this program is this print statement <<<"clips played for",(time1-time0)/second,"seconds">>>; // and with nothing left to do this program exits