I’ve been studying the NoteTracker functions, and I realize that it could be very powerful, yet dangerous to use, due to the complexity of managing MIDI and note history in real time. Rather than dive in and possibly find unexpected limits, I’m interested to know how people have used it successfully.
For instance, what problem led the designers to create it in the first place? What was its intent? Do users have stories about it solving problems? Are there any third rails to avoid? (I can imagine that there can be race conditions, where you play a note or play an action at the same time as a function is called. You can get different responses, depending on which item wins)
I’m doing some interesting things, like hit the MIDI kick pedal (with a quick Note Off message after Note On.) My scripting triggers a bass note with a longer duration. But if I play the kick a second time, before the bass note has ended, the first, pending Note Off message can stop the second note early. I’m hoping that on the second kick, I can find that the first bass note is still ringing, turn it off, cancel the pending Note Off, and then send the second bass note into a clean queue. Is this possible?
Anyway, the original intent and successful uses might give me some new ideas and help me avoid trying things that it’s not meant to do. Thanks!
NoteTracker was created very early, probably in GP V2 to help you keep track of what notes are pending when you are managing your own MIDI messages solely with GP Script.
It does exactly what it says!
But there is no such thing as a duration in the MIDI world and there is no such things as a clean queue in the MIDI world - MIDI messages are not tagged. So once you’re in the GP Script world, you’re basically on your own. You can certainly do what you describe with GP Script but you’d have to manage all the events yourself - NoteTracker can help you by informing you of what’s pending and there’s a way to just send out all pending NoteOff messages with it but that’s it.
I’m thinking that I could call that function, and call ClockTime(), add the duration, and store the value. (Let’s assume that startTimeMS is 0.) Later, when I get a new event, I call ClockTime() again. If that value is less than my stored value, there is a Note Off event pending, due to the earlier PlayNote call.
If I then send a Note Off for that same note number, will that cancel the Note Off that is pending, due to my earlier PlayNote call? If not, is there another way to cancel it?
This would be really helpful for playing one-shots from drum triggers.