Cubase strangeness

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.

timeInSamples 0, bufferSize 256
timeInSamples 256, bufferSize 256

etc.

However, in Cubase I might see something like:

timeInSamples 0, bufferSize 256
timeInSamples 184, bufferSize 256
timeInSamples 440, bufferSize 256

So after the initial hiccup, everything flows as expected.

Anyone any thoughts on this? It only happens on Cubase

Cheers, Lee

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!

1 Like

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.

Cubase does indeed have a negative timeInSamples pre-roll, but then there is this : [RENAMED] No negative time allowed in VST3 wrapper?

There was talk in this linked thread about fixing that, but I’m not sure anything happened.

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.

1 Like

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;