On 8 November 2010 19:35, Rich Caloggero <span dir="ltr"><<a href="mailto:rjc@mit.edu">rjc@mit.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thanx Andy. I was worried that this would be the case; getting too used to Javascript where anything is possible.<br>
Will the casting work for any UGen type? I.e. since most (all) UGens support mix, then can I just pretend that everything in the array is one type (say Chorus for instance) and then use that type's mix?<br><br></blockquote>
<div><br></div><div>Yes. If all of the UGens that you use there support .mix() you can cast to any one type of UGen that has .mix() and use it. </div><div><br></div><div>The one downside to this is that you are removing the safety that the parser gives in type-checking so if somehow some UGen that lacks .mix() ends up in your array you'll crash the VM. With STKInstrument and it's sub-classes this works quite well, with members like .noteOn() being shared so there it's quite safe if done properly. Sadly we lack a "Effect" class that all effects like Churus could extend and that would provide extra safety and convenience in your case.</div>
<div><br></div><div>Hope that helps,</div><div>Kas.</div></div>