Ensure that transition delta is never flushed to 0
This commit is contained in:
parent
edd0b8f04e
commit
b364d19930
1 changed files with 2 additions and 1 deletions
|
|
@ -133,7 +133,8 @@ void ADSREnvelope::getBlock(absl::Span<Float> output) noexcept
|
||||||
if (currentValue <= config::egReleaseThreshold) {
|
if (currentValue <= config::egReleaseThreshold) {
|
||||||
currentState = State::Fadeout;
|
currentState = State::Fadeout;
|
||||||
currentValue = previousValue;
|
currentValue = previousValue;
|
||||||
transitionDelta = -currentValue / (sampleRate * config::egTransitionTime);
|
transitionDelta = -max(config::egReleaseThreshold, currentValue)
|
||||||
|
/ (sampleRate * config::egTransitionTime);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case State::Fadeout:
|
case State::Fadeout:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue