Skip to content

Commit

Permalink
Fix to pass a Polyphony test.
Browse files Browse the repository at this point in the history
  • Loading branch information
KKQ-KKQ authored and paulfd committed Mar 20, 2024
1 parent 4055582 commit 342cd99
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/sfizz/ADSREnvelope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,17 @@ void ADSREnvelope::getBlockInternal(absl::Span<Float> output) noexcept
// prevent computing the segment further than release point
size = std::min<size_t>(size, releaseDelay);
} else if (releaseDelay == 0 && delay <= 0) {
if (delay < 0) {
// release takes effect this frame
currentState = State::Release;
} else {
// release takes effect the next frame
size = 1;
}
releaseDelay = -1;
} else if (releaseDelay == -1 && currentState < State::Release && delay <= 0) {
// release takes effect this frame
currentState = State::Release;
releaseDelay = -1;
}
}

Expand Down

0 comments on commit 342cd99

Please sign in to comment.