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

mike clemow gelfmuse at gmail.com
Fri Feb 13 10:42:07 EST 2009


LiCK: http://github.com/heuermh/lick/tree/master

Michael,

It's great to see an example of this in use!  I think that we should
create an "examples" folder in the LiCK distribution and put this in
there.

And, of course, if functions were objects, this would be even simpler
and, I would argue, clearer / more readable.

-Mike

On Thu, Feb 12, 2009 at 9:46 PM, Michael Heuer <heuermh at gmail.com> wrote:
> 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
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>



-- 
http://michaelclemow.com
http://semiotech.org


More information about the chuck-users mailing list