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

Sep 20, 2011 at 9:30pm

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

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. –
#58958
Sep 20, 2011 at 10:13pm

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?

#211815
Sep 20, 2011 at 10:17pm

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.

#211816
Sep 20, 2011 at 10:18pm

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.

#211817
Sep 20, 2011 at 11:39pm

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.

#211818

You must be logged in to reply to this topic.