Forums > MaxMSP

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

December 9, 2012 | 1:38 am

hello,

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 ?


December 9, 2012 | 4:26 am

Try setting the @varname explicitly:

– Pasted Max Patch, click to expand. –

December 9, 2012 | 9:16 am

… 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 ;) )
hth
aa


December 9, 2012 | 12:33 pm

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 !)


December 9, 2012 | 3:13 pm

thanks vichug! :)


July 16, 2013 | 4:07 am

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


July 16, 2013 | 6:17 am

you should probalby have a look at [pattrmarker]


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