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
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#
| Port | Direction | Signal | Lanes |
|---|---|---|---|
reset | Input | Control | 1 |
midi | Output | MIDI | 16 MIDI channels |
hit | Output | Control | 1 |
position | Output | Control | 1 |
Parameters#
| Parameter | Label | Range | Default | Unit | Scale | Notes |
|---|---|---|---|---|---|---|
steps | Steps | 1 to 32 | 8 | linear | Steps in one cycle. | |
pulses | Pulses | 0 to 32 | 3 | linear | Notes in one cycle, spread as evenly as the steps allow; more pulses than steps plays every step. | |
rotation | Rotation | 0 to 31 | 0 | linear | Shifts the pattern this many steps later in the cycle. | |
division | Division | 0 to 11 | 2 | linear | Length 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. | |
swing | Swing | 0 to 0.75 | 0 | linear | Delay of every second step, as a fraction of a step: 0 is straight, about 0.33 a triplet feel, 0.5 dotted. | |
note | Note | 0 to 127 | 60 | linear | MIDI note every pulse plays. | |
velocity | Velocity | 0 to 1 | 0.8 | linear | Velocity of each pulse. | |
accent | Accent | 0 to 1 | 0.2 | linear | Velocity added to the first pulse of each cycle. | |
gate_length | Gate length | 0.05 to 1 | 0.5 | linear | How long each note sounds, as a fraction of its step. | |
channel | Channel | 1 to 16 | 1 | linear | MIDI 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.
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.
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.
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.
Related nodes
- 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.