outlet something at creation

    Sep 05 2012 | 12:10 pm
    I want an object to send out something when it is created. Here's there a way to do that? such as getting a function called when the whole patch has been created or something? thanks for any pointers

    • Sep 05 2012 | 1:10 pm
      Something like loadbang ?
    • Sep 05 2012 | 3:16 pm
      I recommend trying output on your outlet at the end of your max_xxxx_new function which you declared in your setup() function in main(). Hopefully by then, all the outlets are in place and max is ready to go.
    • Sep 05 2012 | 3:51 pm
      Something like loadbang ?
      yes, something like that. but I thought the [loadbang]s were executed from top after the patch was loaded no? Do you mean there's a function for that? How is written [loadbang] to have this functionnality then?
      I recommend trying output on your outlet at the end of your max_xxxx_new function
      that won't work ...
    • Sep 05 2012 | 4:02 pm
      No, that will not be enough, as the patch is not aware of the existence of your object yet. I'd call a function with defer_low() from your new method, and from that function output what you need from your outlets. Or, even better, you can implement the loadbang method.
      hth aa
    • Sep 05 2012 | 4:03 pm
      ("that won't be enough" refers to outputting stuff in the new method...)
    • Sep 05 2012 | 4:10 pm
      Ah.. ok! :) just add to implement a loadbang function.. seems I missed it in the doc. thanks!
    • Sep 06 2012 | 11:36 am
      @Andrea, do you know where in the SDK docs is that loadbang approach? I'd like to take a quick look at it. I don't see it anywhere (sdk, examples, header, etc.)
    • Sep 06 2012 | 12:24 pm
      meanwhile, this seems to work. Agreed?
      addmess((method)max_mything_loadbang, "loadbang", 0);
      void max_mything_loadbang(t_max_dp_kinect *x) { ... }
    • Sep 06 2012 | 12:48 pm
      Uhm, I'm afraid it's something I recall from the doc of the Max 4 SDK - which, although outdated in some parts, still contains some very useful info and presents the whole thing in a way I tend to like more.
      Anyway yes, that's how you should declare the loadbang method. On the other hand, be aware that if the loadbang message is sent to thispatcher, your object's loadbang method will be called.