How do you patch true midi-in duration data.
I'm having trouble calculating the duration of a midi note into my Max For Live device.
I have a device that uses live.step, so i have a toggle to use live.steps duration, or the midi-in data's duration.
My problem is that the duration seems to be one note behind. ie the first note's duration is calculated and used for the 2nd note's duration.
To calculate the duration
I am using midiin -> midiparse -> unjoin 2 -> borax (duration count) -> makenote
I may be wrong but I’d think that’s to be expected? You’re getting duration once the note off is received so it wouldn’t be applied until the following note/step if it’s happening in real time. If you really wanted to you could probably get the clips note dictionary and dump the duration’s into a zl.lookup and cycle through that so it’s one to one, if the length of the clip/seq is the same. But then you’d have to deal with when it happens initially and keeping it updated if the clip is changed. I may be totally wrong but in my head it sounds right.
simply put, you needed to split all the different 127 midi notes onto 127 different channels in order to assign the note off event to the right note on event.
there are varios ways how to implement something like that. it is usually a good idea to track and remember only the "held notes" in one place (coll?) and use that as lookup table, which already contains the continuous time value of the note-on event.
but you could also use a poly~, limit the note amount to 24, and then measure the distance with [timer].
(for the same note number, something which only theoretically exists, it would be right to cut off both notes with a single off event, so dont worry about that.)
Sorry I should've been more specific. I'm no good with words, which is why i patch.
I'm looking for a way to substitute the duration of a midi note. I would like to substitute the duration from live.step's output to midin's output.
Is this possible?