<div dir="ltr">Howdy,<div><br></div><div>(I&#39;m referring to stk-4.4.4.  Perhaps this is a known problem?)</div><div><br></div><div>I&#39;ve been looking in detail at how ADSR works for Rhodey, and it looks like the effective decay time is twice what one would expect looking at Rhodey&#39;s call to setAllTimes.  For example for adsr_[3] is given a decay time of 0.25 seconds but if a noteOn is sent the decay takes 0.5 secs.</div>
<div><br></div><div>The problem is that Rhodey gives setAllTimes a sustain level of 0, but ADSR ends up computing the decay rate using the default sustain of .5 before it changes sustain to 0.  So it gets a rate half as fast as needed and thus takes twice as long to get to the real sustain.</div>
<div><br></div><div>That happens because the setDecayTime is called before setSustainLevel.  I believe this code (in ADSR.setAllTimes)</div><div>   ...</div><div><div>  this-&gt;setDecayTime( dTime );<br></div><div>  this-&gt;setSustainLevel( sLevel );</div>
<div><div>   ...</div><div></div></div></div><div>should really be</div><div><div>   ...</div><div><div>  this-&gt;setSustainLevel( sLevel );</div><div></div><div>  this-&gt;setDecayTime( dTime );<br></div><div>   ...<br>
</div><div><div></div></div></div></div><div><br></div><div>Having said that, I realize that correct this behavior would end up changing the sound of every instrument that inherits from FM (To compensate all those calls would need to have their decay time doubled).  That&#39;s why I think this might be a known problem.</div>
<div><br></div><div>Am I correct?</div><div><br></div><div>Bob H</div><div><br></div><div><br></div></div>