thispatcher script create and connect objects : can't you do it without a del ?

Dec 9, 2012 at 1:38am

thispatcher script create and connect objects : can't you do it without a del ?


the problem is here :

– Pasted Max Patch, click to expand. –

why am i not able to connect an object i just created with a script ? i need to wait 3 miliseconds at least (i tested with lower values, it does’nt work, with 3 or higher miliseconds delays it does) and the whole thing is quite bothersome. Is it related to the fact that the object i’m creating here is an autopattr ? Is there any way to tell the computer to wait until it’s possible to do the connection, other than with a del ? is there a more computer-efficient way to create objects and connections than with this method ?

Dec 9, 2012 at 4:26am

Try setting the @varname explicitly:

– Pasted Max Patch, click to expand. –
Dec 9, 2012 at 9:16am

… or use deferlow:

– Pasted Max Patch, click to expand. –

I would not delay a scripting operation, I don’t think they’re all thread safe – it seems to me that in Max 5 they weren’t but I might be wrong about this. On the other hand, a delay of x ms might not be enough under some high-load circumstances. With a [deferlow] (or, in some extreme cases, more than one deferlow one after another) you’re always sure that things will be performed _after Max is finished doing what it has to do.

(anyway, Ben’s solution is much more streamlined for this specific case ;) )

Dec 9, 2012 at 12:33pm

Oh, okay. Both solutions work then… and it’s related to the “autopattr” special auto-scripting name attribution… I would not think about doing it manually because i thought it would not be a good idea to interfere with it but it seems it is. (and @Ben : i want Max 6.1.0 :p) (and @Andreas : i just began diving in bach. It rocks !)

Dec 9, 2012 at 3:13pm

thanks vichug! :)

Jul 16, 2013 at 4:07am

is there a message to thispatcher that will return the scripting name of the patcher?

Jul 16, 2013 at 6:17am

you should probalby have a look at [pattrmarker]


You must be logged in to reply to this topic.