Quick question: How do i define an array of Unit Generators in Chuck? Something like this (obviously not a working example)... Object sines[8]; // create an array for 8 SinOscs for (0 => int i; i < sines.cap(); i++) // put a SinOsc in each slot { SinOsc => sines[i]; (i+1) * 110 => sines[i].freq; // harmonically related tones } thanks, jascha
Hi Jascha! Here you go;
//array of sinoscs.
//instantiation is automatic
SinSoc mySines[10];
for(0=> int i; i
Quick question:
How do i define an array of Unit Generators in Chuck? Something like this (obviously not a working example)...
Object sines[8]; // create an array for 8 SinOscs
for (0 => int i; i < sines.cap(); i++) // put a SinOsc in each slot { SinOsc => sines[i]; (i+1) * 110 => sines[i].freq; // harmonically related tones }
thanks,
jascha _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (2)
-
Jascha Narveson
-
Kassen