I have Cubase LE AI Elements 10.5 (fresh install without custom configuration) on Windows 10.
In my JUCE VST3 plugin I take a look at the host provided transport information.
This was a bit problematic first, because the juce_VST3_Wrapper.cpp uses max() to eliminate negative values, which Cubase provides:
info.setTimeInSamples (jmax ((juce::int64) 0, processContext.projectTimeSamples));
info.setTimeInSeconds (static_cast (*info.getTimeInSamples()) / processContext.sampleRate);
To be able to further examine things, I have temporary removed the max() to see negative values.
Without any additional configuration change to Cubase, Cubase will start at timeInSamples = -8160.
The worse thing is, sample no. 0 is somewhere inside of a block, not at the start of a block.
This means, when a song in Cubase is started, we cannot tell when sample position 0 is reached. Am I wrong?
So the start of a “synchronized” LFO in e.g. an effect plugin or the start in a drum sequencer plugin will be wrong. Especially for the latter case this should be quite noticable.
Is there some kind of solution to this problem? How would it be possible to detect or calculate sample position 0 safely? Please note that I would like to revert juce_VST3_Wrapper.cpp to its original state.