Are Max For Live's JavaScript functions, which run in the low-priority thread, latency compensated?

Learn about building and using Max for Live devices.
Post Reply
jbone1313
Posts: 578
Joined: Wed Dec 12, 2007 2:44 am

Are Max For Live's JavaScript functions, which run in the low-priority thread, latency compensated?

Post by jbone1313 » Sun May 28, 2023 5:56 pm

According to the documentation of Ableton’s Max For Live LiveAPI Object, it is no longer possible to configure JavaScript functions to run in the high-priority thread of Max’s scheduler. So, Max For Live JavaScript functions run in the low-priority thread. However, I could not find any information on whether these functions are latency compensated or not.

Are Max For Live's JavaScript functions, which run in the low-priority thread, latency compensated?

For example, say I create a Max For Live device, which uses JavaScript functions, and the MIDI processing inside those functions takes 50ms. Assuming Live's latency compensation is enabled, will the 50ms of latency my Max For Live device induces be correctly compensated by Live?

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

Re: Are Max For Live's JavaScript functions, which run in the low-priority thread, latency compensated?

Post by chapelier fou » Sun May 28, 2023 7:30 pm

Not sure I understand properly, but from my experience, any API call from M4L has an unpredictable latency. It's just unusable for anything time critical.
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

jbone1313
Posts: 578
Joined: Wed Dec 12, 2007 2:44 am

Re: Are Max For Live's JavaScript functions, which run in the low-priority thread, latency compensated?

Post by jbone1313 » Sun May 28, 2023 9:19 pm

Thanks for the reply. Yeah, unpredictable and/or uncompensated latency is untenable for time sensitive operations.

Post Reply