amidiauto built in, it allows for setting up MIDI device routings, see this thread for some ideas of what it can do: Midi connection manager. It also reacts to dynamic device changes, so it will make the routing any time you connect the device.
By default, it connects all hardware MIDI ports to software ones, which covers the most common use case of running some audio software to produce sounds, and using MIDI hardware for playing. If routings between hardware devices are needed, then it must be configured in the
/etc/amidiauto.conf file, and the service restarted using
sudo systemctl restart amidiauto
The only thing missing in
amidiauto is handling of multiport devices, it connects only the very first port of a device to other things.