Sample-accurate Ableton Live transport sync within gen~
Howdy all,
I continue to chip away at my looper project and have learned a ton in the process, especially in regards to gen~. While the core functionality of said looper resides in the gen~ environment, a lot of the control and clock synchronization exists in the MSP realm, including my rudimentary Live transport sync. And this brings me to my question...
Is there a way to create sample-accurate Live transport sync entirely within gen~? Along the lines of what [phasor~ @lock 1] does?
And the why:
I am currently using a phasor~ object in MSP, locked to the Live transport, which I am piping into my gen~ subpatcher where I convert the phasor to pulses - giving me a clock - and then execute certain actions on these clock pulses. The actions need to be sample accurate.
For the most part it is working, but there is some inconsistency in the clock that I am deriving from the phasor~ output. These inconsistencies correspond with the vector size in max4live - 64 samples. Thus, the actions I am triggering in my gen~ patch are occasionally 64 samples late. This is a deal breaker.
From what I understand, audio signals going from the MSP environment into a gen~ subpatcher are still bound by the vector size of the host, and I suspect this is the explanation for the occasional 64-sample inconsistencies, as the phasor~ signal exists in the MSP environment and needs to be passed to the gen~ subpatcher.
I could create the phasor entirely within gen~, yeah, but then I still rely on plugsync~ to tell me when the transport starts or stops (and what beat I am on to track downbeats.) Therefore I will still be at the mercy of the vector size, for if plugsync's "transport started" signal is delayed by the vector size, so will the sync of my phasor. Square one.
I am kinda stumped here. Is there a way I can read Live's transport info from within gen~?
Thanks in advance!