diff --git a/src/sfizz/Voice.cpp b/src/sfizz/Voice.cpp index 93521467..667b4811 100644 --- a/src/sfizz/Voice.cpp +++ b/src/sfizz/Voice.cpp @@ -157,11 +157,17 @@ void sfz::Voice::registerNoteOff(int delay, int channel, int noteNumber, uint8_t } } -void sfz::Voice::registerCC(int delay, int channel [[maybe_unused]], int ccNumber, uint8_t ccValue) noexcept +void sfz::Voice::registerCC(int delay, int channel, int ccNumber, uint8_t ccValue) noexcept { if (region == nullptr) return; + if (state == State::idle) + return; + + if (triggerChannel != channel) + return; + if (region->checkSustain && noteIsOff && ccNumber == config::sustainCC && ccValue < config::halfCCThreshold) release(delay); @@ -199,6 +205,9 @@ void sfz::Voice::registerPitchWheel(int delay, int channel, int pitch) noexcept if (state == State::idle) return; + if (triggerChannel != channel) + return; + pitchBendEnvelope.registerEvent(delay, pitch); }