Fellow ChucKists,<br><br>Envelope.rate() is a read-write function so I thought I&#39;d try to use it to detect the current movement of a envelope, like this:<br>=========================================<br>Envelope e =&gt; blackhole;<br>
<br>e.value(0);<br>e.duration(second);<br><br>e.target(1);<br><br>now + 3::second =&gt; time later;<br>while(now &lt;later)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &lt;&lt;&lt;e.rate()&gt;&gt;&gt;;<br>&nbsp;&nbsp;&nbsp; 10::ms =&gt; now;<br>&nbsp;&nbsp;&nbsp; }<br>================<br>
<br>It now turns out that .rate(), when read from, reports the rate of change Envelope had when it was last set to a target, not necessarily it&#39;s current rate of change (which may well be 0).<br><br>I&#39;d like to propose this behaviour to be changed towards Envelope always reporting it&#39;s current rate of change.<br>
<br>&nbsp;Because Envelope is a part of the STK we may need to be careful with that as other Ugens inherit from it so such changes might affect those. Still; there are a few STK Ugens that are on The List to have a look at because of their envelope (probably ADSR) based behaviour anyway. Stricktly speaking this change could break some ChucK code as well but I find it hard to imagine situations where the current behaviour is more usefull then my proposed change.<br>
<br>Yours,<br>Kas.<br>