I'm building a simple little MIDI virtual keyboard Swiss Army utility for test automation purposes at my job.
Just a floating widget to be opened in standalone when I don't have a keyboard or any other MIDI device handy to send things some note on and note off messages.
Currently, the 128-note wide kslider in my proper patch is "dumb" to the responsiveness of mouse clicks; when you click a note it just sends information to makenote at a fixed duration of 100 ms.
I'm trying make kslider behave more like your average "onscreen keyboard" that you would see in someone like NI's plug-ins (or, more importantly, my company's :O ). As in, the onscreen widget is monophonic, but it highlights whatever key is being pressed down and you can drag all around the keyboard and trigger a cascade of note offs - until you hold your mouse down on one note - and then that one will hold in duration until you release.
So I snapped off makenote for noteout and got some cheap-o mousestate polling action going to make kslider pretend like it isn't so old - a mousebutton release bangs a flush in the stream of note-ons, and sets the kslider to note 129 - off the range of MIDI notes.
This chunk of patcher is a sliced of and semi-prepared bit to help with asking my question.
You wanna pay attention to the note pitch / velocity combo message that I put a green circle around.
Please click on a higher note on the kslider and drag your mouse down to a lower note and then release, paying attention to the last note off the the mousestated bang to flush sent.
Note that this "higher notes first" behavior is inapplicable to starting on a lower note and dragging up and releasing on a higher note.
Is there some way that either flush can be swapped out for some cockamamie subpatcher madness that doesn't follow this internal logic, or some configuration of arguments or something that would make flush just kill whatever the LAST note was LAST, regardless of low or high?