[chuck-users] Getting Started with ChucK

Tom Lieber tom at alltom.com
Tue Jul 21 14:26:52 EDT 2009

2009/7/21 Kassen <signal.automatique at gmail.com>:
> I'd like to see a example of what you or Tom (or anyone else for that
> matter) would imagine a Lambda operator would look like in ChucK or what it
> would solve. I suspect we could do most of that sort of thing in other ways
> as well and I fear trouble could well follow. When I started writing my last
> email to this list it seemed to me like anonymous functions that would write
> to parameters at audio rate seemed like a fairly innocent thing, I think
> it's now clear that those aren't as innocent (I went "oops" myself).

Like how you wrote:

now => time start;
SinOsc a => blackhole;
SinOsc b => dac;
{ a.last(); } @=> b.freq;
{ now < start + 5::second ? 5 : 10 } @=> a.freq;
{ (now - start)/second } @=> a.gain;

As long as they don't do the two things you said, change the graph or
advance time, they are pretty harmless. Changing variables is
legitimate as long as they're scheduled as if they were in a
while(samp => now) loop.

Actually, I could imagine a pre-processor that un-anonymizes that
stuff automatically. It's pretty mechanical:

now => time start;
SinOsc a => blackhole;
SinOsc b => dac;
fun void bfreq() { while(samp => now) a.last() => b.freq; }
spork ~ bfreq();
fun void afreq() { while(samp => now) now < start + 5::second ? 5 : 10 }
spork ~ afreq();
fun void again() { while(samp => now) (now - start)/second => a.gain;
spork ~ again();

Tom Lieber

More information about the chuck-users mailing list