Ah! Well then perhaps the shortest route would be to
just
use amidi combined with one the exec() variants?
I'll study the code of amidi.
But if you do make the effort and boil it down to a
few
lines of clean alsa code, please post it back here. The
example you are writing is short, concise and perfect for a
mini tutorial.
If I get this far, I'll do so.
Best regards
ce