Launchpad/APC rectangle

Lee's icon

Hi, can anyone tell me how to set/get the location of the clip matrix through m4l?

thanks, L

11OLSEN's icon

if i remeber correctly that was only possible via remote script. but i'm not sure at the moment. you have to wait until broc is giving you the reliable answer:)O.

broc's icon

The reliable answer is that broc doesn't have a clue about launchpad/apc:)

11OLSEN's icon

in that case... you can only get(not set) it via m4l. try searching abltn m4l forum with keywords "rectangle" or "box".
O.

willyc's icon

For the Launchpad (and presumably the APC as well), you can set the position of the red box by calling 'set_offsets' on the "Session_Control" component of the control surface.

Save the following javascript in setRedBox.js

function setRedBox(x, y)
{
var api = new LiveAPI(this.patcher, 'control_surfaces 0 components 1');
api.call('set_offsets', x, y);
}

Max Patch
Copy patch and select New From Clipboard in Max.

And use from Max like this:

Note the javascript above makes two assumptions.

Firstly, you have your Launchpad set up as your first control surface.

Secondly, that the 'Session_Control' component of the Launchpad control surface object always has the path 'components 1'. This *could* change if Ableton were to update the Launchpad remote scripts. You can work out the correct path of the 'Session_Control' component like so:

function findSessionControlPath()
{
var controlSurfaceIndex = 0;
var api = new LiveAPI(this.patcher, 'control_surfaces ' + controlSurfaceIndex);
var count = api.getcount('components');
for (var index = 0; index < count; index++) {
var path = 'control_surfaces ' + controlSurfaceIndex + ' components ' + index;
api.path = path;
if ('Session_Control' == api.get('name')) {
break;
}
}
post (path, 'n');
}

11OLSEN's icon

aha, didn't know that. nice post..

Lee's icon

great stuff, thanks alot for the help :)

patrickkidd's icon

It looks like Push doesn't have this component! Am I crazy?