## Basic Logic question

May 5, 2011 at 11:04am

# Basic Logic question

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.

:d

#56891
May 5, 2011 at 11:20am

Made an example patch to show you what I mean

;d

Thanks

– Pasted Max Patch, click to expand. –
#203934
May 5, 2011 at 11:44am

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.

#203935
May 5, 2011 at 12:09pm

@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.

#203936
May 5, 2011 at 12:13pm

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.

#203937
May 5, 2011 at 12:17pm

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.

#203938
May 5, 2011 at 12:30pm

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

#203939

You must be logged in to reply to this topic.