From ae7f84204cd061399dca4d168ffec7835eeec482 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Tue, 31 Mar 2020 23:42:36 +0200 Subject: [PATCH] Let the sustain be slightly above zero so that decay checks converge --- src/sfizz/ADSREnvelope.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sfizz/ADSREnvelope.cpp b/src/sfizz/ADSREnvelope.cpp index d44ad9b5..3f5a7f32 100644 --- a/src/sfizz/ADSREnvelope.cpp +++ b/src/sfizz/ADSREnvelope.cpp @@ -34,7 +34,8 @@ void ADSREnvelope::reset(const EGDescription& desc, const Region& region, this->releaseRate = secondsToExpRate(desc.getRelease(state, velocity)); this->hold = secondsToSamples(desc.getHold(state, velocity)); this->peak = 1.0; - this->sustain = normalizePercents(desc.getSustain(state, velocity)); + this->sustain = normalizePercents(desc.getSustain(state, velocity)); + this->sustain = max(this->sustain, config::virtuallyZero); this->start = this->peak * normalizePercents(desc.getStart(state, velocity)); releaseDelay = 0;