Skip to main content

Rhythm Engine

The Rhythm Engine determines when notes occur. It generates a stream of attack times and durations in real-time, synchronized to DAW transport via PPQ (pulses per quarter note) timing. All 12 techniques are streaming — they maintain internal state and produce the next event on demand in O(1) time, enabling sub-10ms latency.

Rhythm Techniques

TechniqueWhat It DoesLineage
RandomExponentially-distributed random inter-onset intervals within the density range. No periodicity, no pattern — pure stochastic time points.Xenakis, Formalized Music (1963). Poisson processes applied to temporal distribution of sound events.
PolyrhythmSuperimposes two periodic cycles at ratio A:B, producing composite rhythms from their intersections. Three sub-modes: Sum (all pulses from both streams), Difference (faster stream only), and Fractioned (subdivides each resultant interval). Uses LCM-based cycling for proper Schillinger resultant patterns.Schillinger, The Schillinger System of Musical Composition, Book I: Theory of Rhythm. Resultant rhythms from interference of generators.
PhasingTwo pulse streams at different rates create gradually shifting phase relationships. Events fire when either stream pulses, producing evolving polyrhythmic patterns that cycle through alignment and divergence.Steve Reich, phasing technique (Piano Phase, 1967). Messiaen’s rhythmic canons. Mathematical phase interference.
GroupingNotes cluster into groups of varying sizes (e.g., 5-3-2), then disperse. Creates rhythmic cells with internal acceleration and deceleration. Configurable group pattern.Messiaen, added values and non-retrogradable rhythms. The Technique of My Musical Language (1944). Rhythmic grouping as structural unit.
CloudStochastic density field modulated by overlapping sine waves at incommensurate frequencies. Creates regions of rhythmic concentration and rarefaction — dense clusters dissolving into sparse scatter.Xenakis, stochastic clouds (Pithoprakta, 1956). Golden ratio frequency relationships for maximal non-periodicity.
EuclideanDistributes N pulses as evenly as possible across M steps using the Bjorklund algorithm. Produces maximally-even rhythmic patterns found across world music traditions.Bjorklund (2003), Toussaint, “The Euclidean Algorithm Generates Traditional Musical Rhythms” (2005). Connects Euclid’s GCD algorithm to West African bell patterns, Afro-Cuban clave, and Balkan aksak meters.
HarmonicMaintains multiple pulse streams at overtone-series ratios (1:2:3:…N). Each harmonic h has period fundamental/h. Events fire when any harmonic pulses, creating rhythms derived from the physics of vibrating bodies.Hindemith, The Craft of Musical Composition (1937). Harmonic series as rhythmic generator — temporal analogue of spectral structure.
Power SeqGroup sizes follow mathematical progressions — squares (1,4,9,16), powers of 2 (1,2,4,8,16), or triangular numbers (1,3,6,10,15). Creates accelerating or decelerating rhythmic arcs. Reversible.Schillinger’s numerical progressions applied to rhythmic grouping. Mathematical series as compositional determinant.
CounterpointTwo independent pulse generators with synchrony detection. When both streams coincide within a configurable window, a synchrony event is produced — creating rhythmic consonance/dissonance analogous to pitch intervals.Species counterpoint (Fux, Gradus ad Parnassum, 1725). Two-voice rhythmic independence with controlled convergence points.
AdditiveEach duration equals the sum of the two previous durations, following a Fibonacci-like growth pattern. Seed pair (a,b) → a, b, a+b, a+2b, 2a+3b… Wraps back to seeds when duration exceeds a threshold. Reversible (longest to shortest).Fibonacci sequence. Bartók’s proportional structures. Lendvai’s analysis of golden section in musical form.
L-SystemLindenmayer system string rewriting generates fractal rhythmic sequences. Axiom ‘A’ with rules A→AB, B→A produces Fibonacci-word rhythms. ‘A’ maps to a long duration, ‘B’ to a short duration (golden ratio by default).Lindenmayer (1968), biological growth models. Prusinkiewicz, The Algorithmic Beauty of Plants. Self-similar structures applied to musical time.
Beat GridA 16-step binary seed pattern (drum machine style) is expanded by a first-order Markov chain each bar. Low density stays close to the seed; high density produces wilder variations. Combines grid-based familiarity with stochastic evolution.Markov chains applied to pattern variation. Step sequencer tradition meets probabilistic generation.

Parameters

ParameterIDRangeDefaultDescription
Density MindensityMin0.1–10.01.0Minimum attacks per beat
Density MaxdensityMax0.1–10.04.0Maximum attacks per beat
Note Len MindurationMin0.1–2.00.4Minimum note length as fraction of interval to next note
Note Len MaxdurationMax0.1–2.00.9Maximum note length (>1.0 = overlapping notes)
Rhythm PatternrhythmType0–110Algorithm selection

Technique-Specific Parameters

ParameterIDRangeDefaultApplies To
Polyrhythm TyperesultantModeSum / Difference / FractionedSumPolyrhythm
Overtone CountmaxHarmonic2–168Harmonic
Number SeriesprogressionSquares / Powers / TriangularSquaresPower Seq
Beat Grid PatternbeatGridPattern0–655350x8888Beat Grid
Density values represent attacks per beat at 120 BPM. At other tempos, PERF maintains the same number of attacks per beat (not per second), keeping rhythmic density consistent regardless of tempo.