This doesn't have to be with a clicking sound. I need something to visualize a certain tempo/ metronome
How can I make a sound or image appear on a certain tempo?
So maybe with fade
or toggle()
but then with a tempo which you can
adjust in an input field.
Any ideas?
The JavaScript
setInterval()
method is generally discouraged as it doesn't keep the function "execution time" (how long it takes to, for instance, actually visualize the tick) in mind. On second thought, setInterval would be even better in this case, since it's time-critical.With
setInterval()
, the code would look something like: