JavaScript & Live API : cannot get access to the controls on Push-2

soundyi's icon

Hi there,

I try to use JavaScript & the Live API to interact with my Push-2 and experience a strange issue when I try to observe the controls, like the shift button e.g.

Getting access to the Push 2 works, also retrieving the LOM id of the Shift button works, but when I try to create a LiveAPI object from this LOM id, I get an error message : jsliveapi: get path: error calculating the path.

Strange enough : using the same LOM id in Max - sending it out via an outlet - with live.observe works : pushing the shift button delivers 0 or 127.

So the problem seems to be that LiveAPI in js cannot handle this LOM id correctly or I have to take another LiveAPI to get it going.

Any ideas?

+++

Also strange : although the path cannot be resolved, the objects exists and when I retrieve the type I get sometimes different results : most of the time its a clip but recently I also got "ControlProxy", which might hint to something.

I guess the created LiveAPI object is random, as it cannot resolve the path (although its a valid LOM id) and then picks something up randomly.

+++

See the attached M4L device for details - and by the way : the JavaScript Code is transpiled from TypeScript via this helpful NPM package TypeScript for Max : https://github.com/ErnstHot/TypeScript-for-Max.

PushGetControl.amxd
amxd

soundyi's icon

I got it ... but the lack of documentation in this area makes me speechless.

The cause of this issue is Live 12 and the way Push-2 is handled as a Control-Surface via LOM : its no more remote script based.

See the release notes of Live 12.0 https://www.ableton.com/en/release-notes/live-12/ at the bottom of the document in the section titled "Push 2 and 3".

Not documented consequence : we cannot access Push-2 via LOM in JavaScript as before - the controls are now behind a class ControlProxy and I have not found a way to get behind it, see also this post : https://cycling74.com/forums/push12-vs-push3-control-surfaces-api-differences-and-documentation.

The workaround solution : use Options.txt and set the flag "-Push2UseLegacyScript" as described in the Live 12.0 release notes.

But I have no idea how this could be resolved for Push 3 - or in other words : the lack of documentation and code examples regarding the new control surface integration of Ableton's Push 2 + 3 devices in Max for Live, especially for JavaScript and the fundamental classes we "JavaScript code with (or against ;-)" is unbelievable.

+++

Down below a new version of my research M4L device that works with "-Push2UseLegacyScript" in Options.txt.

PushGetControl v2.amxd
amxd

Iain Duncan's icon

I think you need to be bringing this up in the Ableton forums and on their support? My understanding is that C74 has nothing to do with Push development.