From 8941f0a8004d2af54966a245e7ad13a84ed87097 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Tue, 18 Feb 2020 11:55:31 +0100 Subject: [PATCH] Sorted the proper array The wrong array was sorted when trying to find a voice to steal --- 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 be974bd2..464b3f75 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -348,7 +348,7 @@ sfz::Voice* sfz::Synth::findFreeVoice() noexcept for (auto& voice : voices) if (voice->canBeStolen()) voiceViewArray.push_back(voice.get()); - absl::c_sort(voices, [](const auto& lhs, const auto& rhs) { return lhs->getSourcePosition() > rhs->getSourcePosition(); }); + absl::c_sort(voiceViewArray, [](const auto& lhs, const auto& rhs) { return lhs->getSourcePosition() > rhs->getSourcePosition(); }); for (auto* voice : voiceViewArray) { if (voice->getMeanSquaredAverage() < config::voiceStealingThreshold) {