ALSA offers some support for MIDI devices via a sequencer API. Clients can send MIDI events to the sequencer, and it will play them according to the timing of the events. Other clients can then receive these sequenced events and, for example, synthesize them.
Resources
Here are some resources:
‘ALSA Sequencer” ( www.alsa-project.org/~frank/alsa-sequencer/index.html ), a design document.
“ALSA Programming HOWTO” ( www.suse.de/~mana/alsa090_howto.html ) includes writing a sequencer client, a MIDI router, combining PCM and MIDI (miniFMsynth), and scheduling MIDI events (miniArp).
MIDI Sequencer API ( http://alsa-project.org/alsa-doc/alsa-lib/group___sequencer.html ...