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());
|
||||
for (auto& voice : voices) {
|
||||
voice->renderBlock(tempSpan);
|
||||
buffer.add(tempSpan);
|
||||
if (!voice->isFree()) {
|
||||
voice->renderBlock(tempSpan);
|
||||
buffer.add(tempSpan);
|
||||
}
|
||||
}
|
||||
|
||||
buffer.applyGain(db2mag(volume));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue