Consider the max of the sister voices
This commit is contained in:
parent
298ec7fc0c
commit
2fcd231062
1 changed files with 3 additions and 3 deletions
|
|
@ -528,13 +528,13 @@ sfz::Voice* sfz::Synth::findFreeVoice() noexcept
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
float sumEnvelope = ref->getAverageEnvelope();
|
float maxEnvelope = ref->getAverageEnvelope();
|
||||||
while (idx < voiceViewArray.size() && sisterVoices(ref, voiceViewArray[idx])) {
|
while (idx < voiceViewArray.size() && sisterVoices(ref, voiceViewArray[idx])) {
|
||||||
sumEnvelope += voiceViewArray[idx]->getAverageEnvelope();
|
maxEnvelope = max(maxEnvelope, voiceViewArray[idx]->getAverageEnvelope());
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sumEnvelope < envThreshold) {
|
if (maxEnvelope < envThreshold) {
|
||||||
returnedVoice = ref;
|
returnedVoice = ref;
|
||||||
// std::cout << "Killing " << idx - refIdx << " voices" << '\n';
|
// std::cout << "Killing " << idx - refIdx << " voices" << '\n';
|
||||||
for (unsigned j = refIdx; j < idx; j++)
|
for (unsigned j = refIdx; j < idx; j++)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue