Do not count overflow voices which are over limit
This commit is contained in:
parent
a1f6ec10ad
commit
f5aa3c7b9c
1 changed files with 9 additions and 1 deletions
|
|
@ -794,7 +794,15 @@ void Synth::loadStretchTuningByRatio(float ratio)
|
||||||
int Synth::getNumActiveVoices() const noexcept
|
int Synth::getNumActiveVoices() const noexcept
|
||||||
{
|
{
|
||||||
Impl& impl = *impl_;
|
Impl& impl = *impl_;
|
||||||
return static_cast<int>(impl.voiceManager_.getNumActiveVoices());
|
|
||||||
|
int activeVoices = static_cast<int>(impl.voiceManager_.getNumActiveVoices());
|
||||||
|
|
||||||
|
// do not count overflow voices which are over limit
|
||||||
|
int resultVoices = activeVoices;
|
||||||
|
if (config::overflowVoiceMultiplier > 1)
|
||||||
|
resultVoices = std::min(impl.numVoices_, activeVoices);
|
||||||
|
|
||||||
|
return resultVoices;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Synth::setSamplesPerBlock(int samplesPerBlock) noexcept
|
void Synth::setSamplesPerBlock(int samplesPerBlock) noexcept
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue