Ableton Link on Linux using jack_link and Qtractor, PureData or SuperCollider

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: MattKingUSA, khz

Post Reply
studio32

Ableton Link on Linux using jack_link and Qtractor, PureData or SuperCollider

Post by studio32 »

Disclaimer: jack_link may not work perfectly in all situations. The ideal situation is that a application has native Link support and I hope this howto inspires developers to implement it and users to ask for it, cause it is a interesting and more flexible way to sync applications. Because of the many modular tools on Linux, Link would be especially nice for the Linux platform I think.

There is also a alternative for jack_link, which might be worth to test
https://github.com/x37v/jack_transport_link


The goal is to help you find the resources needed to start fiddling with Ableton Link on Linux, to see what it is and what it can do.

Apps that support Ableton Link natively (which is the best probably) are Carla, SuperCollider, PureData and Bitwig, probably more.


Ableton Link is designed to jam together on the local network using iOS apps etc. But bigger pieces of software like Ableton Live and Bitwig Studio do also have Link support. As well as hardware devices like the MPC Live and such. Ableton recommands to use Link above MIDI Clock I saw on their website.

On Linux you've jack_transport to sync two applications together. Designed to sync any JACK application with Ardour. But jack_transport is not designed for looping, so when you want to use a looping application or feature while syncing two or more applications, then Ableton Link might be able to help you out. It might safe you too when a application doesn't have jack_transport support, but it has Link support.

You can use jack_link in some cases to sync applications using Jack_transport with Ableton Link.

Quoting Rui Nuno Capela, the developer of jack_link:

jack_link is a two-way bridge

1) Qtractor sets jack-timebase (eg. current tempo/bpm) => jack_link => Link;
2) some Link peer sets tempo/bpm (puredata/supercollider for instance) => jack_link => qtractor.



Using Qtractor and jack_link


The easy way to start fiddling with Ableton Link is probably to use Qtractor and jack_link and use Qtractor to set the tempo.

Follow the steps below to give it a shot, all though I'm not sure if it's the best example, could as well work with jack_transport only, without jack_link :P
(Sees the example with PureData or Supercollider if you're not convinced by this example :wink: )


1) Start JACK and QjackCTL

2a) Launch Qtractor and QmidiArp (very powerful little tool!). (both applications do have NSM support, to make use with multiple applications a little more easy).

2b) To make some quick sounds you could also launch Zynaddsubfx

3) Set Qtractor transport mode on full (default I think)

4) Make a new midi track, with midi clip, connect it to a sound source (ZynaddsubFX) and loop the track/clip.

5) Launch Qmidiarp

6) Set Qmidiarp to connect to Jack Transport (Jack icon)

7) Add a sequence and edit it (plus blue icon)

8 ) Connect Qmidiarp to a sound source (Zynaddsubfx)


9) Download jack_link:
https://github.com/rncbc/jack_link

10) go to the folder and run the application in your terminal

Code: Select all

./jack_link

You are now able to change the tempo of the jack_transport via Qtractor. Hopefully your favorite app with jack_transport support will follow the tempo settings (apps that store their data in memory, looping apps are other candidates to think off).

Notes:

I had to use Qmidiarp from git, to work with NSM without a bug: https://sourceforge.net/p/qmidiarp/code/ci/master/tree/


Using PureData and jack_link

For the second way to use jack_link, you can use PureData.

To get it working with PureData you can follow this guide: https://cdm.link/2016/11/free-jazz-now- ... pure-data/)

Make the object and use the help file of the object basically.
Make sure you connect PureData to JACK and I've set DSP on, but it might not be needed if you only use it for Link.

Then download jack_link:
https://github.com/rncbc/jack_link

go to the folder and run the application in your terminal

Code: Select all

./jack_link
Launch your application with JACK and jack_transport, make sure it uses jack_transport and make sure that jack_transport is running (via QjackCTL for instance).

You can set the tempo via PureData now and hopefully your JACK application (qmidiarp for instance) will follow the new tempo of jack_transport.


Using SuperCollider and jack_link


For the second way to use jack_link, you can use SuperCollider.

Here is a nice intro to the environment of SuperCollider, which could give you a kickstart: https://youtu.be/ntL8QDOhhL8

Supercollider doesn't have Jack_transport, so Ableton Link can help us out here.

In Supercollider there is the LinkClock Class, see the helpfile, which also has the example code. This code should get you going (same code more or less as in the helpfile):

Code: Select all

//So, Link is not ideal for music involving frequent tempo or meter changes.)

//Therefore, you should not change the quantum in the middle of a performance. Ableton recommends to set the quantum just before beginning.

(
TempoClock.default = LinkClock.new.latency_(s.latency).permanent_;
l = LinkClock(1).latency_(Server.default.latency).permanent_;
)

////GUI

(
var win = Window("LinkClock", Rect(200, 200, 500, 100)).front,
peersBox, tempoBox, barsBox, beatsBox,
font = Font.default.copy.size_(32),
boldFont = font.boldVariant,
controller, task;

win.layout = HLayout(
    StaticText().font_(font).string_("Peers:"),
    peersBox = NumberBox().font_(boldFont).align_(\center).fixedWidth_(80),
    StaticText().font_(font).string_("Tempo:"),
    tempoBox = NumberBox().font_(boldFont).align_(\center).fixedWidth_(120),
    StaticText().font_(font).string_("Now:"),
    barsBox = NumberBox().font_(boldFont).align_(\center).fixedWidth_(80),
    beatsBox = NumberBox().font_(boldFont).align_(\center).fixedWidth_(80)
);

[peersBox, barsBox, beatsBox].do { |view| view.enabled_(false) };

tempoBox.action = { |view| l.tempo = view.value / 60 };
tempoBox.value = l.tempo * 60;
peersBox.value = l.numPeers;

task = Routine {
    var bars, beats;
    loop {
        bars = l.bar;
        beats = l.beatInBar;
        {
            barsBox.value = bars;
            beatsBox.value = beats;
        }.defer(l.latency);
        1.0.wait;
    }
}.play(l, quant: 1);

controller = SimpleController(l)
.put(\tempo, {
    defer { tempoBox.value = l.tempo * 60 }
})
.put(\numPeers, {
    defer { peersBox.value = l.numPeers }
})
.put(\stop, { defer { win.close } });

win.onClose = { task.stop; controller.remove };
)

helpfile:
http://doc.sccode.org/Classes/LinkClock.html

It will give you a transport GUI.

This will give you some basic sound pattern in SuperCollider, using scide:

Code: Select all

(
	Pbindef(\linktest, 
			\degree, 0,
			\octave, 4,
			\sustain, 0.1,
			\dur, 1/1,
			\amp, 0.5,
	);
)


Pbindef(\linktest).play;
Pbindef(\linktest).stop;

Then download jack_link:
https://github.com/rncbc/jack_link

go to the folder and run the application in your terminal

Code: Select all

./jack_link
Of course you've JACK with QjackCTL running before you launched SuperCollider.

You are now able to change the tempo of the jack_transport via the LinkClock GUI in SuperCollider. Hopefully your favorite app will follow. See quote below, to find out which apps are suitable for it most likely.

You could get Tidal Cycles to work via Carabiner (see link below).

Again, see helpfile for more info: http://doc.sccode.org/Classes/LinkClock.html

Native Link support:
- Carla
- Supercollider
- PureData
- Bitwig
- VCV Rack
-

Reported success with jack_link:
- Qtractor
- Carla (with qmidiarp lv2, others like B.SEQuencer failed, so depending on plugin)
- Qmidiarp
- Patroneo
- SuperBoucle (+ fork SpinTool, all though it crashes here, don't think it's related)
- Renoise (Renoise Redux works in Carla)
- Ardour (syncing only, no tempo changes!)


Interesting candidates:
- Seq66 (didn't work)
- Non-sequencer (didn't work)
- B.SEQuencer (didn't work in Carla)
- Radium (didn't work)
- Sooperlooper
- Luppp
- Hydrogen
- Kluppe
- ...
- Any app / synth that can sync tempo?
(Ableton recommends Link above Midi Clock: https://help.ableton.com/hc/en-us/artic ... e-via-MIDI)



More info:
SuperCollider external sync: LinkClock (Ableton Link) and MIDISyncClock
With supercollider, puredata and VCVRack
https://www.youtube.com/watch?v=rdc-uPf ... e=emb_logo

jack_link alternative https://github.com/x37v/jack_transport_link
https://www.youtube.com/watch?v=rdc-uPf ... e=emb_logo SuperCollider external sync: LinkClock (Ableton Link) and MIDISyncClock
http://doc.sccode.org/Classes/LinkClock.html
https://media.ccc.de/v/lac2018-42-ablet ... c_software
https://github.com/rncbc/jack_link
https://github.com/rncbc/jack_link/issues/9
https://cdm.link/2020/03/supercollider-ableton-link/
https://github.com/Deep-Symmetry/carabiner
https://tidalcycles.org/index.php/Link_synchronisation

Interesting for developers maybe:

https://github.com/falkTX/Hylia/
https://github.com/falkTX/Hylia/blob/master/hylia.h
https://github.com/bdyetton/LinkToPy
https://github.com/gonzaloflirt/link-python (license issue?)

quote:
FYI: Short discussion with the author of Jack Transport on IRC:

> is Ableton Link a better alternative for Jack Transport when dealing with loops?

link is utterly different from jack transport, and they are barely comparable
more than that. link's concept of "sync" is totally different
it's not about absolute position as much as relative musical position (though absolute position is a thing too)
anyway, the simple answer is "jack transport has no concept of loops, so ..."

there's already an implementation for JACK
so in theory they just have to support JACK transport
the problems are deeper than that though
JACK Transport has 1 rather sophisticated concept that Link does not have
that concept may not be useful for any app that keeps all of its data in memory
but is essential for those that do not
looping apps probably keep it all in memory

jack transport has the concept of a "slow start" client
i.e. a DAW that needs to reload 64 tracks into memory to reflect the new position
the actual transport mechanism won't start till all clients are ready (within limits)
this makes it much easier to write such a client
like a DAW

> So for a DAW it needs that rather sophisticated feature, cause it needs to write from disk to memory, whereas a looping app might have it all in memory already, so it could live without that rather sophisticated feature. Do I understand it correct?

right
Last edited by studio32 on Tue Feb 09, 2021 5:15 pm, edited 7 times in total.
Post Reply