<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hello Andrew,<br><br>&gt;&gt; Or, is there a way to do what I want to do (build<br>&gt;&gt; more general modulation functions) within the existing framework?<br><br>if you don't mind writing some more code you might want to try the following:<br>(I haven't tested it but it might work)<br><br>class BaseDelay<br>{<br>&nbsp;&nbsp;&nbsp; fun dur delay()<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; fun dur delay( dur _delay )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; // the same for max<br>}<br><br>class MyDelay extends BaseDelay<br>{<br>&nbsp;&nbsp;&nbsp; Delay aDelay;<br><br>&nbsp;&nbsp;&nbsp; fun dur delay()<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return aDelay.delay();<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; fun dur delay( dur _delay )<br>&nbsp;&nbsp;&nbsp;
 {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _delay =&gt; aDelay.delay;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; // the same for max<br>}<br><br>// the same for DelayL and DelayA<br><br>fun void modulator( UGen a, BaseDelay b )<br>{<br>&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp; while( 1 )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; a.last()::ms =&gt; b.delay;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 1::samp =&gt; now;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>Dimitris<br><br>--- Στις <b>Δευτ., 31/08/09, ο/η Andrew C. Smith <i>&lt;acsmith@willamette.edu&gt;</i></b> έγραψε:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br><div class="plainMail">Hey everyone,<br><br>I just found out that you could use more specific classes as function<br>arguments (I know, a little slow).&nbsp; So, I've got:<br><br>fun void modulator (UGen a, DelayL b)<br>...<br>while(1)
 {<br>a.last()::ms =&gt; b.delay;<br>1::samp =&gt; now;<br>}<br><br>and it totally works!&nbsp; Here's the catch: is there a way to make<br>something like this that will work for more general classes?&nbsp; I mean,<br>why don't DelayL and DelayA and Delay all inherit from some more<br>general class that uses a dummy "delay" and "max" argument, so that we<br>can build some awesome functions that have universal applications?<br>There could be an oscillator class to encompass everything with a<br>freq, phase, and sync attribute, and so many others that would make<br>modulating so much easier.<br><br>I expect there to be a totally reasonable answer, because I don't<br>really know much about programming at all, but this seems like it<br>would make sense.&nbsp; Or, is there a way to do what I want to do (build<br>more general modulation functions) within the existing framework?&nbsp; I'd<br>ideally like something that can spork a shred to modulate a
 random<br>parameter, then fade out at the end, so that it's like the signal is<br>receiving random interference that makes it ring mod or something.&nbsp; I<br>can probably figure out how to do it with millions of lines of code,<br>but the more work it is the less likely it is that I'll finish it.<br>Thanks everyone.<br><br>Andrew<br>_______________________________________________<br>chuck-users mailing list<br><a ymailto="mailto:chuck-users@lists.cs.princeton.edu" href="/mc/compose?to=chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br></div></blockquote></td></tr></table><br>



      <hr size=1><font size=-1 face=Arial> 
Χρησιμοποιείτε Yahoo!<br> 
Βαρεθήκατε τα ενοχλητικά μηνύ ματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων <br> 
<a href="http://login.yahoo.com/config/mail?.intl=gr">http://login.yahoo.com/config/mail?.intl=gr</a> </font>