Recorded MIDI won't stay with jack sync enabled

I have this setup:

Musescore 3.6
Ardour 6.9
(Use External Position Sync Source
(JACK master with Start/Stop Active commands enabled))
jack 1.9.19

Musescore is set to time master, and I expect ardour to be following, which it does.
I am also able to start playback in ardour, which I was expecting for that not to work (but that’s not really my problem although I suspect it’s related).

I have musescore instruments mapped to the same MIDI channels that are in ardour and they are routed via jack midi. When I start playing in Musescore or Ardour, ardour plays back all the instruments on its separate midi channels, all using VST plugins. Everything’s good.

Now I record-enable all the MIDI tracks, and global record enable, and then play in Musecore (or ardour) the MIDI shows up in the ardour MIDI tracks, but the ardour midi tracks stay red and disappear once global record enable is turned off or the midi track record enable is turned off.

I get this error in the log:
[ERROR]: Session: cannot have two events of type TransportStateChange at the same sample (1280).

The only way I can record is to put Ardour in INT sync mode, and record. Then it works, and I have to cut up all midi regions and slide them back so that they are back in sync where they would have been if Musescore and Ardour could be started at the same time.

Thanks for any suggestions.

May be related in case it’s helpful:

When using JACK-transport, JACK is the “master” and all clients (Musescore, Ardour) follow. Each client can ask JACK to change state.

Do you mean “Timebase Master” ?

That means the Musescore is responsible to map timecode (hour|min|sec) to music-time (bar|beat). It usually causes inconsistencies, since Ardour has its own tempo-map.

Either way it is unrelated to the issue at hand.

Do you do this while transport is still rolling? Does stopping the transport first make a difference?

Also can you try to start recording with sync set to “JACK”, then while recording, switch to "Int"ernal and Stop in Ardour (you may have to press “Stop” twice).

Yes, I meant Timebase Master. I’ll try it the other way around, but I find Musescore will crash more if it’s not initiating.

Yes, I was planning on trying to switch after I’m done recording to see if that works. I bet you’re right.
I’ll try that this evening. Thanks for the suggestion.

It does keep the midi recording if i switch to INT and hit stop after I’m done recording.
I tried not having musescore do the timebase master and ardour won’t record anything unless I start playing in Musescore with the track and global recording enabled. Kind of strange, I see the midi levels and i see the audio levels going but it won’t record the midi if I hit ‘play’ to record in ardour. has to be musescore that triggers.

Thought I’d close the loop on this. I don’t have this problem anymore after getting the setup working better. I think I had something wrong with jackd and I switched to having it run in command window on its own. With cleaning up the switches and using Synchronized Audio Router, I don’t have the problem anymore.

If anyone else is interested my jack script is this in a batch file (has to be started as admin):
start C:“Program Files”\JACK2\jackd.exe -R -S -X winmme -r -d portaudio -d “ASIO::Synchronized Audio Router” -r48000 -p192

1 Like

Hi there,

I’m having the exact same problem on linux, but using Hydrogen. I’ve been able to work for two weeks on a song without problem, and one day the midi recording not stopping problem appeared and i couldn’t get rid of it.

When Ardour crashed while i launched it via terminal, i found this:

terminate called after throwing an instance of ‘boost::exception_detail::clone_impl<boost::exception_detail::error_info_injectorboost::bad_optional_access >’
what(): Attempted to access the value of an uninitialized optional object.
Abandon (core dumped)

I got this problem both on my desktop and on a fresh Ubuntu Studio install on a laptop (both used Ardour 6.9 and jack 1.9.12). I’ve been able to use Hydrogen and Ardour with Jack Transport correctly on the laptop before it starts to crash.

I should mention, if i remember well, that i installed the synth Vital shortly before those crashes on both computers. Don’t know if it messed with jack during installation, but i thought you should know just in case.

I tried to reinstall jack on the laptop without success, so i don’t know the way to solve it on linux. The workaround to switch to internal clock before stopping the recording works on both computers, though.

I hope that these intels helps a bit, and that a solution for linux is possible. Thanks!

Edit: hm… realizing that i’m on a windows subject… should i post this elsewhere?

You might want to check your jack launch script. Maybe try some different switches to get it work properly.
I suspect my problem was also because the program I was using was sending a lot of unnecessary MIDI messages, and it probably filled the jack buffers. So you might want to run jack_midi_dump, and then connect whatever is outputting MIDI to the “midi monitor” that shows up when you launch jack_midi_dump. You’ll see this when you click on the jack “connect” button.

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