Andrew;<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You&#39;re just making swells, right?</blockquote><div><br>I was assuming the Envelope was for click-removal and the rest of the tone was desired to be of constant volume. I may well be misunderstanding the question.<br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> In that case, the only change should<br>
be that you need to provide ramp-down time of e.duration() =&gt; now.<br></blockquote><div><br>Yes, while it may not be needed here this is a great trick. Any function returning a dur may be chucked to now. This is great as it leads to compact code, it&#39;s expressive, and there is only a single thing to change if we need to speed the piece up or down. You can even take it further, this is perfectly legal as well.<br>
<br>10::my_SinOsc.period() =&gt; now; //advances time by exactly 10 cycles.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Also, make sure you scale the gain so that you keep the overall power<br>
of the signal below 1.0.<br></blockquote><div><br>Yes, that too is a good trick and a good reason to keep track of the number of UGens connected to the dac.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

and then once you expand from 4 to 100 SinOscs you&#39;ll only have to<br>
change the one line of code.<br><br></blockquote><div><br>This too is great advice that could stand repeating. As a rule of thumb I tend to scan my code with my eyes half-closed; anything that looks monotonous or repetitive when looking at it like that is cause for adding a array (or more rarely a function). This keeps code-size down, cuts down on editing time and errors. <br>
<br>All good notes on style.<br><br>Kas.<br></div></div>