Syncing MIDI to an audio signal?

Does anyone know if a device exists which allows you to use the sound of your real drumkit as a basis for MIDI BPM? So you would put a mic on the snare, par example, and this magical device would use that audio signal to output MIDI Clock or whatever, keeping anything you've sequenced in time with your drummer. Or is this just crazy talk?