Euclidean rhythm

Spread pulses as evenly as possible over a cycle of steps, locked to the transport, and play each as a note, with rotation, swing and accent.

  • MIDI
  • Since 0.2.0
  • euclidean
  • rhythm
  • sequencer
  • drums
  • transport
  • midi

Open in TuneToys

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

Euclidean rhythm spreads a number of pulses as evenly as possible over a cycle of steps and plays each pulse as a note. Three pulses over eight steps is the tresillo; five over eight the cinquillo. A few of these on different notes make a drum pattern.

What it does#

Pulses are placed with Bjorklund's construction, the method Godfried Toussaint showed generates many traditional rhythms: E(3,8) is x..x..x., E(5,8) is x.xx.xx. and E(7,16) is x..x.x.x..x.x.x.. Rotation starts the same pattern later in its cycle. More pulses than steps plays every step; no pulses plays nothing.

Steps are locked to the transport's beat, so every replay and offline render plays the same notes on the same samples, and the cycle starts on beat 0. A step sounds only while the transport rolls; stopping or jumping the transport releases the sounding note. A rising edge on reset releases it too and starts a new cycle on the next step.

Every pulse plays Note at Velocity; the first pulse of each cycle, as played after rotation, adds Accent. The hit outlet is 1 for one block whenever a pulse plays. The position outlet holds the current step index divided by Steps, including rests.

The rhythm wheel shows one cycle clockwise from the top: filled dots play notes, small dots are rests, and the polygon joins the pulses. Steps, Pulses and Rotation redraw it immediately; its bottom handle rotates the pattern. During playback, the playhead follows the engine, including swing and resets. The same wheel is available as a Frame face.

When to use it#

Use it for kick, snare and hat patterns, or for an off-kilter pulse on a synth. Merge several with MIDI merge into one drum voice. For melodies, use Step sequencer.

Ports#

PortDirectionSignalLanes
resetInputControl1
midiOutputMIDI16 MIDI channels
hitOutputControl1
positionOutputControl1

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
stepsSteps1 to 328linearSteps in one cycle.
pulsesPulses0 to 323linearNotes in one cycle, spread as evenly as the steps allow; more pulses than steps plays every step.
rotationRotation0 to 310linearShifts the pattern this many steps later in the cycle.
divisionDivision0 to 112linearLength of one step, locked to the transport's beat. Choices: 0 1/32, 1 1/16 triplet, 2 1/16, 3 1/16 dotted, 4 1/8 triplet, 5 1/8, 6 1/8 dotted, 7 1/4 triplet, 8 1/4, 9 1/4 dotted, 10 1/2, 11 1/1.
swingSwing0 to 0.750linearDelay of every second step, as a fraction of a step: 0 is straight, about 0.33 a triplet feel, 0.5 dotted.
noteNote0 to 12760linearMIDI note every pulse plays.
velocityVelocity0 to 10.8linearVelocity of each pulse.
accentAccent0 to 10.2linearVelocity added to the first pulse of each cycle.
gate_lengthGate length0.05 to 10.5linearHow long each note sounds, as a fraction of its step.
channelChannel1 to 161linearMIDI channel of the notes.

Steps (steps)#

Steps in one cycle, 1 to 32.

Pulses (pulses)#

Notes in one cycle, 0 to 32, spread as evenly as the steps allow.

Rotation (rotation)#

Shifts the pattern this many steps later in its cycle, 0 to 31; values past Steps wrap around.

Division (division)#

The length of one step, from 1/32 to a whole note, with triplet and dotted choices.

Swing (swing)#

Delays every second step by a fraction of a step, 0 to 0.75.

Note (note)#

The MIDI note every pulse plays, 0 to 127.

Velocity (velocity)#

The velocity of each pulse, 0 to 1.

Accent (accent)#

Velocity added to the first pulse of each cycle, 0 to 1, so the cycle has a downbeat.

Gate length (gate_length)#

How much of its step a note holds, 0.05 to 1.

Channel (channel)#

The MIDI channel the notes are sent on, 1 to 16.

Tips#

  • Try E(3,8), E(5,8), E(7,12) and E(9,16), then rotate them against each other.
  • Two Euclidean rhythms with steps 3 and 4 make a polyrhythm that lines up every twelve steps.
  • Short gates (0.1 to 0.2) sound percussive on a sustained voice.

See also#

Step sequencer, Clock, MIDI merge, Polyphonic instrument.

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. Three over eight

beginner Teaches: steps, pulses, rotation

Three pulses spread over eight sixteenths make the tresillo; Steps, Pulses and Rotation make every other Euclidean rhythm.

Patch: Euclidean rhythm midi output connected to Polyphonic instrument midi input. Polyphonic instrument audio output connected to Patch outputs audio input.
Connections as text
  • Euclidean rhythm midi output connected to Polyphonic instrument midi input
  • Polyphonic instrument audio output connected to Patch outputs audio input
  • Press play: E(3,8) is x..x..x., the tresillo. Try 5 over 8 or 7 over 16.
  • Rotation starts the same pattern later in its cycle.
Frame preview: Three over eightFrame “Three over eight” with 4 elements: text heading, knob Pulses, knob Rotation, knob Steps.THREE OVER EIGHT3Pulses0Rotation8Steps
Frame preview (static). Controls show their default values.

Open in TuneToys

2. Accent and swing

intermediate Teaches: division, swing, note, velocity, accent, gate_length

A Euclidean pulse with its first onset accented, swung, and played at a chosen note, velocity and length.

Patch: Euclidean rhythm midi output connected to Polyphonic instrument midi input. Polyphonic instrument audio output connected to Patch outputs audio input.
Connections as text
  • Euclidean rhythm midi output connected to Polyphonic instrument midi input
  • Polyphonic instrument audio output connected to Patch outputs audio input
  • Accent adds to the velocity of the first onset of every cycle, so the cycle has a downbeat.
  • Gate is the part of each step a note holds; short gates sound percussive.
Frame preview: Accent and swingFrame “Accent and swing” with 7 elements: knob Accent, knob Division, knob Gate, text heading, knob Note, knob Swing, knob Velocity.0.35Accent2Division0.5GateACCENT AND SWING48Note0.25Swing0.8Velocity
Frame preview (static). Controls show their default values.

Open in TuneToys

  • 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.
  • 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.
  • MIDI merge Interleave up to four MIDI streams by time, in input order for equal offsets.
  • Polyphonic instrument Eight owned, velocity-sensitive oscillator voices with ADSR, sustain and MPE, played from a MIDI cable in the Toy's tuning.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close