[chuck-users] how do you maipulate an array with rand2()?

Malik Martin laserbeak43 at gmail.com
Mon Nov 13 22:21:44 EST 2006


hi i already posted this on the forums, but it doesnt seem as active as 
i imagine the mailing list might be(no offense of course).

so here's my post

hi
i'm trying to access an array with rand2() but i get syntax errors:

while( true )
{   
   //1 bar at 180bpm cut into 8ths
   float push[ 0, 166.625, 333.25, 499.875, 666.5, 833.125, 999.75, 
1166.375 ]
    push[Math.rand2(0,7)] => buf.pos;
   
    1333::ms => now;
}

i made a second post with a minor update

i noticed my syntax errors in comparison to otf_06.ck on page 49 in the 
manual and re-wrote it.

// time loop
while( true )
{   
   //1 bar at 180bpm cut into 8ths
   [ 0, 166.625, 333.25, 499.875, 666.5, 833.125, 999.75, 1166.375 ]@=> 
float push[];
    push[Math.rand2(0,7)] => buf.pos;
   
    1333::ms => now;
}

but i still get this error: [SndBufTest1.ck]:line(19): array init [...] 
contains incompatible types...

Malik


More information about the chuck-users mailing list