This should be a common use case for Arduino based electromechanical stuff. You can get a Midi breakout board for an arduino that facilitates communication as a listener, using the old 5 pin DIN connector. MIDI is pretty easy to deal with as it's just serial communication, but the external board is 15 bucks well spent IMO and includes an optoisolator chip to protect your stuff.
I did this a couple years ago with a rig that plays tuned bells, kind of a MIDI carrilon. I'll see if I can find a photo. My thing used servos and not solenoids, and the servos had a dedicated power bus and the arduino was a low voltage controller. For solenoids, it's likely you'll eat some current, so likely some solution with FETs would be preferable. That should be a common use case as well.
Feel free to reach out if you want and I can sent photos or code if that helps. Again, should you go arduino, a MIDI listener situation is pretty well supported at this point, as are power transistors, so it should all be something that's not crazy to prototype, assuming, of course Arduino coding and wiring is something you'd be comfortable with.