If you use MIDI on Linux, perhaps you have the same frustrations I do:
- Plug in some controllers, use
aconnect to connect them to some software. All good!
- Now I’m fiddiling about my set up - and I unplug and replug a controller. Maybe I’m tiding up the wires, or perhaps it was an accident, or even a too-loose USB connector (I’m looking at you, Boppad!)
- POOF! The previously set up connection is now lost… I have to find my terminal window and
aconnect again… Or re-run my setup script, tearing down the system and restarting.

Enter, amidiminder - a service that watches your ALSA MIDI ports and connections, and will re-establish them if the ports disconnect and later reconnect! Further, there is a rules file so that you can also have it automatically make connections the first time - based on device names or types.
For example, my rules file has:
# connect things to my looper app, bicycle
bicycle:synths --> Circuit
bicycle:controllers <-- nanoKEY2
bicycle:controllers <--> FaderFox UC44
# use the launchpad as keyboard input to apps
Launchpad Pro --> .app
I just made the first public release, 0.7, which is billed as “early adopter testing”. I’ve used it in several live streamed performances over the last month, so I’d say it’s ready.
It is lacking a bit in documentation, but the executable supports the --help flag for command line options, and the default rules file documents the different forms rules can take.
The release has a built .deb package file for Raspberry Pi - but the code should easily compile on any Linux system. Lastly, if you are running Blokas’ excellent Patchbox distribution, you should disable amidiauto, since this is a superset of that.
Full project on github: https://github.com/mzero/amidiminder