"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
"same time" is undefined.
Try the onebang object
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.
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 648.3ocyWssabBCD8Y3qvxO0JQivlEHaeqeGMQUFvahi.aD1jj1n7uWrMzks gaI6BsuXjGFrOmimY7vKtNvDwyTID7Uv2ANNu353XLoM3zN2AVPdNMmHMtAS EEETtB5Yemh9rxXOgvuCvN.X7xZkDPpnfafRVQcthvohZ4MvtuImwoohZt4C wsF40ELdNUY1ETqwCBtRx9E0XCek+QeE0pNm6rxxL.Qj7vWP661qRhJ8dF+t eTQSUVdFF2rPMK20lG96zOBZFA21aW4jBytB+VEijC0u3UWW8f2BEJN8oFn7 FcxGNDgwuGB2oNVSpeVRsDCxzR5sCHGwSHGnc65KD3qB8.X+sRNxnGnU4hmf mcXvnpxvRRz7Rx095wvH83JnHVfNIwmOPObBZDf6EniC6F+CM5Rk0K1mz4ue dtD3K24tjlCPmep.drCcMcfdic3GLup0lNrVG9iHKr+EUGvypF1Lg862VwHY jHjKSYASDxf5AZV8nslP71pGJ.Bjb9JBdp.DuoDF+opYh5oLgnURYFq6CYSC E7LfMqeEZnXp9IPFJaJxFuei48AVkTsdzdp9F1ej1Q9qDsMLYPlcI5AHb9vY 7tke2Yuyh+6n57W38dXZ+rsdT07Ilt6+q+nvroZ6mxeontJsC1c8oBNtyYTo hwIJlf22olqqZJD14z8rrLJuuNUvxJEM0xZAAJLP2RKxRMj8F8SmEa+U.LR6 ndxQHvjjjbpQH8G7TcwbKXIbK7DmdK2tf3IZI3Id6vi+IGqifmnsEOmcr3ED OnkhmsQeBWBb72L3rnrKz1E8fWBdB9f3wVnkTV9HsR1tlFnzbkxChJ8zHOyT F2N0rhvJ5irN+Cc0q1qt+F.wKAh3 -----------end_max5_patcher-----------
Forums > MaxMSP