bang when patch is unlocked

Mar 15, 2011 at 4:41am

bang when patch is unlocked

Anyone know how to receive a bang when the patch it unlocked? I can’t seem to find the object/workaround.


Mar 15, 2011 at 6:00am

This is something that you can get at via javascript. this.patcher.locked will return a 0 (unlocked) or 1 (locked).


Mar 15, 2011 at 6:55am


[quebec] external in my “UFO…” package in the Toolbox page do that ;
(mac only, but sources with) …


Mar 17, 2011 at 12:10am

thank you both. Ben, do you think you can post an example for those of us who aren’t Javascript programmers?

Mar 17, 2011 at 7:57am


put that in a [js] object :

function bang ()
    outlet (0, this.patcher.locked);

and bang it to query lock state of the patcher.


Mar 17, 2011 at 11:08pm

I don’t think the OP wants to check the state of the patch, IMO he wants to trigger a bang the very moment the patch gets unlocked.

Mar 19, 2011 at 6:53am

Post the code below in a js object, then send the message poll to the object. It will check the state of the patch every 100 milliseconds. If you want to find out the state of the patch just once, send the message lockstate.

var polling = new Task(lockstate);

function lockstate()
outlet(0, this.patcher.locked);

function poll()
polling.interval = 100;


You must be logged in to reply to this topic.