js object: how to receive (and distinguish) bang messages from multiple inlets


    Oct 16 2020 | 4:26 pm
    Hello!
    I've created a js object with 2 inlets. I'd like to be able to receive bang messages through either inlet, and be able to distinguish which inlet the bang came from. This is so I can connect one to the output of a metro object, and use the other for different control purposes.
    Any hints?

    • Oct 16 2020 | 10:56 pm
      inlets = 2; function bang() { post("bang"); post("came in on ",inlet); }
      Cheers
      -A
    • Oct 17 2020 | 3:02 pm
      Thank you! For anyone else wondering where this fits conceptually, I found from the documentation that inlet is a built-in property of the jsthis object in the context of a function triggered by an incoming message.