[js] patchdescribe – need help

Oct 30, 2008 at 5:00pm

[js] patchdescribe – need help

Hi

I’m working around “patchdescribe-example.maxpat” example.
I would like to know if a named bpatcher in a patch is in presentation
mode.. or not.
with this js, I can get the “presentation” attribute from any named
object, but it doesn’t seem to work with bpatchers…
(it returns “-1″ instead of 0 / 1)

sorry if it’s a stupid question,… I’m very new to javascript, and
couldn’t find much info about this in the doc / archives.
and, by the way : where in max5 can I find something like max4′
JavascriptInMax.pdf ???

any help is welcome
Thanks in advance

Mathieu

here is the js (save it as “patchdescribe_mod.js” ) :

function bang()
{
this.patcher.apply(iterfun);
}
function iterfun(b)
{
if(b.varname != “”) //filter named objects only
{
outlet(0, b.varname, b.rect, b.getattr(“presentation”));
}
return true;
}
iterfun.local=1;

and here is a patch demonstrating the problem :

– Pasted Max Patch, click to expand. –

________________
Mathieu Chamagne
mathieu.chamagne@free.fr

http://mathieuchamagne.com

http://www.maxobjects.com

#40577
Oct 30, 2008 at 10:38pm

FYI: There is a separate Javascript message board on this forum… although I don’t think anyone reads it anymore.

#143692
Oct 30, 2008 at 10:47pm

another FYI: it seems like bpatcher is totally messed up in Max5 when it comes to javascript. there is another bug described here:

http://www.cycling74.com/forums/index.php?t=msg&th=36324&start=0&rid=1818&S=bc45cc4cae49edfc26439ad08ab07afc

to which I can’t get anyone at c74 to respond or confirm.

#143693
Oct 31, 2008 at 2:31am

Scott wrote:
> FYI: There is a separate Javascript message board on this forum… although I don’t think anyone reads it anymore.
>

I read it all the time ! ;)

BTW I can’t reproduce exactly Mathieu’s bug. If I use empty bpatchers, I
get the expected result (with getattr(“presentation”)).
As soon as I assign a patcher name to it, I always get 0, but never -1.
Removing the patcher name leads back to expected result …

#143694
Oct 31, 2008 at 8:44am

Scott : you’re right, I forward this question to the javascript
forum ; sorry for crossposting..

> BTW I can’t reproduce exactly Mathieu’s bug. If I use empty
> bpatchers, I get the expected result (with getattr(“presentation”)).
> As soon as I assign a patcher name to it, I always get 0, but never
> -1.
> Removing the patcher name leads back to expected result …

hmm, very strange…
I forgot to say that I’m working with maxmsp 5.0.5 / macos 10.5.5 .

Mathieu

#143695

You must be logged in to reply to this topic.