Max Programming Techniques: Listener object? Tying buttons together

  • I have a problem to solve and am looking for some advice on how to program it in max.

    I have a bank of five buttons that represent a "focus" state. (pitch, velocity, octave, duration, repeat)

    I want to program 1 button separate from the 5 above to trigger a unique behavior depending on which of states i was on.

    For example:

    If I'm focused on Pitch i want the button x to trigger random-pitch
    If I'm focused on Velocity i want the button x to trigger random-velocity
    ....etc....

    I have all of the functional pieces except the logic/mechanism to make 1 button "listen" to which state my other bank of buttons are in.

    Any ideas?

  • You've probably already thought of this, but what about using a gate to pipe the state of that button to your different logic based on which of the other buttons is pressed?

  • Using 'gate 5' ?

  • Yup, Gate is the key and I hadn't thought about it, first time I've used it myself...

    super useful!

    Thanks so much.