Order of bangs + random playing

Hi all.

i know my title doesn’t help a lot but i did my best !
so, i am helping a friend with an interactive installation and i am stuck on a couple of points :

1/ there will be two microphones at the entrance, one after another, that should help to tell if someone is coming in or going out. if microphone_1 bangs first and then microphone_2 as well, then a person is coming in and the value needed is 1. If microphone_2 bangs first, and the microphone_1 bangs right after, then a person goes out and that should give me the value 0. is it well explained??
well, i feel i’m close to the solution but i still can’t figure out how to get these values…

2/ this question is better explained in the attached patch !

thanks in advance

and here’s the patch! (didn’t work the first time)

random_switch.v4p (8.3 kB)

Not much time now to figure out part 1, but I attached a patch for your other Q. How do you get a microphone to bang when some one enters? Do you put it on the ground?

Your second Q, I attached a patch, hope it helps.

random_switch2.v4p (17.0 kB)

thanks West!
but i am afraid i didn’t explain very well… i attach a new patch that should explain better…

there is wall of diffrent videos (like bricks). when someone comes in the room, a random video starts playing. when someone goes out of the room, a random video stops playing. so, if there are 3 people in, 3 videos should be playing and when 2 go out, 2 videos stop playing and one still goes on, etc…

hope it’s clearer now…

random_switch3.v4p (30.1 kB)

like this?

random_switch4.v4p (15.1 kB)