Number of LiveAPI control_surfaces

Aug 31, 2011 at 7:36pm

Number of LiveAPI control_surfaces

Does anyone know a simple way to get the number of LiveAPI control_surfaces? To use the getcount message we need some parent, but it appears control_surfaces is the root itself, so this doesn’t work.

#58706
Sep 3, 2011 at 5:18am

There can only be six, so I use an iteration and check type usually (in js). But yeah, it would be much better if control_surfaces didn’t just return the __class__ builtins.

#211060
Sep 13, 2011 at 3:51pm

Interestingly there can be a lot more than six control_surfaces, but only six can be seen in the Preferences window. When setting a control_surface to none and then to some other surface not all previous surfaces are deleted, due to bad disconnect functions and Ableton Live not always calling the disconnect function.

I found iterating until I get an ‘id 0′ is a good solution. I have to iterate all surfaces anyway.

#211061
Sep 13, 2011 at 8:16pm

LOL yeah, now that I think about it I can confirm that. You’re work around seems like a good idea, I think I’ll implement the same.

a

#211062
Oct 19, 2011 at 9:13pm

I stumbled upon a way to get the control_surfaces count.

It’s here.

[attachment=173533,2740]

– Pasted Max Patch, click to expand. –

But I like to iterate control_surfaces until I get an ‘id 0′ more.

[attachment=173533,2741]

– Pasted Max Patch, click to expand. –
Attachments:
  1. Iteratecontrolsurfaces.jpg
#211063

You must be logged in to reply to this topic.