thispatcher script create and connect objects : can't you do it without a del ?
hello,
the problem is here :
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 ?
Try setting the @varname explicitly:
... or use deferlow:
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
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 !)
thanks vichug! :)
is there a message to thispatcher that will return the scripting name of the patcher?
you should probalby have a look at [pattrmarker]
Here's an oddity (Max 7): Ben Bracken's method above is the only script method I've found that allows one to create a poly~ with a varname. But you can't set args this way. However, the [script newobject poly~..] method allows you to set args, but not a varname. Fun!