Is it possible to get a list of connected midi devices (in code) with the device port details and name - as amidi -l would ?
IO hw:0,0,0 EV-XS USB MIDI Controller MIDI
I hw:0,0,1 EV-XS USB MIDI Controller MIDI
IO hw:1,0,0 UMX 610 MIDI 1
IO hw:2,0 f_midi
I have specific operations for each devices...