From d60a851fc00ec3ff2844bfb0294c51ad07e3fdb6 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Fri, 13 Dec 2019 14:00:25 +0100 Subject: [PATCH] Corrected a bug where the value of the last event was not properly quantized after a call to getQuantizedBlock --- src/sfizz/EventEnvelopes.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sfizz/EventEnvelopes.cpp b/src/sfizz/EventEnvelopes.cpp index a0e5babf..20d56201 100644 --- a/src/sfizz/EventEnvelopes.cpp +++ b/src/sfizz/EventEnvelopes.cpp @@ -66,9 +66,6 @@ template void EventEnvelope::prepareEvents() { if (resetEvents) { - if (!events.empty()) - currentValue = events.back().second; - clear(); } else { absl::c_sort(events, [](const auto& lhs, const auto& rhs) { @@ -152,7 +149,7 @@ void LinearEnvelope::getQuantizedBlock(absl::Span output, Type quant fill(output.subspan(index), currentValue); currentValue = newValue; index = outputSize; - break; + continue; } const auto length = event.first - index - 1; @@ -241,7 +238,7 @@ void MultiplicativeEnvelope::getQuantizedBlock(absl::Span output, Ty fill(output.subspan(index), currentValue); currentValue = newValue; index = outputSize; - break; + continue; } const auto length = event.first - index - 1;