Corrected a bug when changing the number of voices where the voices were not completely prepped

This commit is contained in:
Paul Ferrand 2019-11-21 01:46:57 +01:00
parent e65ea37d7a
commit 19171fae14

View file

@ -532,6 +532,12 @@ void sfz::Synth::resetVoices(int numVoices)
voices.clear();
for (int i = 0; i < numVoices; ++i)
voices.push_back(std::make_unique<Voice>(midiState));
for (auto& voice: voices) {
voice->setSampleRate(this->sampleRate);
voice->setSamplesPerBlock(this->samplesPerBlock);
}
voiceViewArray.reserve(numVoices);
this->numVoices = numVoices;
}