midi note length
midi note length
hello, how to get the duration of currently midi note played in midi clip ? thx.
-
- Posts: 6021
- Joined: Mon May 15, 2006 12:15 pm
Re: midi note length
call "get_notes" on the target clip, and concurrently observe "playing_position".
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1
MacStudio M1Max 32Go OS 12.3.1
Re: midi note length
notein > borax
borax reports the duration at note off.
borax reports the duration at note off.
copy the text, open Live > drag in empty M4L device > open Max editor > paste > save M4L device
https://docs.cycling74.com/max8/vignett ... ng_patches
https://doubleUG.bandcamp.com/releases
https://docs.cycling74.com/max8/vignett ... ng_patches
https://doubleUG.bandcamp.com/releases
Re: midi note length
yep. thx.
- borax doesn't fir as I need duration at note on.
- "get_note" & "playing_position" : yes I supposed something like that but I can't achieve it. could you share the code please ?
- borax doesn't fir as I need duration at note on.
- "get_note" & "playing_position" : yes I supposed something like that but I can't achieve it. could you share the code please ?
-
- Posts: 6021
- Joined: Mon May 15, 2006 12:15 pm
Re: midi note length
Don't have any code and no time for now, sorry !elt.net wrote:yep. thx.
- borax doesn't fir as I need duration at note on.
- "get_note" & "playing_position" : yes I supposed something like that but I can't achieve it. could you share the code please ?
With pleasure sometime later if there is no rush ?
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1
MacStudio M1Max 32Go OS 12.3.1
Re: midi note length
no prob. It was just in case you had it already. thx.
Re: midi note length
Nice idea but the timing will be problematic due to unpredictable latency of the Live API.chapelier fou wrote:call "get_notes" on the target clip, and concurrently observe "playing_position".
Just did a test with a clip note on beat 1.0 where the observer reports playing_position 0.85 (!)
-
- Posts: 6021
- Joined: Mon May 15, 2006 12:15 pm
Re: midi note length
Ah. Those latency issues are so frustrating.broc wrote:Nice idea but the timing will be problematic due to unpredictable latency of the Live API.chapelier fou wrote:call "get_notes" on the target clip, and concurrently observe "playing_position".
Just did a test with a clip note on beat 1.0 where the observer reports playing_position 0.85 (!)
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1
MacStudio M1Max 32Go OS 12.3.1
Re: midi note length
ouch. ok I'll check it but I'm afraid it will not very useful…
Re: midi note length
Notice that the latency problem can be eliminated under certain conditions. For example, if the clip notes are strictly quantized to 8th (0.5 beats), the observer output could be quantized accordingly using [round 0.5] to ensure accurate timing.
Re: midi note length
yes absolutely right. but unfortunately I plan to do something not quantized at all.
-
- Posts: 6021
- Joined: Mon May 15, 2006 12:15 pm
Re: midi note length
Maybe tell us what you want to achieve ?
Sometimes it's good to have a different point of view, as there might be another way to do it.
Sometimes it's good to have a different point of view, as there might be another way to do it.
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1
MacStudio M1Max 32Go OS 12.3.1
Re: midi note length
yes for sure I'll do asap. we're a little bit busy now. thx.
Re: midi note length
Just a tip (I didn't take time to explore yet) but it seems [borax] should do the job… no ?
Edit: ha No, duration is sent at noteoff, and I need it at noteon…
Edit: ha No, duration is sent at noteoff, and I need it at noteon…
Re: midi note length
There may be a solution by giving each note a unique number:
1. Load the clip notes into a coll with index numbers, sort by start times and renumber the indices.
2. At playback count the note-on events and get the corresponding duration from coll.
1. Load the clip notes into a coll with index numbers, sort by start times and renumber the indices.
2. At playback count the note-on events and get the corresponding duration from coll.