Calling AudioEffectEnvelope::noteOff repeatedly keeps it in release state
skybrian opened this issue · 1 comments
skybrian commented
I had a confusing bug in my code where an envelope never became inactive. It turns out this is because calling noteOff() when the envelope is already in the release state resets the count, starting it over at the beginning. I expected noteOff() to be idempotent if the note is already being released. (My code was polling a button and calling noteOff() repeatedly if it's not being pressed.)
Verified by looking at the code in github. The workaround is to do your own edge detection, rather than relying on noteOff() to be idempotent.