Only zero the remaining samples when the envelope is finished

This commit is contained in:
Paul Ferrand 2020-09-16 08:45:29 +02:00
parent 4d87716a30
commit f969761b5a

View file

@ -145,6 +145,7 @@ void FlexEnvelope::Impl::process(absl::Span<float> out)
while ((!stageSustained_ && currentTime_ >= stageTime_) ||
(stageSustained_ && isReleased)) {
if (!advanceToNextStage()) {
out.remove_prefix(frameIndex);
fill(out, 0.0f);
return;
}