Check the triggering channel for CCs and bends
This commit is contained in:
parent
393984e3f3
commit
3f02f46213
1 changed files with 10 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue