Forums > MaxMSP

Two items in a matrix sends a value, anyone else resets everything?

September 20, 2011 | 9:30 pm

So I’m working on a monome-style button layout and am using matrixctrl to simulate the presses (I don’t have a monome).

I want to be able to press two buttons and that tell me which two I’ve pressed (this much is working). Then I want to reset my starting values (0. and 1.) when anything else happens (pressing a single button).

At the moment the logic (using zl filter, len, and reg) spits me out a value when two items are pressed, but I can’t figure out how to tell when I’m only doing one press thereafter (without sending a bang on the ‘button release’ as well).

I thought about using [sel 1] in the mix to filter out 0s when I unclick a matrix dot, but I’m terrible at working with list stuff.

Here is the bit of code in question.

– Pasted Max Patch, click to expand. –

September 20, 2011 | 10:13 pm

If you hook the second outlet of your [select] object (the outlet that triggers if only one button is pressed) to a [t 0 1] and then feed these in to your dials it will reset them. Is this what you want?


September 20, 2011 | 10:17 pm

That’s what I tried originally but that bangs when a button is unpressed (when I go from 2 buttons to 1 briefly).
So I need to differentiate between going from 2buttons to 1 (when removing presses) and when actually pressing 1.


September 20, 2011 | 10:18 pm

To clarify, when I have two buttons pressed, if I lift one finger before the other, it bangs as it’s a list of one item.


September 20, 2011 | 11:39 pm

Have a look at [bucket] so you can store the previous number of buttons pressed and then some of the logical operators like [==] to figure out if the previous number was greater. Then you can [trigger] the desired values.


Viewing 5 posts - 1 through 5 (of 5 total)