Years ago I coded this for Rakarrack:
global.h has the class instantiation,
process.C has its usage:
It was limited in its use, but it might work for a drummer. Basically if I kept a steady rhythm on guitar with a well-correlated repeating pattern it would hold constant. If I started doing "fancy" things then it would skip around (not smart enough design to pick out the beat from complex patterns).
Basically how it works is it looks for local maxima on a peak-detected signal. Every time it finds one, it records how much time there was since the previous peak detect. It then bins this in a buffer that is something like a histogram. It "creates" a new indexed bin every time it gets a different time/beat.
It gives BPM according to the bin with the most counts. It would work really well if you could trigger it off just a single drum.