Hi,
I updated my code from the current development branch to this commit : 682bee39e8c9290758fde396f12065cb1aca4437
and I noticed that the transport playhead is “discrete”.
To be clear:
when I call the edit->getTransport().play (true) method; and the transport starts playing, the value of the cached “position” is not smooth, but it has some kind of discrete update, so visually it looks like it has discrete steps… It doesn’t affect the engine (so clips are played correctly) but I don’t want this strange behavior.
N.B i get the playback position calling edit->getTransport()->getPosition();
I created a simple demo project with a minimal playhead position and a value tree viewer to clarify what I said
Using tagged version 2.1.0 this problem does not seem to occur, but I would really like to update my version of tracktion just because some bugs have been fixed here.
Using the develop branch updated to the last commit
Using the tagged 2.1.0 version
Is the develop brach stable enougth to use ? Or should i use the 2.1.0 version ?
Hmm, it shouldn’t be that stepped I’ll look in to it.
You can poll EditPlaybackContext::getAudibleTimelineTime() though for the most accurate time of what is actually being heard through the speakers. This takes in to account latency in the playback graph.
Yes, i tried with the “MidiRecordingDemo” and in the demo the playhead seems to be smooth.
I copied the playhead component from the MidiRecordingDemo and put it in my code adding some DBG string in the timer callback just for display the current time and i still have this problem :
In my Code :
In the MidiRecordingDemo:
Should i set some flags ? i don’t really know what is going on… just putting a timer on 60Hz and getting the current time from transport it gives me stepped value…
The other thing to consider is if something else is holding up the message thread, that could potentially cause more irregular callbacks to your timer than you’ve requested. So for example if drawing is very slow/intensive or you’re doing some kind of sleep or wait?
Yes, good point @anthony-nicholls. @Fernando can you print the current time in your timer callback but also maybe your paint callback to check the paint interval isn’t really slow?
Yeah this worked for me.
I was drawing a Path to draw the beat grid behaind that was called so many times; i simplify the draw logic and this problem disappeared. Thank you so much !