From ed5fb61f3831dc3e39fb6646c1fdad1cca45c279 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Tue, 25 Aug 2020 10:56:12 +0200 Subject: [PATCH] Move a variable declaration Refactor the polyphony checks into reusable blocks --- src/sfizz/Synth.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index 5a0b6103..4903a644 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -979,7 +979,6 @@ void sfz::Synth::noteOnDispatch(int delay, int noteNumber, float velocity) noexc SisterVoiceRing::offAllSisters(selfMaskCandidate, delay); } - auto parent = region->parent; // Polyphony reached on region if (regionPolyphonyArray.size() >= region->polyphony) { @@ -995,6 +994,7 @@ void sfz::Synth::noteOnDispatch(int delay, int noteNumber, float velocity) noexc } // Polyphony reached some parent group/master/etc + auto parent = region->parent; while (parent != nullptr) { if (parent->numPlayingVoices() >= parent->getPolyphonyLimit()) { const auto activeVoices = absl::MakeSpan(parent->getActiveVoices());