--- layout: default title: MIDI on Linux ---
a2jmidid
is an application that "bridges" between the system MIDI ports and JACK.
First you should be sure that there is no ALSA sequencer support enabled in jack. To do that open qjackctl's Setup window.
In the Settings tab set the MIDI Driver drop down to the none option.
Then go to the Misc tab and uncheck the Enable ALSA Sequencer support option.
Now it's time to restart your jack server before going on.
First thing is checking if a2jmidid is already installed in your system. To do it first start your jack server and then call
a2jmidid -e
from the command. If a2jmidid is there go on with Checking surface control MIDI ports. Otherwise install the newest a2jmidid available and try again.
After starting a2jmidid your control surface MIDI ports should appear in qjackctl's Connections window on the MIDI tab under a2j. If it does go on to the next step: Automatically calling a2jmidid when starting jack. If it doesn't you have to troubleshoot why it didn't. (How to troubleshoot a2jmidid?)
It's troublesome to have to manually start a2jmidid by hand each time you start jack. Here is one way to do it automatically. This step isn't mandatory, it's just a convenience. If you are not interested you can go on to the next step Enabling Ardour's mackie control ports in qjackctl.
Create a script that calls jack if you aren't using one yet. In it change the line that calls jack to have an ampersand at it's end like that:
/usr/bin/qjackctl &
In this case I call qjackctl that starts jack so I include the ampersand in qjackctl's call. If you call jack directly, put the ampersand at the end of it's call line.
Now include the following lines after the line that calls jack:
/usr/bin/sleep 5 /bin/bash -c "/usr/bin/a2jmidid -e" &
All you have to do now is use your new script to call jack.