Forums > MaxMSP

order of toggles

July 5, 2013 | 12:15 am

I have three toggles. Now I want to determine the order in which they go on and off.
Possibilities are
1, 2, 3
1, 3, 2
2, 3, 1
2, 1, 3
3, 2, 1
3, 1, 2

How should I program this??


July 5, 2013 | 1:23 am

on AND off? What’s the logic there? you’re trying to sense *any* action from the toggles?


July 5, 2013 | 1:47 am

See the code attached.
I want to identify a change in the message box from 1 to 3 (either 1-2-3 or 1-3). Or from 3 to 1.

<code>

– Pasted Max Patch, click to expand. –

</code>


July 5, 2013 | 2:31 am

Here’s two ways to approach it.

<pre>

– Pasted Max Patch, click to expand. –

</code></pre>


July 5, 2013 | 2:51 am

That was interesting! Here’s a third way to do it:

<code>

– Pasted Max Patch, click to expand. –

</code>

If you also want to know also which of the three are at any point enabled/disabled, then you would need to work a bit with the [<< ] object.


July 5, 2013 | 3:20 am

Thanks guys!!


July 5, 2013 | 3:57 pm

i think i would usbers as placeholders "1,2,3…" for the order, then you can use [zl] or [coll] to change the list, then iterate it, and then use [route 3 2 1] to control the toggles.


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