Don't bother if the voice is not playing
This commit is contained in:
parent
743b116f24
commit
722073b670
1 changed files with 4 additions and 2 deletions
|
|
@ -360,8 +360,10 @@ void sfz::Synth::renderBlock(AudioSpan<float> buffer) noexcept
|
||||||
|
|
||||||
auto tempSpan = AudioSpan<float>(tempBuffer).first(buffer.getNumFrames());
|
auto tempSpan = AudioSpan<float>(tempBuffer).first(buffer.getNumFrames());
|
||||||
for (auto& voice : voices) {
|
for (auto& voice : voices) {
|
||||||
voice->renderBlock(tempSpan);
|
if (!voice->isFree()) {
|
||||||
buffer.add(tempSpan);
|
voice->renderBlock(tempSpan);
|
||||||
|
buffer.add(tempSpan);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.applyGain(db2mag(volume));
|
buffer.applyGain(db2mag(volume));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue