Basic Midi Note Off/Flush/Hanging Note versus loss of velocity value issue
Hi, I'm stuck with a very basic issue, best to look at the patch.
Either I use 'flush' and then it works fine but I loose the original note-in velocity value.
Or I use the original velocity and am stuck with hanging- notes.
The solution must be very basic, I'm just a bit rusty with Max.
Thanks!!
Can you share a bit more detail about your goal? I'm confused why you're converting from midi to frequency and back to midi. :)
It's for microtonal pitch scales.... that part is working fine...
The issue is where/when to flush the midi notes so that all note-off messages are send
Let me make sure I understand. Midi note comes in, you stash the velocity, calculate a new note value plus pitchbend value to get your microtonal combined value (note + pb). Why do you have to flush? Each note could be taken as a discrete event right?
Maybe like this? Use a buddy to make sure they stay together?
To offer an alternative take, I like to take a decentralized approach for problems like this using poly~. For me, I'd rather send the bend messages to a bendout that's dedicated to the particular needed channel. The reason for this is that it requires a lot less coordination, since you never have to worry about what channel the bendout/noteout/etc. is set to, and this results in less stuck notes or complex logic. This also makes it easy to support things like pitch randomization without having to set up a way of remembering what output pitch corresponds to what input pitch, since the pitch will correspond with the voice.
Here's an example based on the original post using poly~. Using multiple voices will let you have overlapping notes without the tails getting changed. If you set voices = 1, you'll get one that will release each time.
I assumed it was monophonic, but the poly~ object is certainly fascinating!
Thanks!! The buddy option works fine... I need to test some more, on fast notes the pitch bend lags and is less effective, but the problem with hanging notes is solved.
Will check out the poly options as well!
The poly option may help for fast notes since it's distributing them over more channels. (so you should have fewer problems provided that there's not a large amount of overlap)