order of object creation??

Aug 27, 2009 at 9:54pm

order of object creation??

I was wondering if there is a way to know the order of object creation at loadtime.

I would like to catch error messages at startup with [error] (in order to switch automatically between different externals in case one is not installed), but my “bogus” objects get loaded before the [error] is initialized (I think).

I have a feeling that this isn’t possible, but thought that asking wouldn’t hurt.

Thanks.

#45253
Aug 27, 2009 at 10:32pm

from low level to high level, from left to right, from bottom to top.

#163059
Aug 27, 2009 at 10:51pm

Maybe I am misunderstanding, but I can’t get this to work.
Here is a quick example of what I am trying to do:

– Pasted Max Patch, click to expand. –

Thanks

#163060
Aug 27, 2009 at 11:05pm

i dont think anything can output errors before the patch has finished loading.
Wink

#163061
Aug 27, 2009 at 11:20pm

Perhaps if you put the specific object in a [patcher] and named the [inlet](s) and [outlet](s) then you could use a javascript which uses this.patcher.applydeep() to search every object in your patch, find which one has .maxclass == “jbogus” and then script in the replacement and the re-connections. Triggering this via loadbang() in js should work I think.

lh

#163062
Aug 28, 2009 at 8:06am

In one of my apps, I implemented an abstraction which is able to switch between elasticindex~ and index~ (in case the external can’t be loaded).

have no max here, but remember that I used jscript for that, works without problems. could send you the stuff tonight

nick

#163063
Aug 28, 2009 at 12:28pm

If you want your patch to work on different Max installations and guarantee that non-factory externals are available, you might want to build a Collective or Standalone.

I personally find this more straight-forward and robust than hacking JScript. The latter is obviously possible, and the choice is partly a matter of taste.

Just an idea for your consideration.

#163064
Aug 28, 2009 at 1:12pm

makes definitely sense, in fact, my app is deployed as a collective. Unfortunately, elasticindex~ is not free and therefore can’t be included.

All other non-factory externals are included of course.

#163065
Aug 28, 2009 at 5:36pm

This was a badly thought through idea to start with. Sorry.
The workarounds are obvious and simple enough. thanks for the responses though. appreciated.

#163066

You must be logged in to reply to this topic.