<div dir="ltr"><div><div><div>Hi,<br><br></div>yap, the following is a possible solution:<br><br>Step step =&gt; ADSR adsr =&gt; SinOsc oscil =&gt; dac;<br><br>step.next(500);<br>adsr.set(5::ms, 150::ms, 1, 500::ms);<br><br>while(true){<br>    adsr.keyOn();<br>       <br>    400::ms =&gt; now;<br>    <br>    adsr.keyOff();<br>    <br>    1000::ms =&gt; now;<br>}<br><br></div>cheers,<br></div>Mario<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-11-01 16:17 GMT+00:00 Michael Heuer <span dir="ltr">&lt;<a href="mailto:heuermh@gmail.com" target="_blank">heuermh@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Yes, I use the following pattern often<br></div><div><br></div><div>220.0 =&gt; float f;<br></div>SinOsc osc =&gt; dac;<br></div>ASDR adsr =&gt; blackhole;<br><br></div>spork ~ updateAtSampleRate();<br><br></div>fun void updateAtSampleRate() {<br></div>  while (true) {</div><div>    f + adsr.last() * f =&gt; osc.freq;<br></div>    1::samp =&gt; now;<br><div>  }<br><div>}<br></div><div><br></div><div>There is also this pattern, which tries to encapsulate the above (whatever you chuck into cv Gain(s) are provided as float parameter(s) to the tick method)<br><br><a href="https://github.com/heuermh/lick/blob/master/lick/module/Module.ck" target="_blank">https://github.com/heuermh/<wbr>lick/blob/master/lick/module/<wbr>Module.ck<br></a><a href="https://github.com/heuermh/lick/blob/master/examples/moduleExample.ck" target="_blank">https://github.com/heuermh/<wbr>lick/blob/master/examples/<wbr>moduleExample.ck<br></a></div><div><br></div><div>Cheers,</div><div><br></div><div>   michael</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Nov 1, 2017 at 11:05 AM, Jean Menezes da Rocha <span dir="ltr">&lt;<a href="mailto:jean@menezesdarocha.info" target="_blank">jean@menezesdarocha.info</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hello,<div><br></div><div>the ADSR UGen, to me, seems to have effect only over amplitude (which is its original function, I concede).</div><div>However, is there any use case where I can use ADSR to map, say, pitch instead of amplitude, in order to avoid recurring to functions and for loops?</div><div><br></div><div>Thanks in advance!</div></div><span class="m_9033115338625127387HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div><div class="m_9033115338625127387m_-5045327889894351668gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Jean Menezes da Rocha<div>Compositor</div><div>Professor</div><div>Doutorando em Música pela Universidade Federal da Bahia</div></div></div>
</font></span><br></div></div>______________________________<wbr>_________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton<wbr>.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.edu<wbr>/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.<wbr>princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.<wbr>edu/mailman/listinfo/chuck-<wbr>users</a><br>
<br></blockquote></div><br></div>