Ableton / link

Ableton Link
Other
1.08k stars 149 forks source link

Link quantum (downbeat) about a beat and a half off, couldn't fix #143

Open jamshark70 opened 1 month ago

jamshark70 commented 1 month ago

The other day, I tried to use Link in a show, and the quanta didn't sync.

The connection itself was fine: 2 peers on both machines, and I picked up his tempo (125 bpm) right away.

So then we tried a simple test, playing simple downbeats. I was 5 16th-notes early.

link-quantum-desync

So this isn't a case of drift (because the desync was immediate), and it wasn't a case of not connecting (we definitely both saw 2 peers).

We quit and relaunched, and had roughly the same problem. Workaround on the fly was that I would stick to pulsed, but unmetered, material so that downbeats would be irrelevant.

I've used Link from time to time for several years. I've seen connection failures, and I've seen it drift, but I never saw the quantum just stubbornly get stuck a beat and a half off. Wondering how to prevent this in the future. Thanks.

fgo-ableton commented 1 month ago

It is hard for me to tell what exactly the issue here could be. I can't recall anyone having similar issues. In general the quantum is a per peer property that is not synced on the network. It is used by each peer individually to align to a shared timeline. Synced downbeats are only guaranteed when all peers use the same quantum. http://ableton.github.io/link/#beat-alignment So what you are seeing here could be due one peer having the quantum set to 0. In this case tempo is synced, but the peers are not aligned on a quantum grid. If that is not the issue, it would be good to know more about the setup on the iPad.

jamshark70 commented 1 month ago

Synced downbeats are only guaranteed when all peers use the same quantum.

Right, I remember that from the other issue a few years ago.

I'm certain that the SC quantum is 4.0 -- it's initialized from the SC language clock object's beatsPerBar, and this is passed to requestBeatAtTime.

l = LinkClock.new; l.quantum.postln;
-> 4.0

My collaborator just sent me a screenshot showing "Sync Quantum = 1 bar" -- this seems to be the Audiobus iOS app. I'm not 100% certain if this is the Link quantum, though it would be odd if it were not. The Audiobus user manual is not clear about the definition of "one bar" -- I'd assume 4 beats but this doesn't appear to be concretely specified. Actually it's AUM from Kymatica -- user manual suggests that Time Signature sets Link quantum. I'm assuming that's 4 (and confirming with my friend).

fgo-ableton commented 3 weeks ago

I just tried syncing Live and Patterning for iPhone running inside AUM. I was not able to get it out of sync. Patterning allows to use Inter-App Audio or Link as a Clock Source. Both worked for me. It would be interesting to know which setup exactly caused the issue. Also, if you should run into this again, it would be great if you could add a third Link peer and check if that is in sync with one of the other peers.