Hi!
I'm experiencing some trouble on making ADSR working.
1. I'm using a CONTROL_RATE ADSR.
2. I update ADSR values inside updateControl() and whne note is triggered with this code
MyADSR.setLevels(255,userSustain,userSustain,0);
MyADSR.setTimes(userAttack,userDecay,20,userRelease);
If I trigger MyADSR.NoteOn the ADSR does his curve, goes to 255 in userAttack time, goes to userSustain value (0-255) in userDecay time, stay sustained during 20ms (other time if I change the value), and goes down to 0 in userRelease time. ADSR should remain at sustain value if it doesn't receive NoteOff() instruction.
The biggest problem is when it receives NoteOff() instruction. ADSR triggers release stage but it doesn't goes to 0, It keeps hanging at a value related to the value in which ADSR was when receives NoteOff(). The final value of Relase Stage (if triggered by NoteOff(), is related to the ADSR value when Release stage is triggered thorugh NoteOff().
So mainly I've got this two issues:
1. Sustain time is just related to the SustainTime sent to the class, and is not related to the key pressure duration
2. Release stage doesn't always goes to 0 if it has been triggered throught NoteOff();
Is it possible is there any bug in the library, or most probably is some bad coding by my side?
Thanks in advance