"Controlling note-off with stripnote and flush
The second patch in our tutorial deals with eliminating the note-off messages received from a MIDI device and then controlling them explicitly from a patcher. In many cases, we may want to prevent a keyboard (or other MIDI input device) from turning off a note, preferring to generate the note-off programmatically. In the second patch, we route received MIDI notes from the notein object through the stripnote object, which will eliminate all note-off messages that are coming from our MIDI device. As a result, the remainder of the patch will only see note-on messages, and we will be responsible for turning the notes off when necessary.
One of the most useful tools for maintaining note-on tracking is the flush object. It will create an internal table of note-on messages that have not yet received a corresponding note-off; it can then generate note-off messages for all sustained notes whenever a bang is received in its left inlet. In this case, we are stripping all of the note-off messages, so this table will contain all of the notes that we play on our MIDI device. When we want to turn these notes off, we can hit the button object, which will send a bang message to the flush object. This will generate note-off messages for all of the played notes, then clear the internal table of notes in preparation for the next set of events. Double-click the notein object to select a valid MIDI input device; using your MIDI keyboard source, generate some notes - they will continue to sound until you click the button to flush them. We've also routed the notes to the Max window (using the print object) so we can see what's going on.
Using the stripnote object to control the use of MIDI notes is useful when our playback engine needs to be sensitive to controllers other than the keyboard. Combining stripnote with flush allows us to be certain that MIDI note-off messages will be generated for any notes that were not specifically turned off."
this is in the Max tutorials. Flush is great and all but it seems to clear ALL notes. I tried using Flush with a select 0 but it allows me to hold more than 1 notes but If i let go of another. It all clears. Am I missing an object here that could help me ?