I want to implement something like these devices do:
They take an audio signal containing a kick or a metronome on a 'digital input'. (With a comparator / schmitt-trigger cirquid in between) and generate a midi clock from it. This is very handy, since it is not possible to sync any DAW to external gear, jitter-free, using a usb-midi-interface (There is always jitter, if USB [or firewire for that mater] is involved).
I would use one hw-timer for that in input capture mode to measure T. A second one, I would set to T/24. Unfortunately T/24 leads (most likely) to fractions, which leads to drift. Does anybody have a better idea on how to realize that?
Certainly I could always retrigger T/24 timer on rising edges on the input, which would reduce the drift to 1 quarter note, which would not be noticeable I guess. But probably there is a better approach for that. (?)