Atte,
I'm not gonna promise anything, but if someone
could shoot mi in the
right direction regarding alsa, API, example code, documentation, I'm
willing to give it a shot...
I've cobbled together a very simple bit of code
that splits MIDI events
according to note values. I wouldn't use it in this form in any serious
way, but it should be enough to give you an idea as to how to build MIDI
routers with Python.
In order to use it, say something like
python midisplit.py 36 60 84
Now midisplit.py will create one MIDI input port and four output ports.
Connect the output ports to soft synths or so, and the input port to a
keyboard. If you hit a key on the keyboard, then midisplit.py will send
it via its first port if the note is between 0 and 35, to the second port
if the note is between 36 and 59, etc. Generally speaking, if you list
n numbers on the command line, you get n+1 output ports, unless you give
no arguments, in which case midisplit will revert to its default behavior
of splitting at note 60.
This code uses MidiKinesis libraries, available at
http://www.math.tu-berlin.de/~brinkman/software/midikinesis/
Hope this helps,
Peter