When you've decoded a MIDI message from Hauptwerk, how do you then (dis)engage a stop? If it is with a MIDI message, can't you just arrange that Hauptwerk sends the required message and then, at most, Arduino just relays the message?
If you do need to do some decoding, have a look at Nick Gammon's MIDI_decoder sketch in this thread:
http://arduino.cc/forum/index.php/topic,100382.0.htmlIt decodes pretty well any MIDI message, but you could strip it down to decode only those you're interested in.
Pete