Can I convince Linux (kernel/ALSA/Jack) to use an arbitrary UART or serial port (usually /dev/ttyS* or /dev/ttyUSB* or /dev/ttyACM*) to output the MIDI messages?

This is the way MIDI was done on the Amiga, for example. If the electric side is set up correctly, and the UART can be clocked to MIDI rates, transmission should work in principle.

What I'd like to know is, is there a ready software option, configuration, driver, or hack to do this.

2 Answers 2


You can use ttymidi to bridge between uart and alsa.

You should be able to get that to work with the RaspberryPi project, but you will need to compile it yourself.

  • That looks like an interesting workaround and ALSA side sample code, though it sends a non-MIDI protocol at non-MIDI rates over tty. Thanks.
    – XTL
    Mar 17, 2016 at 8:17

That is very difficult. The serial port can be programmed at certain baudrates, which normally vary between 300 Bauds (or so) to 115200 (230400, and 460800 on more recent machines). Most all speeds are however multiples: 300, 600, 1200, 2400, 4800, etc. MIDI however is 31250 Bauds, which is difficult to program, as the there is no 'harmonic' relation. As this is fixed in the PC (and different from the Atari), it represents a serious problem.

Another issue is that MIDI is a current-loop circuit (with opto-couplers), while RS232 works with voltages. You will have to make an external interface to make the compatible.

Then, the final hurdle is the software: Managing the UART is relatively easy, and there are plenty of examples (look for the 'serial programming how-to'. The issue here appears that you probably want to present some standard interface to the MIDI-managing music programs out there. So, your driver will have to manage the UART side, and present the correct interface to the software.

Most modern MIDI interfaces also present timing with the MIDI code to the user program, so that is an extra problem.

So, it is by far easier to buy a cheap USB-to-MIDI interface!

  • Both issues were (perhaps not eloquently) covered in the question and can be solved with suitable hardware. The remaining question is software.
    – XTL
    May 5, 2015 at 18:51
  • 1
    Try rm /dev/midi_device if it exists, then ln -s /dev/ttyUSB0 /dev_midi_device - substitute appropriate device for /dev/midi_device
    – LawrenceC
    May 5, 2015 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.