Outputting raw MIDI in realtime on Linux

Discussion in 'Python' started by Nick Irvine, Dec 12, 2011.

  1. Nick Irvine

    Nick Irvine Guest

    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:


    (I updated the /dev line.)

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

    Nick Irvine
    Nick Irvine, Dec 12, 2011
    1. Advertisements

  2. Nick Irvine

    alex23 Guest

    Hey Nick,

    I've yet to try this myself although it's long been on my to-do list.

    There are a couple of packages on PyPI that emit MIDI:

    There is also an older project that provides a basic midi step
    sequencer. I can't find a proper package or installer, but you might
    find something useful in the 'midi_functions.py' file here:
    alex23, Dec 12, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.