[chuck-users] ChubbY (ChucK in Ruby)?

Michael Heuer heuermh at gmail.com
Thu Feb 12 21:46:22 EST 2009


Stephen Sinclair wrote:

> One thing to check out on this topic however is Vessel, a ChucK~-like
> thingy running on top of Lua:
>
> http://www.mat.ucsb.edu/~wakefield/lua~/lua~.htm

That page has some interesting examples.  Here's something similar to
the Polyrhythm one done in Chuck and LiCK

polyrhythm.ck:

class Pattern extends FloatProcedure
{
    dur step;
    float freq;
    float pan;
    SinOsc sin;

    fun void connect()
    {
        sin => Echo e => Pan2 p => dac;
        0.2::second => e.delay;
        pan => p.pan;
        freq => sin.freq;
        0.0 => sin.gain;
    }

    fun void run(float value)
    {
        0.5 => sin.gain;
        step => now;
        0.0 => sin.gain;
    }
}

Pattern right;
0.25::second => right.step;
440 => right.freq;
0.5 => right.pan;
right.connect();

Pattern left;
1::second / 6 => left.step;
330 => left.freq;
-0.5 => left.pan;
left.connect();

spork ~ Loops.loop(right, right.step, 18::second).run();
spork ~ Loops.loopN(Loops.loop(left, left.step, 16::second), 0::ms,
2::second, 1).run();

10::second => now;
<<<"done">>>;


The loop methods are

loop(FloatProcedure, wait between procedure calls, total length of time to loop)

and

loopN(Procedure, wait between procedure calls, initial offset, number
of times to loop)

   michael


More information about the chuck-users mailing list