[chuck-users] can there be many ::ms in while?

2g electriclightheads at gmail.com
Wed Aug 1 18:34:40 EDT 2007


have just started coding on chuck
was looking for way to let s1 have 3 overtones
flying around him
i know it should be something other than rand2f to handle integers
but my q is about ::ms in while

i wonder which one of these are the right way to use them
i thought the latter might be safe but it seems to give one never
changing long note
and maybe only one another is floating around
but none of them give me an error


style one:

SinOsc s1 => PRCRev g => dac;
SinOsc s2 => g;
SinOsc s3 => g;
SinOsc s4 => g;
.25 => g.gain => g.mix;
while( true ) {
        500::ms => now;
        Std.rand2f(30.0, 220.0) => s1.freq;
        170::ms => now;
        s1.freq() * Std.rand2f(8.0, 16.0) / 8.0 => s2.freq;
        75::ms => now;
        s2.freq() * Std.rand2f(16.0, 32.0) / 16.0 => s3.freq;
        111::ms => now;
        s2.freq() * Std.rand2f(16.0, 32.0) / 16.0 => s4.freq;
}


style two:

SinOsc s1 => PRCRev g => dac;
SinOsc s2 => g;
SinOsc s3 => g;
SinOsc s4 => g;
.25 => g.gain => g.mix;
while( true ) {
        200::ms => now;
        Std.rand2f(30.0, 220.0) => s1.freq;
}
while( true ) {
        170::ms => now;
        s1.freq() * Std.rand2f(8, 16) / 4.0 => s2.freq;
}
while( true ) {
        75::ms => now;
        s2.freq() * Std.rand2f(16, 32) / 8.0 => s3.freq;
}
while( true ) {
        111::ms => now;
        s2.freq() * Std.rand2f(16, 32) / 8.0 => s4.freq;
}


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


More information about the chuck-users mailing list