I'm not sure about your portnames, but with -Xseq (in JACK 1), my MIDI port
names look like this:
This is very long, but for automated purposes this is OK. I could cut©
and paste it into any script.
But there's jack_alias, this could rename ports for you. Since your ports do
change names or numbers, this might not be the best solution neither. As far
as I know, jack_alias can rename a whole client, not a single port.
With j2amidi_bridge you could patch a JACK port thought to ALSA. You'd still
have to connect a softsynth port to it. But soft synth ports should have the
usual names. Other hardware ports can be connected directly through ALSA
sequencer. I can send you my example .midishrc off-list. There's more than
just a device setup, there are some convenience functions to connect new ports
on the fly.
I hope, this did answer your question, at least partly.
Linux-audio-user mailing list