Connect and synchronize Hydrogen and Ardour

Setup

  1. Setup and start JACK (either with qjackctl or KXStudio’s Cadence, or in Ardour’s Setup Dialog).
  2. Open both Hydrogen and Ardour.
  3. In Ardour’s Preferences (Menu > Window > Preferences, or Menu > Edit > Preferences), select Sync in the left colulm. Set “External Timecode Source” to “JACK” (this is the default if and only if you have always only used Ardour with JACK). – This step only needs to be done once.
    In Ardour 6.3: Preferences > Transport, under Transport Masters, choose JACK.

To synchronize Hydrogen and Ardour

  1. In Ardour’s Editor Window: Look in the upper left corner, right under the “MIDI Panic” button and the metronome button. Press the button where it says “Int.” so that it changes to a green button where it says “JACK”.
  2. In Hydrogen: go to Tools > Preferences > Audio System. Make sure JACK is chosen. Then press the “Restart output” button. If it gets out of sync during recording, go back and restart output again.
  3. Make Hydrogen the JACK Time Master.
    In Ardour: Session > Properties | Timecode. Un-check “Ardour is JACK Time Master”.
    In Hydrogen: Enable the “J.MASTER” button.

Connect Hydrogen Drums to Ardour Tracks

  1. In Ardour: go to Window > Audio Connections. The Hydrogen drums should appear under “sources: other”. You find your Ardour tracks under "destination: Ardour tracks. Link the drums to the Ardour tracks.
12 Likes

Thank you. Such instructions are very helpful!

With pleasure! I’m happy to share the clarity I found on this yesterday. Statistically speaking, in half a year I’ll be googling how to connect Hydrogen and Ardour, so why not making it easier for my future self x) Hope this will save other people some time too.

4 Likes

Generally there’s two steps for each jack-aware application to use jack-transport.

1- Set the audio engine to ‘Jack’ , and then
2- Set the ‘jack-transport’ to enabled.

you didn’t specify that the jack-transport also needs to be set in Hydrogen.

though there’s a problem I think as I recently learned for basically any time there needs to be a full synchronization of the timeline between two jack-aware applications, and that is the limitation of the change-of-tempo which is kind of broken.

The jack-transport does not have a very definite “tempo change” support in its specs, it says so over here,

https://github.com/jackaudio/jackaudio.github.com/wiki/TransportLimitations
“Tempo changes are underspecified
The current implementation might actually be sufficient to support tempo changes, but the API is not entirely clear on how this should work.”

So testing here, apparently the only way that a tempo-change works correctly between Ardour and Hydrogen, is if Ardour is provided as the Jack-time master.

My recommendation, and afaict is to try to use Ardour as the Jack-time master as much as possible, in order to mitigate any problems later…

^ from this table, you can see that Hydrogen is suppose to support BBT — A test I have performed here is Hydrogen 0.9.7-6 fails to pick up the “change of tempo” sent from Ardour. Possibly further with other thing-question marks as indicated on this chart – so likely Hydrogen is not fully BBT-timing compliant whatever this encompasses… – this can supposedly explain why it fails to send correct tempo-change information to Ardour in the first place.

To make Ardour the Jack-time master, this option needs to be enabled::

In this particular setup I advocate that Ardour is the Jack time-master because then you can work with more than 1 tempo in Ardour and have change-of-tempos sent correctly to Hydrogen…

(If the goal is to have a live-audio signal fed from Hydrogen that’s fine, but I think you should tell users that you should also disconnect Hydrogen from the system speakers, otherwise you get two sources playing the same audio data at the same time.)

Now, once the “JACK” setting is set over “INT/JACK”, the Jack-time Master setting can be done from Session > Properties | Timecode . (before or after does not matter – this other place for an additional jack-transport setting)


For Hydrogen:

When it comes to setting up the jack-transport on Hydrogen, it has a ‘J.TRANS’ button available and it is obvious what it does, however do not enable the ‘J.MASTER’ button beside it as Ardour is already servicing as the Jack-time master.

You would also likely want to be working in “song mode” in Hydrogen to see if the playhead is synchronized and landing on the same bar|beats. The time of minutes+seconds can also be used to inspect synchronization with the jack-transport, though it is better to see if the “bar | beats” are also getting synchronized. (Hydrogen has a “pattern” mode — the time+seconds would reflect the same as Ardour if both have their jack-transport enabled.)

Apparently “jack-transport” is kind of broken for tempo-change, and I didn’t know about that until I read about it very recently. The funny thing is Ardour fails to take the “tempo change” test even when trying to perform it using the jack_transport command. I think most users are not using tempo-change which is why seldomly you would come across it.

Though there’s conflation going on here about what jack-transport tries to accomplish – it prevents the need to do audio/capture between audio ports. The question of audio-remixing of course is something that could be sought, though there’s three distinctions that users should make:: “jack engine”, “jack-transport”, and “jack time-master” settings. The OP post does not mention about the last two between the two applications so it is important to distinguish between them in order to use jack-transport correctly.

1 Like

ahms, thank you for sharing! My intention with the post was to share the things I did to make Hydrogen and Ardour get synchronized and connected, and make it very short, easy and understandable - so that people who don’t know much about these programs can get it up and running as fast as possible. Now your comment is here, so it is of course a resource people can look through; still if we should add something to the post, I suggest adding mandatory “setup” things under the headline “setup”, and then we could add another headline: “other things to try if it still doesn’t work”, and then list things that can be helpful to try (f.ex. “if you have this problem, try this …”). In that way, this post will be a resource for people who are not experts and who are not aiming to fully understand the programs; they just want them up and running. So for me, I don’t want to add anything right now because I haven’t had any more problems myself yet; still, if there are things you want to add according to my suggestion above, please add these, especially “other things to try” that can help people without getting them overwhelmed by too much information.

2 Likes

I have better experiences with Hydrogen as Jack master and not Ardour (I think Hydrogen doesn’t work well as jack slave).
My 2cts.

ahms, I added your suggestion to make Ardour the JACK Time Master.
EDIT: No, I’ve changed my mind. It works better with Hydrogen as Time Master. I had to choose Time Master today for the synchronization to work, so I’m adding it to the post.

Today I used the click in Ardour, and recorded some tracks on that. Then I wanted to add drums with Hydrogen, and needed to synchronize the programs. When I put Hydrogen as JACK Time Master, I found out that the click in Ardour is lagging after the Hydrogen rhythm. I just moved all my recorded tracks a little bit to the left, and it was synced with the Hydrogen drums. After that, I recorded the drums. Then I had to move the Ardour tracks again to sync them with the drum tracks x)

1 Like

Confirmed to still be the case now (November 2022) with Ardour 7.1.0, Hydrogen 1.1.1, and jackd 1.9.21.

Hydrogen is slightly behind Ardour. I reproduced this when Ardour is the jack time master, and the same thing happens when Hydrogen is the jack time master. This is when just pressing play and listening. Because… when I record the outputs, I get different results. For example, I recorded 3 clicks:

  1. Ardour click when sync is set to “JACK”
  2. Ardour click when sync is set to “Int”
  3. Hydrogen click when sync is set to “Int” and Hydrogen is following Ardour

All three land slightly differently:

I’m not sure what to make of it, but one thing is clear: Hydrogen’s output is aligned perfectly with Jack’s beat lines. So the issue is during playback only, and not during capture.

I’m not sure what this means, I just wanted to post the results of my little test.

If you record Ardour’s metronome directly on a track the track’s alignment to “Existing material” (context menu of the track header).

1 Like

I tried it again today and I so far I didn’t manage to make it work. I’m using Hydrogen 1.2.0-beta, and Ardour 8.1 (official build), on Debian 12.2. Some things are in slightly different places, but I found the required options and changed them.

Hydrogen:

image

Ardour:

I tried the reverse configuration: Ardour as time master and Hydrogen as following – this didn’t work either. One success was that when I pressed “play” in QJackCtl control, Hydrogen would start playing.

If I tried to do a similar thing with Ardour following – it wouldn’t react to me pressing buttons on QJackCtl transport.

Did anyone else try the Hydrogen + Ardour combo recently?

Also, what would be a way to debug Jack Transport? Is there a minimal Jack transport utility that allows us to send and monitor Jack Transport events?

I am not at my computer with Ardour at the moment, so cannot check easily, but this section of the manual seems relevant:

I do not see that menu captured in your screenshots.

It seems you have set the transport in Ardour to MIDI Clock (hence M-Clk is displayed in the green button on your screenshot). Click it to switch to “Int.” mode and then right click the button to open the “Transport Masters” dialog:

Choose “Jack” and enable the master by clicking the “Int.” button again. Now Ardour should react to transport controls in QJackCtl.

1 Like

Thank you! This really helped. The Transport Masters dialog was key. The original writeup from 2020 is hard to follow, things are in different places in Ardour 8.2. For example, there’s no “Sync” in the left column of the Preferences window anymore. (“In Ardour’s Preferences (Menu > Window > Preferences, or Menu > Edit > Preferences), select Sync in the left colulm.”)

I can now press play in Ardour and Hydrogen will follow - and vice versa. Strangely, Hydrogen seems to be able to control the transport even when I disable the “J.Master” option in it.

image

The follow-up challenge is how to get the two to sound in sync during playback. When I enable the metronome click in both Ardour and Hydrogen, there’s a significant time difference between the two clicks – I didn’t measure it but it sounds like it’s around a 16th note at around 100BPM, so roughly around 150ms. Ardour is first and Hydrogen is second. When I record the Hydrogen tracks in Ardour (via JACK), then the difference reverts: in the recorded audio Hydrogen is first and Ardour second, by a small but audible amount – maybe 30-40ms.

“JACK Master” describes controlling the shared timebase of all JACK clients. Any client can control the transport without being the “JACK Master”, which Hydrogen’s GUI demonstrates.

Glad it helped.

Correct. It is now a part of session configuration and has been moved to
Session → Properties → Sync in recent versions.

Generally speaking, Ardour has changed a lot in last 3 years and improved extremely IMO. But of course switching from some old version can be difficult and I personally found more convenient upgrading ASAP (risking some minor bugs/incompatibilities, etc.) than waiting for a major release and get lost completely when a project must be finished quickly.

No idea what it can be if tempos and time signatures are matched. Not using Hydrogen for sequencing nowadays but don’t remember such strange problems from the past. No rogue tempo changes in the timeline? Have you tried to reset Hydrogen config and start with a new session?

Just did the same test on Hydrogen 1.2.0-beta, Ardour 8.2 and Jack 1.9.21 (Debian Bookworm) and as you can see the metronome clics are matched perfectly:

But please check alignment settings as showed above. If set incorrectly, it may
exhibit behavior similar to what you described.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.