Recording MIDI notes into Live Clip – timing issues
Second question for the day :)
I’m recording MIDI notes into the currently playing Live Clip from a Max for Live device. The duration I calculate for them seems to work just fine. However, I am about to get grey hair because of their positioning.
My strategy (failed) so far has been this: figure out what the currently playing Live clip is, observe its playing_position, continuously put it into an [f] and when the time comes to record a MIDI note, just send a bang to the f before the call list goes out to the [live.object] that’s representing the Clip.
The problem is that things go horribly wrong this way, the notes are all over the place.
Is there a best practice to record the notes on-the-fly, to the right position? Is this a general timing issue which is unresolved? Or am I doing something very wrong?
It’s a general timing issue with the Live API, in particular time resolution of observers. For example, I’ve measured that the observer of playing_position sends its value only at intervals of 60 milliseconds.
Thanks! I think I’ve heard of this before. For the current project, I only need to record very regular intervals, so I’ve settled with manually calculating the position using [plugsync~] in the meantime. This is far from ideal, however, because when the clip loops over, the notes already recorded are slightly off with the notes being played out of the M4L device, leading to audible and very annoying phasing. Still a solvable problem, but very annoying to have to work around this…
I was pulling my hair out too when trying to get the timing right for the start of MIDI notes. After several attempts I found that a when object going into translate provided the best accuracy. This method goes off of Live’s timeline, but it might be adaptable to the timeline of a clip.
This was the trick:
when -> translate bars.beat.ticks ms @mode position
Here is the sub patch for context:
----------begin_max5_patcher---------- 1105.3oc4XtsiiZCF.95jmBKtpUJkhMDNrW0tWWo9.TUEY.mIdKXirMYmsq1 285CvLI6j.rSl3tRatH.1F6e+4+i740qBJ4ORjAf2A9KvpUed8pU1lLMrZ34 UAs3GqZvR6vBp3ssDlJXiqOE4QkscFWQ.5NorG.T1X26EOTZ5NJLZnEVudHM Dkc1fiCiyTR5+Rrsc1X48pwAO1ZGVUcPuL6DjJkSzyQ52AfhM+6tGlGFA96g 2fVaEQd4G9EXZvIqIC2ZWyfeWPwMf2yapCL89k0qM+s4FYxe1q55URf5fFM8 BgdLfRBVAzarRh.rWvasc9GziDfh1RZnLR337Xdnh2yrSFxuDEFiBiy1tAjD UDpu.yRsHt3JXMxiXsB2o5Ejy4pRfYxNtPY4nVEDThExPCtC6YT2o.Sqg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liant, just what I needed. Thanks for this!