Routing Tidal audio to Ableton

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.

4 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.