Correct the self-masking behavior

This commit is contained in:
Paul Ferrand 2020-06-23 00:21:30 +02:00
parent 8251160633
commit 498e1b95bb

View file

@ -884,6 +884,14 @@ void sfz::Synth::noteOnDispatch(int delay, int noteNumber, float velocity) noexc
noteOffDispatch(delay, voice->getTriggerNumber(), voice->getTriggerValue());
}
// Polyphony reached on note_polyphony
if (region->notePolyphony && notePolyphonyCounter >= *region->notePolyphony) {
if (selfMaskCandidate != nullptr)
selfMaskCandidate->release(delay);
else // We're the lowest velocity guy here
continue;
}
auto parent = region->parent;
// Polyphony reached on region
@ -910,14 +918,6 @@ void sfz::Synth::noteOnDispatch(int delay, int noteNumber, float velocity) noexc
parent = parent->getParent();
}
// Polyphony reached on note_polyphony
if (region->notePolyphony && notePolyphonyCounter >= *region->notePolyphony) {
if (selfMaskCandidate == nullptr)
continue; // We're the lowest velocity guy here
selectedVoice = selfMaskCandidate;
goto render;
}
// Engine polyphony reached, we're stealing something
if (selectedVoice == nullptr) {
selectedVoice = stealer.steal(absl::MakeSpan(voiceViewArray));