Outputting raw MIDI in realtime on Linux

Nick Irvine nfirvine at nfirvine.com
Sun Dec 11 21:14:58 EST 2011


I'm trying to output raw, realtime MIDI data (as in note on, note off,
etc) in Linux from Python, and I want the easiest way to do it.  I've
been banging my head on the wall about this for quite some time.  The
reason for this is to reinvent the old vkeybd application, but it's
just me screwing around, so not worth the time doing it in C or
creating a whole whack of supporting libraries.

What I have so far is vkeybd outputting to Qsynth (via an ALSA
VirMidi) to pulseaudio, playing some lovely grand piano.  I want to
replace vkeybd with a Python program of my own design.  Using Qsynth's
Messages window, I can monitor the rawish MIDI signals flowing.

According to http://www.tldp.org/HOWTO/MIDI-HOWTO-10.html , I should
be able to just dump MIDI bytes into /dev/snd/midiC3D0.  However, this
yields nothing: Qsynth does not show receiving it.  I even tried this
C example from the OSS docs, with the same result:

http://manuals.opensound.com/developer/midi.c.html

(I updated the /dev line.)

What do people use to output live MIDI on Linux, assuming it's
possible?

Thanks,
Nick Irvine



More information about the Python-list mailing list