Has anyone done a metronome? On the surface this would appear to be a simple, straightforward project - but I naturally immediately want to expand it to something more sophisticated.
For example, for a drummer I'd like to flash an indicator and provide a click (quarter notes) or boop (whole) to feed her in-ear monitor. The rate, in beats-per-minute, would be selectable and displayed. Straightforward.
I'd also like to hang the device from the snare drum rim so that a contact microphone or accelerometer falls in contact with the top drum head (the skin) to time and display the currently played rate to help her maintain her (and, thus, the band's) meter - open-loop, so to speak.
Lots of commercial metronomes and tuners exist, of course - some dirt cheap - so it might not be worth the effort - but I've got some ZX-24s looking for work...
Metronome?
I built a "C" based metronome 12 years ago for my kids who play music based on a Circuit Cellar AVR prize winner from 2004. It was fine for a while but as they became more accomplished they moved to a more professional Metronome like this one from Korg which only costs <$25.
I have the Eagle schematic, board layout, C source code, and a nice little writeup as well. It uses 16 I/O pins including 7 for the LCD and 6 for the buttons. I could share it but only if you were willing to convert it to ZBasic. 12 years ago the parts were ~$40 including the mega16 AVR.
I have the Eagle schematic, board layout, C source code, and a nice little writeup as well. It uses 16 I/O pins including 7 for the LCD and 6 for the buttons. I could share it but only if you were willing to convert it to ZBasic. 12 years ago the parts were ~$40 including the mega16 AVR.
Mike Perks
Wow, sounds like a fun project.
Not being the least bit musically inclined I don't know what the frequency range for a Metronome ought to be, but a couple of the commercial ones in Mike's link show a top end of 4.x Hz, i.e. a very low frequency.
For the 1/4 note option, then, and ISR firing at 4 times the base note would seem reasonable, ant that would have an upper frequency of 16 Hz, again very low.
Inside the ISR one can have a counter to determine when one hits a whole note and needs a different audio and or visual output, vs the outputs for the 1/4 notes.
Given the low frequencies, and the timing tolerances, (very wide, i.e. +/- uSec timing isn't needed!), I'd set a flag in the ISR and process it within the Main Loop.
That, I'd think, ought to not require too much processing power, leaving you plenty for detecting the drum's current beat frequency. That might well require more processing power, such as reading an accelerometer at 1 K S/Sec, or whatever, filtering the signal, and detecting the beat-to-beat period from which the frequency is then determined. Whether you display the beat-to-beat rate or average over several beats, or an average over several beats unless the new rate is x % different from the current rate, at which an instant update is made, etc., is all up to you.
I'd think it might take a fair amount of brain processing power to look at the set rate and the actual rate, as numeric data on an LED / LCD display, and process that data to know how much faster or slower than desired one is actually playing. One might provide the numerical data, but also have five LEDs across the front of the device's box. Green led in the middle means one is right on, (+/- whatever), yellow leds adjacent the green mean that one is close, while red leds at the ends of the led lineup indicate that the set rate and the actual rate are way off. That would be trivial for the human to process with a brief glance.
JC
Not being the least bit musically inclined I don't know what the frequency range for a Metronome ought to be, but a couple of the commercial ones in Mike's link show a top end of 4.x Hz, i.e. a very low frequency.
For the 1/4 note option, then, and ISR firing at 4 times the base note would seem reasonable, ant that would have an upper frequency of 16 Hz, again very low.
Inside the ISR one can have a counter to determine when one hits a whole note and needs a different audio and or visual output, vs the outputs for the 1/4 notes.
Given the low frequencies, and the timing tolerances, (very wide, i.e. +/- uSec timing isn't needed!), I'd set a flag in the ISR and process it within the Main Loop.
That, I'd think, ought to not require too much processing power, leaving you plenty for detecting the drum's current beat frequency. That might well require more processing power, such as reading an accelerometer at 1 K S/Sec, or whatever, filtering the signal, and detecting the beat-to-beat period from which the frequency is then determined. Whether you display the beat-to-beat rate or average over several beats, or an average over several beats unless the new rate is x % different from the current rate, at which an instant update is made, etc., is all up to you.
I'd think it might take a fair amount of brain processing power to look at the set rate and the actual rate, as numeric data on an LED / LCD display, and process that data to know how much faster or slower than desired one is actually playing. One might provide the numerical data, but also have five LEDs across the front of the device's box. Green led in the middle means one is right on, (+/- whatever), yellow leds adjacent the green mean that one is close, while red leds at the ends of the led lineup indicate that the set rate and the actual rate are way off. That would be trivial for the human to process with a brief glance.
JC
Aha! I found the device I saw on Anton Fig's (Joe Bonamassa's drummer) snare: https://www.youtube.com/watch?v=5yDVJAdl4Mw
http://www.temporef.com/temporef.htm
It seems odd to me that there aren't more products like it.
http://www.temporef.com/temporef.htm
It seems odd to me that there aren't more products like it.
Tom