Hi, got some strange behaviour on Cubase that I wonder if anyone has any idea on.
I have a sequencer and I’m outputting a note when the DAW starts playing (it’s basically position 0 on the timeline) - this can either be audio or MIDI which is routed to a synth. This first note is coming out “early”.
What I mean by that is if I have the metronome on, the note starts playing just before the metronome hits and is perceptable.
This is only an issue when the DAW starts playing - every other note hits perfectly on the metronome hit as expected.
I’m using the timeInSamples from the playhead to get all positional information.
If I’m in Live if I log the information coming into processBlock I get info as would be expected, e.g.
I have no experience with this directly, so sorry in advance if this is of no value, but one thing that does come to mind is maybe a plugin somewhere in the session that adds latency. I think that can work by pre-pumping the latency amount of audio during initial playback. Is it possible between the daws one has a plugin with latency while the other does not? Maybe that process is also somehow entering the play head math. Just a thought. Good luck!
This might be a Cubase weirdness, but just to be sure: are you allowing timeInSamples to be negative? Not sure if Cubase does that, but some DAWs have a preroll that starts before 0.
I would rather use ppqPosition instead of timeInSamples to follow the metronome. But check if ppqPosition has also weird behaviour in Cubase at the start of playback. That issue itself looks like a cubase bug.
Thx - I did use that in the past but it’s not provided in all DAWs whereas timeInSamples is - well, I’ve not come across one yet that doesn’t provide it.
We still have this code added to our Juce repos (which we have to update every time we update Juce for a project) :
/** The time actually provided by the host. May be negative, as opposed to timeInSamples */
info.actualTimeInSamples = processContext.projectTimeSamples;