[chuck-users] order aspect when fun sharing things in main

2g electriclightheads at gmail.com
Wed Aug 8 22:30:02 EDT 2007


thanks to things taught via this list
am now with isthisokay.ck like this:

SinOsc s1 => Gain g1 => dac;
SinOsc s2 => g1;
SinOsc s3 => PRCRev g3 => dac.left;
SinOsc s4 => PRCRev g4 => dac.right;
.25 => g1.gain;
.25 => g3.gain;
.25 => g4.gain;

fun void ri()
{
while(true)
        {
        300::ms => now;
        s2.freq() * Std.rand2(16, 32) / 16.0 => s3.freq;
        }
}

fun void ga()
{
while(true)
        {
        330::ms => now;
        s2.freq() * Std.rand2(16, 32) / 16.0 => s4.freq;
        }
}

//let's try sporking it
spork ~ ri();
spork ~ ga();

while( true ) {
        Std.rand2(32, 64) * 27.5 / 32.0 => s1.freq;
        1000::ms => now;
        s1.freq() * Std.rand2(8, 16) / 4.0 => s2.freq;
        250::ms => now;
}

am happy with the result it gives
but began to wonder why s2.freq() in the fun doesn't result into an
error when activated
funs are sporked before the main loops starts ... so
s2.freq() might have nothing when funs want to claculate things
maybe

SinOsc s3 => PRCRev g3 => dac.left;
SinOsc s4 => PRCRev g4 => dac.right;

gives some sort of default for .freq?
then at the beginning
am having s3,s4 making non-overtone but random note
that has nothing to do with 27.5hz?

tia

-- 
2g
http://micro.ispretty.com


More information about the chuck-users mailing list