Forums > MaxMSP

One switch on = on, All switches off = off

April 15, 2012 | 6:03 am

Hi everybody, I’m an idiot.

I have six switches(on outputs a 1, off outputs a 0)that I need to use to control one action. I need to make an audio clip play when one or more of the switches are triggered, and remain playing until all of them are turned off.

I’ve been searching for a solution for hours and am totally lost. I’ve been away from max for a while now and unfortunately don’t have time to go through the tutorials again before finishing this assignment.

Any help would be immensely appreciated.


April 15, 2012 | 8:22 am

Here are two possible ways of doing it.

best! Edwin

– Pasted Max Patch, click to expand. –

April 15, 2012 | 8:36 am

One more:

– Pasted Max Patch, click to expand. –

April 15, 2012 | 8:57 am

And maybe:

– Pasted Max Patch, click to expand. –

April 15, 2012 | 9:03 am

(The same patch, but for Max 5)

– Pasted Max Patch, click to expand. –

April 15, 2012 | 9:06 am

You guys are clever! I did manage to figure out a system that works, but in many ways, your solutions are more elegant. Here’s what I came up with, in case anyone is curious:

Many thanks!

– Pasted Max Patch, click to expand. –

April 15, 2012 | 9:21 am

Hi Nolocus, you might need to change your [pack] to [pak]….but your method made me think of yet another way :-)

– Pasted Max Patch, click to expand. –

April 15, 2012 | 9:36 am

@Nolocus, good that things work!

@Jeff, the last one is very nice. I was thinking that depending on the nature of the input data it might be needed to feed each of the inputs through a change object first so that accum doesn’t get out of control ;-)


April 15, 2012 | 9:40 am

Hi Edwin, too true! :-)


April 15, 2012 | 11:15 am

Hi !
Maybe this is of interest too ;)

– Pasted Max Patch, click to expand. –

`


April 15, 2012 | 3:17 pm

Jeff: yours is my favorite one, but I’m fairly certain that once you use presets on that accum patch, it will start giving you incorrect results.

last year i made a mute/solo patch for a drum machine i made and had an awful time making it finally work right with presets.

not trying to get smart or anything, its just that i usually make sure my patches work, and then work with presets or else they’re useless to me.


April 15, 2012 | 3:46 pm

Hi Ameqc,

You are totally correct. That’s why Edwin’s suggestion was spot on…here it is functioning with preset by adding the [change] objects after the toggles.

– Pasted Max Patch, click to expand. –

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