Ensure that transition delta is never flushed to 0

This commit is contained in:
Paul Fd 2021-04-10 15:49:11 +02:00
parent edd0b8f04e
commit b364d19930

View file

@ -133,7 +133,8 @@ void ADSREnvelope::getBlock(absl::Span<Float> output) noexcept
if (currentValue <= config::egReleaseThreshold) {
currentState = State::Fadeout;
currentValue = previousValue;
transitionDelta = -currentValue / (sampleRate * config::egTransitionTime);
transitionDelta = -max(config::egReleaseThreshold, currentValue)
/ (sampleRate * config::egTransitionTime);
}
break;
case State::Fadeout: