An ordinary metronome has one tempo, but real songs have sections, so MetroBlocks describes a song as a list of blocks:
- lead-ins, for example two 4-bar count-ins with different click sounds;
- song blocks, each with a name, a number of bars, a tempo, a time signature, a click sound and an optional accent grouping for odd meters, such as 3+3+2.
A colour-coded timeline shows the structure and the length of the song, highlights the block that’s playing and starts playback from any block you click.
For playback I used the Web Audio API, with all the clicks scheduled ahead of time. To get a WAV click track, you can render the same song offline with OfflineAudioContext and save it. Songs are saved in the browser automatically and can be exported and imported as JSON. It’s a static web app with no server, and the interface is in Polish.