From e1a3248f99332f7023983f62b480d0e59c9d15ad Mon Sep 17 00:00:00 2001 From: Christopher Arndt Date: Mon, 14 Oct 2019 16:24:42 +0200 Subject: [PATCH] Adjust current envelope output value when attack/release/Base is changed Signed-off-by: Christopher Arndt --- plugins/TransportGate/EnvelopeAR.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/TransportGate/EnvelopeAR.cpp b/plugins/TransportGate/EnvelopeAR.cpp index 60f3999..0fc7ae6 100644 --- a/plugins/TransportGate/EnvelopeAR.cpp +++ b/plugins/TransportGate/EnvelopeAR.cpp @@ -30,11 +30,15 @@ void EnvelopeAR::setReleaseTime(float time) { void EnvelopeAR::setAttackBase(float amp) { attackBase = amp; attackCoef = calcCoef(attackTime, attackBase); + + if (state == ENV_IDLE) output = amp; } void EnvelopeAR::setReleaseBase(float amp) { releaseBase = amp; releaseCoef = calcCoef(releaseTime, releaseBase); + + if (state == ENV_IDLE) output = amp; } void EnvelopeAR::setSampleRate(float rate) {