Forums > Javascript

accessing bpatcher objects

March 11, 2009 | 11:12 pm

Hello all,
How to access directly objects within a bpatcher ?

I imagine I can use a thispatcher object within the bpatcher connected to an inlet and send it a script message , but how can I access objects by a getnamed() and obj.message() process ?

Can applydeep patcher method help ?
Is there any "childpatcher" property similar to the parentpatcher?

thanks

zoomak


March 14, 2009 | 1:55 pm

Here’s an example of how to use applydeep() to send messages to objects inside [patcher] and [bpatcher] objects if you know their scripting name.

lh

– Pasted Max Patch, click to expand. –

// subpatch.js
function anything()
{
outlist = [];
all = arrayfromargs(messagename,arguments);
this.patcher.applydeep (search);
}

function search(x)
{
if (x.varname == all[0])
{
for (i=1; typeof(all[i]) != "undefined"; i++)
outlist.push(all[i]);
x.message(outlist);
}
}
// EOF


Viewing 2 posts - 1 through 2 (of 2 total)