Routing Tidal audio to Ableton

You can simply synchronize TidalCycles and Ableton Live with Ableton Link: https://tidalcycles.org/index.php/Link_synchronisation
This is much more accurate than a MIDI clock.

Therefore you need the carabiner software started and then type sock <- carabiner tidal 4 (-0.14)in your current session (or you add this line in your startup script).

Note: Unfortunately this link synchronization feature is not implemented in TidalCycles directly, because someone needed to build a connector to the c++ api in haskell.

2 Likes

hey @mrreason thanks for letting me know. i have linked Ableton and Tidal with the carabiner but my latency is still a big issue. Ableton is about 1/32 of a beat late and i have been tweaking for an hour trying to iron it out.

Just to be sure, does Ableton Live and Carabiner looks similar to this?

And can you change the global speed in Ableton, so that it's effects the TidalCycles speed?

If this is the case, try to change the latency in your startup script. I set the latency for me in this way: s.latency = 0.3
In which OS do you try it an do you use your onboard sound card?

[Edit:] Now that I rethink about it, I don't think the sound card should cause a problem because the problem seems to be with the internal audio routing. So it's interesting to know if you're running Windows with Jackd or MacOS with Blackhole.

hey! thanks for the reply. below is what my setup looks like. i am using OSX Catalina with UA Apollo. i am curious if my overall latency in Ableton is causing the issue...47.0ms...

i had actually set my s.latency in SC to 0.0 but changing it back to the default 0.3 just now did not seem to help.

Aaaah I think I see the problem.

As you can see my buffer size is 32 Samples. A higher buffer size leads to latencies and a lower buffer size is at the expense of the CPU. But for me the low buffer size has never caused problems. The right balance between latency and CPU usage depends on your Mac.

Hope this helps!

2 Likes

ok, thanks! i tried using 32 samples, which reduced my output latency to 2.02ms but i'm still not in sync! any other suggestions for me to try? thank you for your assistance with this, by the way :slight_smile:

No problem, I'm glad to help :slight_smile: It seems to me that the output latency from your audio interface is high. Apparently, the problem is no longer TidalCycles and Blackhole. You can try recording something and see if the audio is aligned with the grid. For more information you can visit the Ableton help page for reducing the latency. There is a section "How to reduce audio interface latency".

so...this is interesting. i don't think it's the interface. it's actually the Ableton midi channel that's coming in late. when i do a test recording, Tidal (audio) is closer to the downbeat, and the midi channel follows shortly after. which seems strange...you'd think it would be the other way around.

also, when i increase the BPM in Ableton, i can hear it's increasing the CPS in Tidal. however, resending the sendMsg sock does not reset the BPM in Ableton even though the message itself works.

When you do something like this:

I think that final argument is the latency adjustment in seconds

Ah I missed this and you're totally right. In Sound.Tidal.Carabiner.hs I see:

carabiner :: S.Stream -> Int -> Double -> IO Socket
carabiner tidal bpc latency = do sock <- client tidal bpc latency "127.0.0.1" 17000
       [...]

So I'm just wondering, if this affects the the s.latency in SuperCollider?

Hey @kit-christopher

This is all good advice RE Link which should theoretically be much more stable than Superdirt MIDI.

However, for a different perspective... :slight_smile:

The somewhat hacky method I use involves midi clock rather than Link. You'll need an internal MIDI device (I'm on windows and I use LoopBe Internal MIDI) & set this up as a MIDI output in SuperCollider - you will need to run the code for this each time, but you can add it to your startup file if you don't want to do it manually.

(Because I use SuperCollider for a bunch of different stuff I don't have a lot going on in my startup file, instead I have a few different .sc files that I use as templates depending on what I'm up to - here's an example of one with a typical MIDI out setup).

In SC you want to do something like this (see the general SuperDirt MIDI tutorial for more detail):

MIDIClient.init;

Then the following (if you're using a different device you need to copy the name exactly as it appears in the post window in SC):

~midiOut = MIDIOut.newByName("LoopBe Internal MIDI", "LoopBe Internal MIDI");

Then boot SuperDirt as usual before running:

~dirt.soundLibrary.addMIDI(\midi, ~midiOut);

You can also adjust the latency here using:

~midiOut.latency = 0.45;

You can then use your MIDI preferences in Ableton to accept the sync data coming in from the internal device.

Now for the unpolished part :smiley:

I usually run something like:

d1 "midiclock" $ midicmd "midiClock*48" # s "midi"

And then I usually use (0.2 <~) and change the value to nudge things around until it all lines up...

Again I have a couple of standard .tidal files I use as templates with the MIDI stuff already set up. Here is an example file of me doing a lot of MIDI stuff.

The downside of this method is you can't sync tempo changes in Ableton back to Tidal, Tidal has to always be the leader. The upside is that if stuff is out of sync you can just nudge it around, which you can't really do with Link. Plus it's one less bit of software to worry about (not needing to run Carabiner). It's not very slick, but it does work.

I've used Link a lot in the past and it was particularly helpful in the pre Superdirt MIDI days since clock didn't really work with tidal-midi. Now I'm lazy and just use the MIDI clock since I tend to be syncing to hardware devices too and I find it easier to just have one set of timings to think about.

6 Likes

hey @heavy.lifting, thank you so much for this! i was unaware of the midiOut.latency command in SC and simply bringing that down to 0 did the trick. everything lines up!!! :pray: :pray: :pray:

Happy days!! Glad you've got it sorted.

1 Like

Apologies for dredging this topic, and bringing it back to where it started (routing audio / not midi sync) but I'm having similar issues: Using BlackHole on mac, I created 12ch in SC and tidal automatically sends d1 to orbit 0, etc. (this article) However, the output is always also sent to orbit 0. So: d1 sends to orbit 0 (so far so good) but d2 sends to orbit 1 and orbit 0, d3 sends to orbit 2 and orbit 0, ...

My SC code is almost identical to the one posted above. Could you let me know how fixed this? thnx!

@meneer this is what my setup looks like:

i made a custom device in audio/midi setup called tidalApollo (i have a UA apollo). here's what it looks like:

but make sure you have your audio/midi setup assigned to blackhole before booting supercollider. you want it to see blackhole as both the in and the out.

boot supercollider so that its output looks like this:

*** Welcome to SuperCollider 3.11.0. *** For help press Cmd-D.
Booting server 'localhost' on address 127.0.0.1:57110.
SCDoc: Indexing help-files...
Found 0 LADSPA plugins
SCDoc: Indexed 1824 documents in 1.59 seconds
Number of Devices: 5
   0 : "Built-in Microph"
   1 : "Built-in Output"
   2 : "BlackHole 16ch"
   3 : "Universal Audio Thunderbolt"
   4 : "tidalApollo"

"BlackHole 16ch" Input Device
   Streams: 1
      0  channels 16

"BlackHole 16ch" Output Device
   Streams: 1
      0  channels 16

this is what my audio setup screen looks like in ableton (in/out set to my custom device):

then set your input/output config to look something like this:

set up some channel strips in ableton to look like this. d1 gave me trouble so i just started at d2 and went up from there. i think it has to do with my assigning channel one to blackhole. then set your "audio from" to the corresponding input config listed above.

let me know if this works for you.

thank you! I'll test this in a few days and will update here.

Hi there! I was trying to route the 16 outputs from SC to separate tracks in Ableton using blackhole. With the piece of code above it's working well, but my SC console is launching this message repeatedly:

FAILURE IN SERVER /s_new Group 1335 not found
module 'sound': instrument not found: 99
no synth or sample named '99' could be found.

But it's sounding! Even the sound named "99". What's going on?
Can I found a more "clean" way to get it? As usual, I'm working with this buffer size 1024 * 256. Do I've to increase it?

My guess is that you are starting superdirt twice. If you are starting it with a custom config then don't use superdirt.start as well.

1 Like

Thank you. I've solved it.

Hey~ I've just posted a short guide on how to route multiple channels from TidalCycles to Ableton under Windows 7 using JACK for Windows - right here:

Maybe that's interesting for some of you. :alien:

3 Likes