MusicBrainopen hardware · est. NL

Component

Clock

v0.5.108

Rhythm & sequencing

The clock everything runs in time to.

Software v0.5.108

Board overview

Overview

The clock everything runs in time to.

The master clock of a patch: one tempo from which all outputs are derived, so they never drift apart. Beat gives quarter notes, ×2 eighths, ×3 triplets and ×4 sixteenths, the step clock for the sequencers (Seq Clk, or Grids, Euclid and Turing with ExtClk on). Bar gives one pulse per bar of four beats, and Div one pulse every Div sixteenths (6 = dotted quarter, 3 = dotted eighth).

Ramp is a saw from 0 to 1 over each bar: patch it into a filter or a morph and the movement runs in time with the music.

Controls

ControlRangeDefaultWhat it does
Tempo20 … 300 bpm120The tempo (follows ♩ in the toolbar).
Runoff / ononOff: the clock stops and all gates stay low.
Swing0 … 10Swing: every second sixteenth later.
Width0.05 … 0.950.5Pulse width of the gate outputs.
Div1 … 646Length of the Div output in sixteenths (6 = dotted quarter).

Ports

PortDirectionSignalWhat it carries
RstingateA rising edge goes back to beat one.
TempoincvTempo modulation, exponential: +1 doubles the tempo.
BaroutgateOne pulse per bar of four beats.
BeatoutgateQuarter notes.
×2outgateEighth notes.
×3outgateEighth-note triplets.
×4outgateSixteenth notes, with swing: the step clock for sequencers.
DivoutgateOne pulse every Div sixteenths.
RampoutcvA saw from 0 to 1 over each bar.

How it works

The clock keeps a single phase counted in beats and advances it at the control rate of 1 kHz; every output is a fraction of that phase, so a division can never slip against another. Width is the pulse width of all gate outputs. Swing moves every second sixteenth on ×4 later, from straight (0) to triplet swing (1). The Tempo input is exponential: +1 doubles the tempo, −1 halves it.

Rst goes back to beat one; right after a reset all outputs are high together. Run off stops the clock and holds all gates low; Run on carries on from where it stopped.

The Tempo knob follows the patch tempo (♩ in the toolbar), unless you set the module to its own tempo.

Runs on

  • Teensy 4.1 (the MusicBrain Brain): less than 0.1 % CPU per instance, measured on firmware 0.5.108.
  • The browser: the editor's simulator runs the same C++ code as WebAssembly, so what you hear while patching is what the Brain plays.

Try it

Patches to play (open them in the editor from their page): Acid jam.

In the editor's example set: 🧪 Acid jam (Clock + Euclid + Chaos), 🌊 West Coast (Turing + Folder + LPG), 🧬 Acid jam, 🌊 West Coast.

Editor: https://editor.musicbrain.nl

Sources & licences

  • Our own code, MIT licence.

Versions

  • 0.5.95: first version.