http://www.music-software-development.c ... orial.html
MIDI Tutorial Part 9 - Resetting notes
As we have seen, all NOTE ON message should have its correspondingNOTE OFF message, otherwise the note will continue to sound forever.
There are cases where you want to reset whatever notes are playing. There are basically 4 ways to do this. Some synthesizer do not accept them all, so it is interesting to offer the different possibilities.
1 - Using MIDI controller 123
If you send a MIDI controller 123 on one MIDI channel, the synthesizer will stop all notes playing on that channel. To reset all MIDI channels, send that message for each channel. Please note that some synthesizer do not respond to this message.
2 -MIDI Reset message
This is a one status byte message 0xFF, without data bytes. It should reset the synthesizer to its power-on default, so it also stops all notes playing. Use this message sparingly, as it reset the full synthesizer, not only the notes playing.
3 - MIDI NOTE OFF
You can also send, for each channel (0 to 15) and each note pitch (0 to 127) one MIDI NOTE OFF message. This is the total solution, but requires a lot of MIDI messages to be sent, which may have some reaction time according to the MIDI hardware system you use.
4 - MIDI NOTE OFF - Optimized
In this case, use a table to keep track of the NOTE ON and OFF messages you send for each channel. A buffer of 128 bytes for each channel, representing the number of NOTE ON messages sent to that note,should be incremented by a NOTE ON and decremented by a NOTE OFF. Then, when you want to reset every note, simply go through that table and send a NOTE OFF to each note that is still playing.
Ansonsten: bin auf den Midi-Vortrag gespannt. Was der Zeddy inzwischen so alles kann, fantastisch!