[Haskell-cafe] Re: Livecoding music in Haskell

Rohan Drape rd at slavepianos.org
Wed Nov 8 06:35:45 EST 2006


On Tue Nov 7 16:32:11 EST 2006, alex wrote:
> Latency I deal with by calculating everything a second or so ahead of
> time, and timestamping my OSC packets with times in the future.  Then on
> the other side I have some scheduling stuff to trigger sounds at the
> right moment, for example in SuperCollider's sclang:

A second seems excessive?  Working directly with ghc <-> scsynth
latencies of ~ 0.075 do not seem to be and issue with even relatively
heavy scheduling loads.

>   response = { 
>     arg time, responder, message; 
>     if (message[1] == 'on',
>       {
>         SystemClock.sched(time - Date.getDate.rawSeconds,
>           {Synth("noisebox",
>                  [\lgain,    message[2] / 100,
>                   \rgain,    message[3] / 100,
>                   \ts,       message[4] / 100,
>                   \browndel, message[5] / 100,
>                   \filter,   message[6],
>                   \envtype,  message[7]
>                  ]
>                 ); nil;
>           };
>         );
>       });
>     };
>     o = OSCresponder(nil, '/noise', response);
>     o.add;

Even sclang, remarkable as it is, will need to be sending time-stamped
bundles for reliable sample-accurate timing?  Even to avoid
perceptible jitter under high load?

Regards,
Rohan



More information about the Haskell-Cafe mailing list