Bottom line: I'm looking for software, preferably for Linux and open source, which will allow me to send an arbitrary SysEx message when a particular PC or CC message is received, all other messages should just pass through.
In particular: I want to use a keyboard controller with some pads on it to control a pipe organ through a Peterson ICS-4000. For just playing notes this is pretty straightforward MIDI. However, because pipe organs can have multiple stops open simultaneously on a given manual you can't just use PC messages to turn on stops. Instead Peterson uses a well documents SysEx message format which allows for multiple stops to be turned off and on with a single message. So what I want to do is to essentially create some "presets" or, if we're going to speak organ, "combination" by storing some of these hand-crafted SysEx messages in some software and then triggering them by sending a particular CC or PC message. My controller does not allow for me to store SysEx messages to be sent when a pad is pressed, but I can send CC or PC messages.
So, the end result is looking for software where I can store some arbitrary SysEx messages and then have that software watching the MIDI data coming from the controller on a particular channel and then sending a particular SysEx message when a particular CC or PC message is seen. For a bit I thought that midish might allow for this as it does realtime filtering/routing but unfortunately it does not appear to allow arbitrary sending of SysEx messages as a filter, only sending one SysEx at the start of operation.
I did also think about writing something quick and dirty in Python with the mido library but I'm unsure on what the latency might be with that and if it will be acceptable for realtime performance.