Don't bother if the voice is not playing

This commit is contained in:
Paul Ferrand 2019-12-13 17:08:34 +01:00
parent 743b116f24
commit 722073b670

View file

@ -360,8 +360,10 @@ void sfz::Synth::renderBlock(AudioSpan<float> buffer) noexcept
auto tempSpan = AudioSpan<float>(tempBuffer).first(buffer.getNumFrames());
for (auto& voice : voices) {
voice->renderBlock(tempSpan);
buffer.add(tempSpan);
if (!voice->isFree()) {
voice->renderBlock(tempSpan);
buffer.add(tempSpan);
}
}
buffer.applyGain(db2mag(volume));