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

May 16, 2012 at 4:30pm

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

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.

#63632
May 16, 2012 at 5:13pm

radio group do it for ya?

– Pasted Max Patch, click to expand. –
#229365
May 16, 2012 at 5:20pm

Here’s another way using actual toggles…

– Pasted Max Patch, click to expand. –

`

#229366
May 16, 2012 at 5:55pm

Hello,

a way …

– Pasted Max Patch, click to expand. –

seems complex : should be improved (radio group best ?) ;-)

#229367
May 16, 2012 at 6:50pm

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

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

#229368
May 17, 2012 at 12:50am

Here is a version with [coll]

– Pasted Max Patch, click to expand. –
#229369
May 17, 2012 at 2:08pm

for the 2nd question look up [decode]

#229370
Feb 3, 2013 at 10:32am

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

– Pasted Max Patch, click to expand. –

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?

#229371
Feb 3, 2013 at 10:46am

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

hth o

– Pasted Max Patch, click to expand. –
#229372
Feb 3, 2013 at 11:17am

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.

#229373
Feb 3, 2013 at 11:18am

this patch checks for and discards repeated values

– Pasted Max Patch, click to expand. –
#229374
Feb 3, 2013 at 11:45am

Hi,

?

– Pasted Max Patch, click to expand. –
#229375
Feb 3, 2013 at 12:52pm

or:

– Pasted Max Patch, click to expand. –
#229376
Feb 3, 2013 at 6:13pm

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

#229377
Feb 3, 2013 at 6:18pm

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

#229378
Feb 3, 2013 at 6:41pm

Hi,

http://www.cycling74.com/docs/max5/tutorials/max-tut/basicchapter05.html

“A deep understanding of message ordering rules is necessary to create properly functioning patches. The right-to-left, bottom-to-top, depth-first order is the implicit rule for message passing, but you can use objects like bangbang and trigger to make the ordering explicit.”

#229379
Feb 4, 2013 at 1:30am

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

#229380
Feb 4, 2013 at 3:29pm

And zl.scramble?

– Pasted Max Patch, click to expand. –
#229381
Feb 4, 2013 at 3:34pm

or not ;-)

– Pasted Max Patch, click to expand. –
#229382
Feb 4, 2013 at 4:03pm

Hi,

Merged ;-)

– Pasted Max Patch, click to expand. –
#229383

You must be logged in to reply to this topic.