There is now a second number input. It specifies the number of beats in a bar.
I am not sure what the intended behaviour is, but I assume it will mean something different happens on the first beat in every bar. This code in script.js can easily be changed to implement such behaviour:
// cahnge color and play sound when progress bar is 100% width
function endProgress() {
metronome.style.background = getRandomColor();
if (beatNum == 0) {
// Do something for the first beat
new Audio("assets/click.wav").play();
} else {
new Audio("assets/click.wav").play();
}
beatNum = (beatNum + 1) % bpb;
}
There is now a second number input. It specifies the number of beats in a bar.
I am not sure what the intended behaviour is, but I assume it will mean something different happens on the first beat in every bar. This code in
script.js
can easily be changed to implement such behaviour: