Hey don't laugh...
A company asked us to make a beat counter many years ago.
Its stated purpose was to judge drummers in competition for speed.
NOWADAYS, A free downloadable MIDI monitor patch will do the same thing and keep up with millions of hits, every MIDI message, all information involved, and humans can't outrun it.
(and all I wanted was to play some tunes...)