Forums > MaxMSP

Basic Logic question

May 05 2011 | 11:04 am

Hi, I’m working on an easy logic question that has stumped me.

There are two components,

One, lets say "A", which sends out bangs at random intervals to play a sound file, and another "B" which sends out bangs at a timed interval, and delays the bangs coming from "A" for 10 seconds, using (delay 10000).

So "A" will continue send out bangs dependant on whether "B" has banged, which then will delay "A" for 10 seconds.

Ive been playing with Switches and selects but cant solve it and my brain is melting.

Please help my brain.


May 05 2011 | 11:20 am

Made an example patch to show you what I mean



-- Pasted Max Patch, click to expand. --

May 05 2011 | 11:44 am

Ok, I am confused as to what you’re trying to achieve, but here’s something from what I understood:

-- Pasted Max Patch, click to expand. --

What this thing in the middle does is, if a bang is received from A, it sends the bangs from B through the right outlet of the [gate], which goes through a delay. then, as soon as a bang goes through, it switches the gate back to just letting the B bangs go through.

May 05 2011 | 12:09 pm

@laonikoss – Thank you very much, that really helped me alot.

One problem is that the Delay only has effect on the first bang from B – whereas, if there is a second bang from B two-seconds after the first, the delay wont have effect on the second bang.

Any ideas of how to make this delay have effect on multiple bangs, rather then just one?

Many thanks.

May 05 2011 | 12:13 pm

Some background info to hopefully explain a few things – The bang from A is generated by a keypress, the bangs from B are generated by a motion detector and outputs a recorded sound, which intervals are random depending on the user.

When the key is pressed, a sound file is played which is 10 seconds long this sound file cant have overlapping sounds from the motion detector, so in effect turning it off for 10 seconds.

May 05 2011 | 12:17 pm

yes, but how many bangs? Two? Three? Or do you want all the bangs received within 3 seconds?

Play around with the objects [counter], [sel], or add a [delay] so that the gate automatically switches back after T seconds.

May 05 2011 | 12:30 pm

Ah I worked it out – thank you kind sir, much appreciated.

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

Forums > MaxMSP