Very easy to do (i did a similar thing , where I used a microphone to create gestures to control an multitouch DJ application, see a small paper in [1] ).
In my approach I used gesture templates, but since all you want is "tapping" (or claping) you are just looking for "peaks" in amplitude analysis. So:
mic -> pd -> "attack detection" -> hit a bang that will set the tempo -> compute tempo in BPM -> build an OSC message and ship it to a port, where the ardour/DAW will listen.
Now "attack detection" in PD can be performed in various ways, one cool way is to use bonk~ to detect attacks (see Miller's paper in [2]) or on a simpler level you can analyse the signal manually with env~.
Computing the "tempo" is very easy, you just need to measure the time between to bangs. And convert that to BPM (beats per minute, thus 60 seconds). There's a patch here in the list that does that, I remember talking about that here.
The final stage is simple, "Sending the OSC" message, just see the help patch of the packOSC and other OSC-related externals, they supply examples. Also Joćo Pais, has so nice information on controlling Ardour via pd in here [3] and he has a patch for it.
About building and shipping the OSC message
hope this helps,