calling lock_to_device from M4L

Learn about building and using Max for Live devices.
Post Reply
barstu
Posts: 307
Joined: Fri Oct 20, 2006 4:45 pm
Location: London

calling lock_to_device from M4L

Post by barstu » Fri Oct 28, 2011 1:56 pm

Is it possible to call lock_to_device from m4l?

looking at this http://hanzoffsystems.tech.officelive.c ... _to_device

it seems to be looking for a device object as an argument. So I'm guessing this is why an 'id x' as an argument will not cut it (or even an integer on its own). I'm wondering if the way to go is a wrapper python function that takes an object id as an integer parameter and then goes on to call lock_to_device with a device object.

amounra93
Posts: 432
Joined: Sat Jan 24, 2009 8:16 pm
Location: Arcata, CA
Contact:

Re: calling lock_to_device from M4L

Post by amounra93 » Sat Oct 29, 2011 1:50 am

It should take an id argument....I use that sort of thing when passing device id's to Python all the time.

When you send an ('id', n) argument to python, it gets converted to a python object by mxdcore. I think probably you just need to send it as an array, like so:

blahblah.call('lock_to_device', 'id', number);

Anyway, that's how I do it in js and it works. I don't know if you can get away with the same thing in plain Max or not...you may have to use [tosymbol] or something similar.

a
http://www.aumhaa.com for Monomod and other m4l goodies.

barstu
Posts: 307
Joined: Fri Oct 20, 2006 4:45 pm
Location: London

Re: calling lock_to_device from M4L

Post by barstu » Sun Oct 30, 2011 10:03 pm

Hi thanks for that, turns out I needed to run unlock_from_device before the lock_to_device for it to work and not give a syntax error. When locking this way I notice the blue hand doesn't reflect what is locked but I can live with that.

Post Reply