"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
"same time" is undefined.
Try the onebang object
-A
Damn it, Einstein! The music will just never be the same!
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).
If, by "at the same time", one means "within the same tick of the scheduler", then I think something as simple as this works.