midimap
The midimap program will intercept MIDI messages on Mac OSX, and manipulate them according to a script.
Some example use cases include: playing a chord when hitting a single key, mapping a sustain pedal to a key, stopping devices from sending reset commands, and printing out intercepted messages.