[chuck-users] Intraspection - an example of what I'm attempting

Rich Caloggero rjc at mit.edu
Sun Nov 7 21:45:57 EST 2010

Whan I run the following code, I get an error at line 7 - class UGen has no 
member 'mix'.
How do I do this type of thing in chuck?

// code
SinOsc s => Chorus chorus => JCRev reverb => dac;
880.0 => s.freq;
.2 => s.gain;
UGen @ ug[];
chorus @=> ug[0];
reverb @=> ug[1];
0.0 => ug[0].mix;

while (true) {
1::second => now;
} // main loop

----- Original Message ----- 
From: "Rich Caloggero" <rjc at MIT.EDU>
To: "ChucK Users Mailing List" <chuck-users at lists.cs.princeton.edu>
Sent: Sunday, November 07, 2010 1:11 PM
Subject: [chuck-users] Intraspection?

>I want to find some way of controlling various parameters via the keyboard. 
>The problem I'm having is that in order to write some sort of generic class 
>that can change arbitrary UGen parameters (or really anything), one needs to 
>know what types your dealing with. Is there a way of asking chuck what things 
> For instance, I can maintain some sort of list of UGens I want to control 
> via an array of UGens, but then when I attempt to access a parameter on one 
> of the objects in that array, it tells me there is no such member in class 
> UGen. THe idea is that the array would contain references to various UGens I 
> want to manipulate, and they may be of any UGen subtype. However, in order 
> to access any members, the compiler needs to know exactly which type each 
> object is.
> Any ideas?
> -- Rich
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

More information about the chuck-users mailing list