Latency Measurement within M4L
I'm a gear head and quite new to M4L. I have been building a hardware latency calculator to help measure my synths latency. This would primarily be used for determining the 'Hardware Latency' time to be applied to an 'External Instrument' device.
I've tried two main methods of doing this
1. Measuring the time it takes from [Note Out] until I hear the audio back in my [plugin~] - with this method it compensates for the Sample Rate, Buffer Size and Project Latency. The issues arose with the project latency which (correct me if Im wrong) is not an available readable value from ableton, so I was trying my best to calculate it on its own (Scanning all the plugins in a project, adding up all the latency etc). This took awhile as there were always new places a plugin could be (i.e. Groups within Groups or Drum Rack Return Tracks). Yet after all this work, though accurate 90% of the time, in some big projects, it was still miscalculating somewhere along the way.
2. I'd try to bypass all this compensation by sending a click & and [noteout] at the same time. I'd route the click internally (yet still have project latency) and then I'd just measure the difference in time for the click audio to come back in and the audio from the synth. This method seemed to introduce more latency to the click.
I can go into more detail but I'm curious if anyone has tried to tackle anything similar to this and has any suggestions on how to approach it? Am I on the right track or am I missing something that would make this whole process easier?