Clock

Bar, beat, eighth, sixteenth and triplet pulses plus the phase within the beat on six lanes, locked to the transport or at its own tempo.

  • Control
  • Since 0.2.0
  • clock
  • tempo
  • transport
  • pulse
  • rhythm
  • control

Open in TuneToys

Clock as the Patch draws it, at default values: inlets on the left, outlets on the right.

Clock turns the shared transport into pulses you can cable: one lane for each bar, beat, eighth, sixteenth and eighth-note triplet, plus a sixth lane with the position inside the current beat. Use it to restart LFOs on the bar, count beats, or step anything that takes a trigger.

What it does#

The six output lanes are [bar, beat, eighth, sixteenth, triplet, phase]. Each of the first five is 1 for exactly one block when its boundary falls inside that block, and 0 otherwise. A bar is four clock beats. The phase lane is the position within the clock beat, 0 to 1, at the start of the block.

With Source on Transport, the clock reads the transport's beat, so it pulses only while the transport rolls and lands on the same blocks on every replay and offline render. With Source on Free, it counts its own Tempo instead. Multiply sets how many clock beats fit in one transport beat (or one Tempo beat in Free mode).

Control runs once per audio block, so a pulse can arrive up to one block after its exact time: about 2.7 ms at 128 frames and 48 kHz. Sequencers that need sample-exact notes, such as Step sequencer, read the transport directly rather than this clock.

Inputs#

run gates the clock: unconnected, it runs while the transport rolls; cabled, it runs while the lane is at least 0.5. A rising edge on reset restarts the bar at that block, so every lane pulses there and the phase starts again from 0. Pick a single lane of another node's bundle with Select lanes to cable it into either input.

When to use it#

Use Clock when something should happen in time with the music but is not a note: reset a Control LFO on every bar, advance a Counter on each beat, or retrigger an envelope on the sixteenths. To play notes, use a sequencer instead.

Ports#

PortDirectionSignalLanes
runInputControl1
resetInputControl1
controlOutputControl6

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
sourceSource0 to 10linearTransport follows the shared transport's beat and runs while it rolls; Free counts at its own Tempo. Choices: 0 Transport, 1 Free.
bpmTempo20 to 300120linearBeats per minute in Free mode. Shown when source is 1.
swingSwing0 to 0.750linearDelay of every second eighth and sixteenth pulse, as a fraction of its spacing: about 0.33 is a triplet feel.
multiplyMultiply0 to 42linearClock beats per transport beat: ×2 doubles every pulse rate, ×½ halves it. Choices: 0 ×¼, 1 ×½, 2 ×1, 3 ×2, 4 ×4.

Source (source)#

Transport or Free. Transport follows the shared transport's beat and tempo; Free counts its own Tempo from where it is, and its reset input restarts it from zero.

Tempo (bpm)#

Beats per minute in Free mode, 20 to 300. Hidden while Source is Transport, which uses the transport's tempo.

Swing (swing)#

Delays every second eighth and every second sixteenth by a fraction of its spacing, 0 to 0.75. About 0.33 gives a triplet feel and 0.5 a dotted one. Bars, beats and triplets are never swung.

Multiply (multiply)#

Clock beats per transport beat: ×¼, ×½, ×1, ×2 or ×4. At ×2 every lane runs twice as fast and a bar lasts two transport beats.

Tips#

  • Cable the bar lane (lane 1, through Select lanes) into a Control LFO's reset so the LFO starts every bar at its Phase.
  • The phase lane is a beat-long ramp: scale it to sweep something once per beat.
  • In Free mode with nothing cabled to run, the clock still waits for the transport to roll; cable a constant 1 into run to keep it running.

See also#

Counter, Select lanes, Control LFO, Step sequencer, Control lanes.

Help patches

Each help patch is an ordinary Toy that teaches one idea. The diagram shows the Patch; the preview shows its Frame. Open it in TuneToys to play and edit it.

1. Tick on the sixteenths

beginner Teaches: multiply, swing

A clock's sixteenth lane gates a short envelope, so every sixteenth of the transport ticks; Multiply and Swing reshape the pulse train.

Patch: Clock control output connected to Select lanes control input. Select lanes control output connected to Envelope @gate input. Oscillator audio output connected to Envelope audio input. Envelope audio output connected to Patch outputs audio input.
Connections as text
  • Clock control output connected to Select lanes control input
  • Select lanes control output connected to Envelope @gate input
  • Oscillator audio output connected to Envelope audio input
  • Envelope audio output connected to Patch outputs audio input
  • Press play: the clock follows the transport and pulses only while it rolls.
  • Select lanes picks lane 4 of the clock's six: the sixteenth pulse. Lane 1 is the bar, 2 the beat, 3 the eighth, 5 the triplet and 6 the phase.
  • Each pulse is 1 for one block, enough to retrigger the envelope.
Frame preview: Tick on the sixteenthsFrame “Tick on the sixteenths” with 3 elements: text heading, segmented Multiply, knob Swing.TICK ON THE SIXTEENTHS×¼×½×1×2×4Multiply0Swing
Frame preview (static). Controls show their default values.

Open in TuneToys

2. A free-running clock

intermediate Teaches: source, bpm

In Free mode a clock counts its own tempo instead of the transport's beat; its beat lane ticks a low tone.

Patch: Clock control output connected to Select lanes control input. Select lanes control output connected to Envelope @gate input. Oscillator audio output connected to Envelope audio input. Envelope audio output connected to Patch outputs audio input.
Connections as text
  • Clock control output connected to Select lanes control input
  • Select lanes control output connected to Envelope @gate input
  • Oscillator audio output connected to Envelope audio input
  • Envelope audio output connected to Patch outputs audio input
  • Free mode counts Tempo on its own, while the transport rolls (or while a cabled run input is high).
  • Lane 2 is the beat: one tick per clock beat.
  • Switch Source back to Transport and the ticks follow the transport tempo again.
Frame preview: A free-running clockFrame “A free-running clock” with 3 elements: knob Tempo, text heading, segmented Source.96TempoA FREE-RUNNING CLOCKTransportFreeSource
Frame preview (static). Controls show their default values.

Open in TuneToys

  • Counter Count rising edges of a trigger lane, with step, limit, wrap and reset. Lane 1 is the normalised count, lane 2 the raw count.
  • Select lanes Extract a contiguous lane range from a control bundle. Use several to split a sensor's lanes.
  • Control LFO A free-running or tempo-synced low-frequency oscillator on a control lane, 0 to 1, with depth, offset, phase, skew, random shapes and a reset input.
  • Step sequencer Up to 64 steps of notes, rests and ties locked to the transport, with per-step pitch, velocity and probability, swing and four directions.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close