Ableton Link Latency

Hello,

I would like to sync and play an Ableton Live instrument with my SuperCollider SynthDefs. However the rhythm is not matching because there’s some latency between the Pdefs. I see that Server.default.latency is 0.2 and I have set up the same latency to Ableton Link, but when I play them simultaneously Ableton is starting first. This is my code:

(
MIDIClient.init;
m = MIDIOut.new(0);
l = LinkClock(130/60).latency_(Server.default.latency);

Pdef(\sc, Pbind(\type, \midi, \midicmd, \noteOn, \midiout, m, \chan, 0, \midinote, 36)).play(l).quant_(4);
Pdef(\live, Pbind(\instrument, \kick, \amp, 1, \dur, 1)).play(l).quant_(4);
)

I could create 2 different tempos with a different latency so they are synced. But latency is not a fixed value and each time that I launch SC the latency between them is diffent. One day is 0.4, the next is 0.5.

Probably I am not understanding how it works, but shouldn’t they be playing with the same latency? Has anybody experimented with Ableton Link latency?

Thank you

You might not need LinkClock for this.

LinkClock is to sync the tempo between multiple sequencers. (And in fact, they can be any Link-capable sequencers – you can use Link without Live.)

So… are you using Live as a sequencer here? If you’re using Live as an instrument host only, then LinkClock is irrelevant. (Asking because it sounds, from the issue description, like you’re only loading the instrument in Live but all the control is in SC.)

There are three latencies involved here: SC server latency, MIDIOut latency, and LinkClock latency. LinkClock latency concerns beat sync, NOT audio or MIDI sync. If you’re not playing sequences in Live and SC together, then you don’t need beat sync. In that case, LinkClock latency won’t fix your problem.

I think MIDIOut latency is what you should be looking at. The behavior might depend on Mac or Windows – which one are you using?

If there is only one Link peer, this is ok, but – if you’re using Link as intended with multiple peers, you shouldn’t create the clock and play immediately. LinkClock needs a little time to find other peers on the network – its timebase may change shortly after creating it. As written, this isn’t a good habit to get into.

But I think in this case you’re not syncing to Live’s clock, so it probably doesn’t matter just now.

hjh

1 Like

Thank you for your explanation. I think that you are right when you say that I don’t need LinkClock. I am only playing the instrument in Live but controlled from SC. I am using Mac.

Is this what you suggested?

(
MIDIClient.init;
m = MIDIOut.new(0);
m.latency = Server.default.latency;

Pdef(\sc, Pbind(\type, \midi, \midicmd, \noteOn, \midiout, m, \chan, 0, \midinote, 36, \amp, 0.8, \dur, 2)).play;
Pdef(\live, Pbind(\instrument, \kick, \amp, 1, \dur, 1)).play;
)

Now the latency has been reduced a lot, but there’s still a tiny difference.

1 Like

Yes, that’s the right idea. You might have to add a small offset to the MIDI latency (or subtract). SC can use the timestamp to plan when to start calculating the audio. Live can only react to the MIDI “as soon as possible” – so you might have to reduce the MIDI latency by a few hundredths of a second.

hjh

1 Like

So you mean to add or substract offset to m.latency. I’ll try that.

Thank you very much.