From 3f02f46213b22e9c8cdd090f1c2a6c594681737b Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Tue, 17 Dec 2019 21:26:04 +0100 Subject: [PATCH] Check the triggering channel for CCs and bends --- src/sfizz/Voice.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); }