Latency of API calls

Learn about building and using Max for Live devices.
Post Reply
chapelier fou
Posts: 6002
Joined: Mon May 15, 2006 12:15 pm

Latency of API calls

Post by chapelier fou » Fri May 21, 2021 9:40 am

I'm hitting a brick wall realizing how big and unpredictable API calls via M4L are.
Can we hope (massive) improvements in the future ?
Meanwhile, is this latency documented somewhere ?
Thanks.
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

[jur]
Site Admin
Posts: 5272
Joined: Mon Jun 01, 2015 3:04 pm
Location: Ableton

Re: Latency of API calls

Post by [jur] » Fri May 21, 2021 2:17 pm

Could it be related to some specific objects you use to move the data? Like (udp)send/receive?
Events in Max are limited to one buffer size, can you use signals instead?
What kind of API calls are you doing in instance?
Ableton Forum Moderator

chapelier fou
Posts: 6002
Joined: Mon May 15, 2006 12:15 pm

Re: Latency of API calls

Post by chapelier fou » Fri May 21, 2021 2:39 pm

I made a simple test :
a device that listens for a midi note. If it receives a note, it just fires a clip (no launch quant) that contains one note at the very beginning.
Then I placed a few notes in the triggering clip, recorded the result of the "called" clip in a third track and compared the two clips.
So, in my experience, firing a clip has a random latency, from like 5ms to 100ms.
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

[jur]
Site Admin
Posts: 5272
Joined: Mon Jun 01, 2015 3:04 pm
Location: Ableton

Re: Latency of API calls

Post by [jur] » Fri May 21, 2021 3:07 pm

I see. Unfortunately it's not possible to get sample accurate here.
I myself spent a lot of time and questions around, years ago, to do something like what you're describing and the hard reality is that it's not possible to do this accurately... and as you've noticed, you don't just get inaccuracy but randomness too!
I convinced myself that this should be seen and accepted just like "the beauty of analog imperfection" right there in our digital world :lol:

Another report to support@ableton.com wouldn't hurt, though :wink:
If it can't be sample accurate, at least the latency should be fixed and predictable.
Ableton Forum Moderator

chapelier fou
Posts: 6002
Joined: Mon May 15, 2006 12:15 pm

Re: Latency of API calls

Post by chapelier fou » Sat May 22, 2021 12:41 pm

[jur] wrote:
Fri May 21, 2021 3:07 pm

I convinced myself that this should be seen and accepted just like "the beauty of analog imperfection" right there in our digital world :lol:
Except that clocking in the analog domain is the tightest thing in the world.
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

[jur]
Site Admin
Posts: 5272
Joined: Mon Jun 01, 2015 3:04 pm
Location: Ableton

Re: Latency of API calls

Post by [jur] » Sat May 22, 2021 2:10 pm

You're right! :wink:
That doesn't solve our problem, though...
Ableton Forum Moderator

Post Reply