I need multiple toggles to cancel each other out, please help

keebz's icon

OK I'm new to Max/Msp and so far I have been able to build what I need. Now I'm stuck and I've tried to search before posting this but couldn't find an answer. Here's where I am stuck. Maybe there is even a better way of doing this.

First Half: I have three toggles that trigger different functions, but when 1 toggle is on, the other 2 toggles need to be off. At no time can 2 toggles be on simultaneously.

Second Half: This needs to be cycled by a single "bang". So that as the bang is pressed, toggle 1 is on and toggle 2 and 3 are off. Bang again and toggle 2 is on and 1 and 3 are off, Bang again and toggle 3 is on and 1 and 2 are off. Bang a forth time and you are back to toggle 1 on and 2 and 3 are off... repeat.

Any help would be appreciated. Especially on the first half question.

kthozoid's icon
Max Patch
Copy patch and select New From Clipboard in Max.

radio group do it for ya?

bkshepard's icon

Here's another way using actual toggles...

Max Patch
Copy patch and select New From Clipboard in Max.

`

keebz's icon

THANK YOU! That was exactly what I was looking for!

and I'll be checking out the radio function as well.

Peter Ostry's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here is a version with [coll]

ak's icon

for the 2nd question look up [decode]

snackd's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I'm looking to do the same thing, but I want to randomly choose which toggle is on.

The problem with using random number generation, however, is that if it picks the same number twice, the toggle is untoggled. I need one toggle always to be on.

Any suggestions?

o s's icon

Hi, the easy version is to use [urn] instead or random- I would use the [%] modulo object (see patch).

Max Patch
Copy patch and select New From Clipboard in Max.

hth o

snackd's icon

o s -

Thanks for the quick reply! Not sure if I understand though. Your patch still allows for the possiblity of not having any boxes checked. That's my core problem, is that one and only one of the boxes needs always to be checked.

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

this patch checks for and discards repeated values

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

or:

snackd's icon

Wow, thank you both. A lot! That's perfect.

snackd's icon

What's the difference between [t b b] and a button with two outs?

snackd's icon

I should read that. thanks much. I'm just getting into this stuff, but it's really fun!

Emmanuel Jourdan's icon
Max Patch
Copy patch and select New From Clipboard in Max.

And zl.scramble?

Emmanuel Jourdan's icon
Max Patch
Copy patch and select New From Clipboard in Max.

or not ;-)