No need to ramp out killed voice data
This commit is contained in:
parent
8212eb4966
commit
81fe043bb3
1 changed files with 8 additions and 16 deletions
|
|
@ -844,20 +844,20 @@ void sfz::Synth::renderBlock(AudioSpan<float> buffer) noexcept
|
||||||
ModMatrix& mm = resources.modMatrix;
|
ModMatrix& mm = resources.modMatrix;
|
||||||
mm.beginCycle(numFrames);
|
mm.beginCycle(numFrames);
|
||||||
|
|
||||||
|
{ // Clear effect busses
|
||||||
|
ScopedTiming logger { callbackBreakdown.effects };
|
||||||
|
for (auto& bus : effectBuses) {
|
||||||
|
if (bus)
|
||||||
|
bus->clearInputs(numFrames);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
activeVoices = 0;
|
activeVoices = 0;
|
||||||
{ // Main render block
|
{ // Main render block
|
||||||
ScopedTiming logger { callbackBreakdown.renderMethod, ScopedTiming::Operation::addToDuration };
|
ScopedTiming logger { callbackBreakdown.renderMethod, ScopedTiming::Operation::addToDuration };
|
||||||
tempMixSpan->fill(0.0f);
|
tempMixSpan->fill(0.0f);
|
||||||
resources.filePool.cleanupPromises();
|
resources.filePool.cleanupPromises();
|
||||||
|
|
||||||
// Ramp out whatever is in the buffer at this point; should only be killed voice data
|
|
||||||
linearRamp<float>(*rampSpan, 1.0f, -1.0f / static_cast<float>(numFrames));
|
|
||||||
for (size_t i = 0, n = effectBuses.size(); i < n; ++i) {
|
|
||||||
if (auto& bus = effectBuses[i]) {
|
|
||||||
bus->applyGain(rampSpan->data(), numFrames);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& voice : voices) {
|
for (auto& voice : voices) {
|
||||||
if (voice->isFree())
|
if (voice->isFree())
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -914,14 +914,6 @@ void sfz::Synth::renderBlock(AudioSpan<float> buffer) noexcept
|
||||||
// Reset the dispatch counter
|
// Reset the dispatch counter
|
||||||
dispatchDuration = Duration(0);
|
dispatchDuration = Duration(0);
|
||||||
|
|
||||||
{ // Clear for the next run
|
|
||||||
ScopedTiming logger { callbackBreakdown.effects };
|
|
||||||
for (auto& bus : effectBuses) {
|
|
||||||
if (bus)
|
|
||||||
bus->clearInputs(numFrames);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ASSERT(!hasNanInf(buffer.getConstSpan(0)));
|
ASSERT(!hasNanInf(buffer.getConstSpan(0)));
|
||||||
ASSERT(!hasNanInf(buffer.getConstSpan(1)));
|
ASSERT(!hasNanInf(buffer.getConstSpan(1)));
|
||||||
SFIZZ_CHECK(isReasonableAudio(buffer.getConstSpan(0)));
|
SFIZZ_CHECK(isReasonableAudio(buffer.getConstSpan(0)));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue