[chuck-users] (casting) in chuck?

Jochen Hartmann jochen.lists at gmail.com
Fri Aug 31 13:00:23 EDT 2007


I am total newbie to chucK. been trying to make time to play with it more
ever since last year but somehow that time didnt arrive until now.

So for today's silly question I was wondering if there is some kind of
implicit casting of objects in chuck?

For instance I want to fill an array with specific UGens and then randomly
retrieve one like so:

//array of UGens
UGen items[2];
SinOsc sin @=> items[0];
SawOsc saw @=> items[1];

//later in my loop

Std.rand(0,1) => int item;
items[item] @=> UGen mysteryOscillator;
mysteryOscillator => dac;

Obviously this is not working right now and I am wondering if I am doing
something wrong syntactically or whether I am trying to do something that
ChucK can't do.

thanks for the help !
- j
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20070831/dbe75995/attachment.htm 

More information about the chuck-users mailing list