[chuck-users] Playing with fire

Kassen signal.automatique at gmail.com
Fri Aug 21 10:40:32 EDT 2009


Fellow ChucKists,

Yesterday I posted this to the forum and I thought people here might be
amused as well. I suppose it's "code art" but working from the idea that
some art can be ugly. It might also be a bit like a toddler who discovers he
*can* stuff beads up his nose and doesn't stop to pause whether he *should*
do so...

I'm sorry,
Kas.

UGen top;

fun UGen foo(int n)
    {
    if (n <= 0)
        {
        return dac;
        }

    else
        {
        ([new SinOsc, new TriOsc, new SawOsc, new SqrOsc])[ Std.rand2(0, 3)]
@=> UGen bar;

        1.0 / n => (bar $ Phasor).phase;
        (n%3) + 1 => (bar $ PulseOsc).sync;
        (75 * (n-1)) + 1 => bar.gain;
        (5 * n) => (bar $ Shakers).freq;

        if (n == 1) bar @=> top;
        bar => foo(n - 1);
        return bar;
        }
    }

Step stp => Envelope e;
true => stp.next;
6::second => dur loop => e.duration;

while (1)
    {
    top =< dac;
    !(e.value() $ int ) * 10000 => e.target;
    e => foo(([1, 4, 7, 10, 13])[Std.rand2(0,4)]);
    loop => now;
    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20090821/a06b38b6/attachment.html>


More information about the chuck-users mailing list