The suggestion below shows how to spork the same process. Go ahead and copy / replace that into the live code.
////////////////////////////////////////////////////live codefun void go() { SinOsc osc => dac; // play the data with a sine wave for (0 => int i; i < nVals; i++) { osc.freq(vals[i]*1000+200); // data values in range 0 - 1 100::ms => now; } } spork ~ go(); while (true) 1::ms => now; // keep the main shred alive so we don't quit
50::ms => now; // start after 50ms SinOsc osc => dac; // play the data with a sine wave for (0 => int i; i < nVals; i++) { osc.freq(vals[i]*1000+200); // data values in range 0 - 1 100::ms => now; }
What about sporking it more than once? Try a first spork, add some time (say 1 second) and spork again before the infinite loop.