metronome
Does anybody have an idea how to build a tap tempo metronome ?
The click of the metronome could be a pulse generator.
The tapping ( with a push-button GPIO ) should be in sync with the outgoing metronome pulse .
I could use a timer to measure the tap time , and it it could be used for evaluating the frequency to feed to the input of a Voltage controlled pulse,
but the tapping would not be in sync with the pulse, thats the problem.
Any idea ?
Cheers, Stephan
Audio Signal Processors
adau1452
Audio Products
software
SigmaDSP Audio Processors
vcp
SigmaStudio v4.7
Show More
Hello Stephan,
This is a fun problem to solve with SigmaDSP. I cannot supply the full answer right now due to other time commitments but perhaps we can start on this one step at a time.
I will insert an older project I did back in 2016. (I was surprised it was that long ago!) I had created this project to calculate the period of a wave, either sine or square. However, I also made it take an input from a GPIO so this will directly apply to what you want to do.
The trick here will be to develop a circuit to disable the counter update so that once it is "learned" it will hold that value.
I do not have the actual metronome part of this in the project. The counter value can obviously be used.
So this project is about 1/3rd of what you want to do so it is a start but not the full solution. I will try to work on this when I have a chance.
However, I think I will lose this race to KJBob because I know he likes these kind of challenges.
I have another project based on this one that I went further and made it reset every second and use the count for every second to calculate the period. I do not think this will help for this task because the tempo could be slower than one second. Anyhow, here is the basic project.
Dave T
ADAU1452 Period Calculation using zero Cross.dspproj
I have second thoughts (pun in there somewhere...)
Here is the project that calculates pulses per second.
ADAU1452 Period Calculation zero Cross Per Second.dspproj
Thank you for your thoughts and your projects you posted, Dave.
I will also ask KJBob , maybe he also some ideas on top.
Cheers, Stephan
Hi Stephan,
Actually, Dave may beat me to it. Yet I'll keep this project in mind and see if any ideas rise to the surface.
Best regards,
Bob
Hello Stephan,
I came up with an example project which may do what's needed (or can be developed further). It runs on a ADAU1452:
My 1st-gen 1452 eval board has no pushbuttons, so I used the GUI switch. "Tapping" requires switching it ON and OFF, which is cumbersome but of course you'll use a real button on a GPIO input. Be sure to select debouncing on this input.
A rising edge on the input triggers ONSR1 hi, which resets itself via feedback one sample later. A one-sample delay provides a second pulse immediately following the first. These signals drive the remaining logic.
SPWatch1 counts the time in samples between two successive taps, up to 5 seconds max (12 BPM min). Source DC2 adjusts this limit. If the tap switch is pressed multiple times, the period between the last two presses is what counts. Hold1 remembers this period.
Two similar timers provide the output timing. Timer1 produces a pulse stream according to the desired period. The adder ORs this with the tap pulse, so pressing the button always makes a click. Timer2 stretches these pulses to 6 mS, which activates a reset-phase VCO to provide six cycles of 1 KHz sine wave. This provides a sound quite similar to WWV's one-second ticks -- if you have ever heard this on a shortwave radio, you'll recognize it.
With this example as a start, you'll be on your way to refining your device as needed.
Best regards,
Bob
Met-2.zip
Thank very much Bob , that helps a lot !
Please log in to reply.
