<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">If I understand correctly, rates are the frequency in Hz as a float type, e.g. these pairs are equivalent</div><div class=""><br class=""></div><div class="">1::second =&gt; adsr.attackTime;</div><div class="">1.0 =&gt; adsr.attackRate;</div><div class=""><br class=""></div><div>500::ms =&gt; adsr.attackTime;</div><div>2.0 =&gt; adsr.attackRate;</div><div><br class=""></div><div>2::second =&gt; adsr.attackTime;</div><div>0.5 =&gt; adsr.attackRate;</div><div><br class=""></div><div>&nbsp; &nbsp;michael</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 18, 2020, at 1:38 PM, herman verbaeten &lt;<a href="mailto:hverb54@hotmail.com" class="">hverb54@hotmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">Hi Mario,</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">Thanks a lot for your answer. Your script is not so easy to read for me and to imagine what is supposed to happen. I run it and it did exactely the same.&nbsp;</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">Is it correct to say that when i use only&nbsp;<span style="color: rgb(50, 49, 48); font-family: &quot;Segoe UI&quot;, &quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-system, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;" class="">attackRate, decayRate, releaseRate it will create a negative envelope. I mean that instead of rising from 0 to the maximum volume attackRate&nbsp; descents from 0 to a negative volume?</span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><span style="color: rgb(50, 49, 48); font-family: &quot;Segoe UI&quot;, &quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-system, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;" class=""><br class=""></span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><span style="color: rgb(50, 49, 48); font-family: &quot;Segoe UI&quot;, &quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-system, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;" class=""><br class=""></span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><span style="color: rgb(50, 49, 48); font-family: &quot;Segoe UI&quot;, &quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-system, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;" class="">Kind regards,</span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><span style="color: rgb(50, 49, 48); font-family: &quot;Segoe UI&quot;, &quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-system, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;" class=""><br class=""></span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><span style="color: rgb(50, 49, 48); font-family: &quot;Segoe UI&quot;, &quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-system, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; background-color: rgb(255, 255, 255); display: inline !important;" class="">herman</span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div id="appendonsend" class=""></div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><hr tabindex="-1" style="display: inline-block; width: 496.859375px;" class=""><div id="divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">Van:</b><span class="Apple-converted-space">&nbsp;</span><a href="mailto:chuck-users-bounces@lists.cs.princeton.edu" class="">chuck-users-bounces@lists.cs.princeton.edu</a> &lt;<a href="mailto:chuck-users-bounces@lists.cs.princeton.edu" class="">chuck-users-bounces@lists.cs.princeton.edu</a>&gt; namens Mario Buoninfante &lt;<a href="mailto:mario.buoninfante@gmail.com" class="">mario.buoninfante@gmail.com</a>&gt;<br class=""><b class="">Verzonden:</b><span class="Apple-converted-space">&nbsp;</span>dinsdag 18 februari 2020 9:18<br class=""><b class="">Aan:</b><span class="Apple-converted-space">&nbsp;</span>ChucK Users Mailing List &lt;<a href="mailto:chuck-users@lists.cs.princeton.edu" class="">chuck-users@lists.cs.princeton.edu</a>&gt;<br class=""><b class="">Onderwerp:</b><span class="Apple-converted-space">&nbsp;</span>Re: [chuck-users] ADSR AttackRate, decayRate, sustainRate</font><div class="">&nbsp;</div></div><div class=""><div dir="ltr" class=""><div class="">Hi Herman,</div><div class=""><br class=""></div><div class="">These functions (attackRate, decayRate, releaseRate) are the inverse of the time ones (attackTime, decayTime and releaseTime).</div><div class="">Looking at the source code you'll find the methods at row 4911 of ugen_stk.cpp.</div><div class="">You can try the following script to see them in action:</div><div class=""><br class=""></div><div class="">Step step =&gt; ADSR a1 =&gt; blackhole;<br class="">step =&gt; ADSR a2 =&gt; blackhole;<br class="">step.next(1);<br class=""><br class="">second / samp =&gt; float SR;<br class="">250::ms =&gt; dur attack;<br class="">750::ms =&gt; dur decay;<br class="">0.34 =&gt; float sustain;<br class="">890::ms =&gt; dur release;<br class=""><br class="">a1.set(attack, decay, sustain, release);<br class="">a2.attackRate(1::ms / (attack*SR*0.001));<br class="">a2.decayRate( (1 - sustain) / ((decay/ms)*SR*0.001) );<br class="">a2.sustainLevel(sustain);<br class="">a2.releaseRate(sustain / ((release/ms)*SR*0.001));<br class=""><br class="">// trigger the ADSRs and print their current value every 100 msec<br class="">a1.keyOn(1);<br class="">a2.keyOn(1);<br class="">for(0 =&gt; int c; c &lt; 20; c++)<br class="">{<br class="">&nbsp; &nbsp; &lt;&lt;&lt; a1.last(), a2.last() &gt;&gt;&gt;;<br class="">&nbsp; &nbsp; 100::ms =&gt; now;<br class="">}<br class=""><br class="">// release the ADSRs and print their current value every 100 msec<br class="">a1.keyOff(1);<br class="">a2.keyOff(1);<br class="">for(0 =&gt; int c; c &lt; 20; c++)<br class="">{<br class="">&nbsp; &nbsp; &lt;&lt;&lt; a1.last(), a2.last() &gt;&gt;&gt;;<br class="">&nbsp; &nbsp; 100::ms =&gt; now;<br class="">}</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Mario<br class=""></div></div><br class=""><div class="x_gmail_quote"><div dir="ltr" class="x_gmail_attr">On Mon, 17 Feb 2020 at 10:56, herman verbaeten &lt;<a href="mailto:hverb54@hotmail.com" class="">hverb54@hotmail.com</a>&gt; wrote:<br class=""></div><blockquote class="x_gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">Hi,</div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">I was wondering what the function is of&nbsp;AttackRate, &nbsp;decayRate, sustainRate in ADSR.&nbsp;</div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">Normally when using an ADSR,&nbsp; attack only uses time. Same for decay and sustain.</div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">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;" class=""><pre style="margin: 0em; font-size: 12px; background-image: none; background-attachment: scroll; background-color: rgb(248, 248, 248); background-position: 0% 0%; background-repeat: repeat repeat;" class="">The \e state = ADSR::DONE after the
    envelope value reaches 0.0 in the
    ADSR::RELEASE state.
</pre><br class="">Thanks in advance for your assistance.</div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">Kind regards,</div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">Herman</div></div>_______________________________________________<br class="">chuck-users mailing list<br class=""><a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank" class="">chuck-users@lists.cs.princeton.edu</a><br class=""><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank" class="">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br class=""></blockquote></div></div></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">chuck-users mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><a href="mailto:chuck-users@lists.cs.princeton.edu" class="">chuck-users@lists.cs.princeton.edu</a></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" class="">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a></span></div></blockquote></div><br class=""></body></html>