"And" for bangs

Jul 22, 2012 at 8:54pm

"And" for bangs

How can I outlet a bang if and only if 2 other bangs come in at the same time?

Many thanks in advance

Joe

#29715
Jul 22, 2012 at 9:17pm

“same time” is undefined.

Try the onebang object

-A

#93395
Jul 23, 2012 at 1:35am

Damn it, Einstein! The music will just never be the same!

#93396
Jul 24, 2012 at 1:21pm

Since all event processing is serialized in Max and simultaneity is merely an illusion, “same time” is not only undefined, it doesn’t exist!-0

If you intend “same time” to mean “ultimately triggered by the same event”, it would be possible to handle this with a custom external (events have a time stamp indicating the logical, Max-internal time—this is the same value for all events triggered by the same initial trigger). However, it would be easier just to have the initial trigger trigger your “two bangs from different sources happening at the same time” bang.

If you are thinking more like “two bangs triggered by different source events happening within arbitrarily small epsilon time from each other”, you could connect each bang to a [cputimer] object and compare the absolute difference of the result times. You’ll need a [t b f] for the right inlet to the subtraction object. Alternately, you could use a non-standard subtraction object with a “hot” right inlet (for instance, lp.delta from Litter Power Pro).

#93397
Jul 24, 2012 at 3:40pm

If, by “at the same time”, one means “within the same tick of the scheduler”, then I think something as simple as this works.

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

You must be logged in to reply to this topic.