I wanted to write a set of SynV scripts that simulate cursor movement using DAW shortcuts.
I’ve been trying to implement this for a long time, but I haven’t had any success so far.
The scripts eventually call PlaybackControl::seek() to move the playhead, and up to that point, everything seems to work as expected.
However, when I press the space key to start playback, it doesn’t start from the new playhead position. Instead, it jumps back and starts from the original location where the playhead was before the script ran.
I’m not sure why this is happening.
When I manually move the playhead by clicking on the top of the piano roll with the mouse, though, it works differently.
In that case, the DAW’s cursor updates correctly, and playback starts from the current position when I press the space key.
By contrast, when the playhead is moved using the seek() function, it seems the DAW’s cursor doesn’t update, and playback starts from the cursor’s previous position, not the new one set with seek().
If seek() alone isn’t enough, what else should I include in my script to make it behave like a manual click?
Sounds like you forgot to update some global variable perhaps?
Do you have a ‘getCurrentPlaybackPosition’ sort of thing and should you be setting it with the new position?
I haven’t looked at SV’s variables or classes to know where to point you exactly - just a thought ???
Pay attention to the header button in SynthV (the last one with the right arrow). If it is pressed (activated), it affects the behavior of the playhead. If activated => return to the previous position.
When you move your mouse over a position in SynthV and play with SynthV’s internal button (in SynthV header), only SynthV playhead is running, not the DAW (unless you enable ARA mode).
So if you use a “seek” script action, you get the same result.
Playback on SynthV is independent of the DAW (except ARA). The DAW controls SynthV, not the other way around.
And I don’t want to talk about ARA modes because I get strange result every time I try to activate it in my DAW (Cubase 14).