<div dir="ltr"><div>Hi Herman,</div><div><br></div><div>These functions (attackRate, decayRate, releaseRate) are the inverse of the time ones (attackTime, decayTime and releaseTime).</div><div>Looking at the source code you&#39;ll find the methods at row 4911 of ugen_stk.cpp.</div><div>You can try the following script to see them in action:</div><div><br></div><div>Step step =&gt; ADSR a1 =&gt; blackhole;<br>step =&gt; ADSR a2 =&gt; blackhole;<br>step.next(1);<br><br>second / samp =&gt; float SR;<br>250::ms =&gt; dur attack;<br>750::ms =&gt; dur decay;<br>0.34 =&gt; float sustain;<br>890::ms =&gt; dur release;<br><br>a1.set(attack, decay, sustain, release);<br>a2.attackRate(1::ms / (attack*SR*0.001));<br>a2.decayRate( (1 - sustain) / ((decay/ms)*SR*0.001) );<br>a2.sustainLevel(sustain);<br>a2.releaseRate(sustain / ((release/ms)*SR*0.001));<br><br>// trigger the ADSRs and print their current value every 100 msec<br>a1.keyOn(1);<br>a2.keyOn(1);<br>for(0 =&gt; int c; c &lt; 20; c++)<br>{<br>    &lt;&lt;&lt; a1.last(), a2.last() &gt;&gt;&gt;;<br>    100::ms =&gt; now;<br>}<br><br>// release the ADSRs and print their current value every 100 msec<br>a1.keyOff(1);<br>a2.keyOff(1);<br>for(0 =&gt; int c; c &lt; 20; c++)<br>{<br>    &lt;&lt;&lt; a1.last(), a2.last() &gt;&gt;&gt;;<br>    100::ms =&gt; now;<br>}</div><div><br></div><div>Cheers,</div><div>Mario<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 17 Feb 2020 at 10:56, herman verbaeten &lt;<a href="mailto:hverb54@hotmail.com">hverb54@hotmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I was wondering what the function is of AttackRate,  decayRate, sustainRate in ADSR. </div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Normally when using an ADSR,  attack only uses time. Same for decay and sustain.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Also the declaration at the end of de memeber description is not very clear to me:</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<pre style="margin:0em;font-size:12px;background:rgb(248,248,248) none repeat scroll 0% 0%">The \e state = ADSR::DONE after the
    envelope value reaches 0.0 in the
    ADSR::RELEASE state.
</pre>
<br>
Thanks in advance for your assistance.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Kind regards,</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Herman</div>
</div>

_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote></div>