Fix the sustain loop

This commit is contained in:
Jean Pierre Cimalando 2021-03-23 00:04:20 +01:00
parent 80d350d0c5
commit cf7bbdd565

View file

@ -116,7 +116,7 @@ void ADSREnvelope::getBlock(absl::Span<Float> output) noexcept
shouldRelease = true; shouldRelease = true;
break; break;
} }
for (size_t i = 0; i < size; ++i) { while (count < size) {
currentValue = std::max(sustain, currentValue + transitionDelta); currentValue = std::max(sustain, currentValue + transitionDelta);
output[count++] = currentValue; output[count++] = currentValue;
} }