Array/genX issue

From CSWiki
Jump to: navigation, search
Phasor drive => Gen10 g10 => dac;

//uncomment this line and it all works
//g10.coefs( [1., 0.5, 0.3, 0.2] );

//but using a dynamically loaded array does not
float dyn_coefs[25 => int numcoefs];
for (0 => int i; i < numcoefs; i++ ) {
	 
	 Std.rand2f(0.,1.) => dyn_coefs[i];

}
g10.coefs(dyn_coefs);

//even though we can confirm that the array itself looks fine
//the wavetable does not get set
//it seems that the dynamically generated array simply 
//never reaches g10
for (0 => int i; i < numcoefs; i++ ) {
	 
	 <<<dyn_coefs[i], g10.lookup((i $ float)/numcoefs), (i $ float)/numcoefs>>>;

}


// set frequency for reading through table
drive.freq(440.);

while (true) { 500::ms => now; }