[chuck-users] comments on GenX

eduard aylon eduard.aylon at gmail.com
Fri Aug 31 17:29:32 EDT 2007

Hi Dan and all,

I've been playing around with the GenX functions and so far I find  
them really useful. Being able to create different curves was  
something I missed from the beginning. So many thanks for that.
However I've found that the coefs member is a bit troublesome in that  
I would prefer it returned a reference to the array of coefficients  
instead of being a write only function which only accepts arrays. If  
it would return a reference to the array I imagine I wouldn't get  
confuse every time I assign the coefficients. So instead of

[1.,2.,3.] => gen.coefs

I think it would be more consistent with Chuck's language if one had  
to assign them like:

[1.,2.,3.] @=> gen.coefs()

But this is not what I find more lacking. I would like to be able to  
access any member of the array at any time, in order to, for  
instance, dynamically change the phase or strength of a particular  
harmonic. And also being able to have access to the .cap() function.  
So I'd like to do things like:

GenX gen;
[1., 2., 3., 4. ] @=> gen.coefs;
for( 0 => int i; i < gen.coefs().cap(); i++ )
	//do something

instead of having to create first a temporal array, assign it to  
coefs and use the cap() from the first array in the for-loop. So, at  
the current state, the code above would translate to

GenX gen;
[1., 2., 3., 4. ] @=> float a[];
a => gen.coefs
for( 0 => int i; i < a.cap(); i++ )
	// do something

and also, I'd like to be able to do:

.5 => gen.coefs()[1];

Is all this now possible? and, if not, do you think it is worth  
having it in future releases?



More information about the chuck-users mailing list