↓ Skip to main content
  1. Home projects/

MetroBlocks: a block-based metronome

··Index: 4·

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.

Schematic of the MetroBlocks screen: a colour-coded timeline of blocks above the settings of one block and the song controls.MetroBlocksplayexport WAVtimeline: click a block to start from itlead-inlead-inblock 1block 2block 3block 4playingsettings of one blocknamebarstempotime signatureclick soundaccent groupingsongexport JSONimport JSONsaved in the browserautomatically
Schematic of the MetroBlocks screen, not a screenshot

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.

Open MetroBlocks → · Source on GitHub

Related