Move advanceTime to the end of the callback
This commit is contained in:
parent
1d74968bf0
commit
7b6c1c8106
1 changed files with 5 additions and 2 deletions
|
|
@ -554,8 +554,6 @@ void sfz::Synth::renderBlock(AudioSpan<float> buffer) noexcept
|
||||||
auto temp = AudioSpan<float>(tempBuffer).first(numFrames);
|
auto temp = AudioSpan<float>(tempBuffer).first(numFrames);
|
||||||
auto tempMixNode = AudioSpan<float>(tempMixNodeBuffer).first(numFrames);
|
auto tempMixNode = AudioSpan<float>(tempMixNodeBuffer).first(numFrames);
|
||||||
|
|
||||||
resources.midiState.advanceTime(buffer.getNumFrames());
|
|
||||||
|
|
||||||
CallbackBreakdown callbackBreakdown;
|
CallbackBreakdown callbackBreakdown;
|
||||||
|
|
||||||
{ // Prepare the effect inputs. They are mixes of per-region outputs.
|
{ // Prepare the effect inputs. They are mixes of per-region outputs.
|
||||||
|
|
@ -621,6 +619,11 @@ void sfz::Synth::renderBlock(AudioSpan<float> buffer) noexcept
|
||||||
// Apply the master volume
|
// Apply the master volume
|
||||||
buffer.applyGain(db2mag(volume));
|
buffer.applyGain(db2mag(volume));
|
||||||
|
|
||||||
|
{ // Clear events and advance midi time
|
||||||
|
ScopedTiming logger { dispatchDuration, ScopedTiming::Operation::addToDuration };
|
||||||
|
resources.midiState.advanceTime(buffer.getNumFrames());
|
||||||
|
}
|
||||||
|
|
||||||
callbackBreakdown.dispatch = dispatchDuration;
|
callbackBreakdown.dispatch = dispatchDuration;
|
||||||
resources.logger.logCallbackTime(callbackBreakdown, numActiveVoices, numFrames);
|
resources.logger.logCallbackTime(callbackBreakdown, numActiveVoices, numFrames);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue