Have a look at the amidi and/or aseqdump programs.
OK, I looked at the program, and although I'm not too sure how it
works, I came across what may be a bad omen: listing devices (amidi -l)
doesn't respond with any devices.
Also,
$ amidi -S 12
responds with
ALSA lib rawmidi_hw.c:231:(snd_rawmidi_hw_open) open /dev/snd/midiCODO
failed: No such device
cannot open port "default": No such device
Kevin