[chuck-users] Urgent shot in the dark -- Audible clicks when spawning shreds when SndBuf reads from disk

Kassen signal.automatique at gmail.com
Sun Nov 8 10:51:04 EST 2009


This is what I thought:
> When Mike's script sporks a new playFile() shred, this tells Chuck to read
> in two SndBufs and connect them to dac _before_ the next sample is
> calculated.
Yes, that's right. However, that doesn't mean ChucK needs to do it before a
samp has passed. ChucK needs to calculate -say- 1024 samples as well as do
things like loading a file in the time-span of 1024::samp. The longer the
block becomes the more any sudden peaks in system usage can be spread out.

In ChucK syntax we pretend things like loading files are instantaneous, but
of course they are not in reality; even a simple multiplication will take
some time to be calculated.

This convenient and expressive way of looking at the computer that we use
works very well.... until the underlying system can no longer cope with the
strain at which point we'll see the reality below it shine through.

BTW, your test of writing to a wave file to see whether there are glitches
there won't work; ChucK will always write to wave files correctly, even when
it runs out of cpu. In that case the audible sound will glitch but all
samples will be calculated and written. In the mini you can see this happen;
the displayed value of "now" will start lagging and as soon as the
processing intensive bit is over "now" will be increasing faster than a
second per second until it has caught up.

Hope that helps,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20091108/c55484b7/attachment.html>

More information about the chuck-users mailing list