Is it possible to have an abstraction to know when it's connected to object?


    May 27 2018 | 10:48 pm
    Hi dear everybody, I was wondering if there is a way to have an abstraction to know when it is connected to the input of another object. For example I would like to attach an abstraction to an object, and in this way automatically modify some attributes of that object. Is this possible in some way? Thank you a lot for any help!

    • May 28 2018 | 12:48 pm
      AFAIK it's not possible.
    • May 28 2018 | 2:56 pm
      Hi Fede, maybe you can come up with something using [getattr]. On the other hand I'm using this abstraction to detect wether an openGL object is connected or not, is a little bit slow but works, don't know if it helps but thought to share it in anycase. Good luck!
    • May 28 2018 | 5:59 pm
      A solution for the super desperate would be to parse the maxpat json file for the patchlines. But it would be a bit tricky to find out which line belongs to the abstraction...
    • May 29 2018 | 10:41 am
      Thank you both for the answers! Kev using "getstate" could do it, but the tricky part is to bang the message when the abstraction is connected to the object. Would be great not to have to use some metro and gates
    • May 30 2018 | 9:36 pm
      I was thinking, what about jit.gl.material? How does this guy know that it's connected to a 3D object?
    • May 31 2018 | 1:51 am
      i have a system like that which consists of a set of sub-abstractions for all inlets and outlets of a patcher. [inlet] [110.happy-inlet #0_thisabstraction thisinletname] all the other stuff [110.happy-outlet #0_thisabstraction thisoutletname] [outlet]
      it is basically a system which continiously sends a 1000 ms trigger train sent from a global master metro out through all outlets.
      each outlet of each abstraction equipped with t hat will now not only send out e.g.
      "17.5"
      but rather something like
      "weirdabstraction instance 5 outlet 2" .... "17.5"
      using zl slice or route, the happy-inlet of other patches now makes sure that the patch knows where the 17.5 comes from. it can also be used to make the patcher rember to which other patches its inlets were connected and where. (not why though...yet)
      i originally made this to script-recall patches or p arts of patches (so i had "snippets" in max 4 already 10 years ago ) but the whole thing is in practice still too complicated when many connections are made. and it only works in these special types of abstractions.
      fun fact; my very first attempt was to use [grab] for that - only to find out that of course it cannot work across subpatchers. :)
      -110
    • May 31 2018 | 1:58 am
      oh, and it is not thread safe on load.
    • Jun 03 2018 | 11:54 pm
      Ahaha not bad