Skip to main content

Perforation Engine

The Perforation Engine is PERF’s defining feature. After the Rhythm Engine generates a stream of events, the Perforation Engine decides which events are kept and which are removed — creating holes, gaps, and silence within the texture. This is not random muting. Each perforation method uses a distinct mathematical structure to determine its pattern of presence and absence, producing characteristic textural signatures.

Perforation Methods

MethodWhat It DoesLineage
EuclideanDistributes gaps as evenly as possible across the event stream using the Bjorklund/Bresenham algorithm. Produces maximally-even perforation patterns — the most uniform distribution of silence achievable for a given density.Bjorklund (2003). The same algorithm that generates traditional rhythms also generates their inverse — maximally-even rest patterns.
Prime SieveRemoves events at positions divisible by prime numbers, using the Sieve of Eratosthenes. Configurable prime basis (2–13). Creates quasi-periodic patterns with long-range structure determined by prime factorization.Eratosthenes (3rd century BC). Xenakis, sieves (Nomos Alpha, 1966) — logical operations on periodic sets applied to pitch and time.
FibonacciFilters events based on their Zeckendorf representation — the unique decomposition of each event’s index into non-consecutive Fibonacci numbers. Events with fewer Fibonacci terms are more protected from removal, creating genuine self-similar filtering at all scales.Zeckendorf’s theorem (1972). Fibonacci structure applied to musical filtering — events whose positions have “simpler” Fibonacci representations persist longer.
ModularKeeps events whose index satisfies a modular congruence (index mod N = offset). Creates perfectly periodic patterns with configurable modulus and phase offset.Modular arithmetic, number theory. Regular intervallic sieving — the simplest deterministic perforation pattern.
Golden RatioQuasiperiodic lattice based on phi (1.618…). Two modes: Phi mode creates beating patterns between irrational and integer ratios; Golden Angle mode uses the golden angle fraction (2−φ ≈ 0.382) for maximally uniform distribution — the same phyllotactic spiral that arranges sunflower seeds.Golden ratio in nature and architecture. Phyllotaxis — the mathematics of leaf arrangement. Aperiodic tiling (Penrose).
Cellular1D elementary cellular automaton (Wolfram rules 0–255) generates binary patterns. The automaton state evolves each cycle, producing complex emergent perforation structures from simple local rules. Rule 30 (default) generates chaotic, non-repeating patterns.Wolfram, A New Kind of Science (2002). Elementary cellular automata as generators of complex behavior from minimal rules.
Corpus DensityRest patterns derived from MusicBERT analysis of 3.44 million MIDI files. Uses phrase-level density curves extracted from the pre-trained model to bias perforation decisions toward musically natural rest placement. Context-aware — considers note length, pitch direction, and repetition. Falls back to Euclidean behavior if no corpus data is loaded.MusicBERT (Zeng et al., 2021). Statistical learning of rest patterns from large-scale musical corpora.

Parameters

ParameterIDRangeDefaultDescription
Perforationperforation0.0–1.00.3Gap density — 0 = no gaps, 1 = maximum removal
Perforation MethodperfType0–60Algorithm selection
Spiral HolesgoldenAngleOn/OffOffGolden Ratio mode: Phi vs Golden Angle
Corpus BiascorpusBias0.0–1.00.7How strongly corpus data influences decisions (Corpus Density only)

Layer Interaction Modes

Perforation can operate independently per layer or coordinate across layers:
ModeWhat It DoesLineage
IndependentEach layer’s perforation pattern is unrelated to other layers. Maximum textural complexity.Free counterpoint — each voice follows its own logic.
InverseLayers become more active when other layers are quiet, and quieter when others are busy. Creates natural breathing between voices.Complementary motion in orchestration. Density compensation.
ComplementaryLayers actively fill each other’s gaps, producing interlocking patterns where silence in one voice is filled by another.African hocket technique — melodic lines distributed across multiple performers. Machaut’s isorhythmic motets.
SynchronizedPerforation holes appear at similar times across all layers. Creates collective silence — the entire texture breathes together.Tutti rests in orchestral writing. Collective phrasing.
The layer interaction mode is set globally via the coordMode parameter.
The Perforation amount of 0.3 (30%) means roughly 30% of generated events are removed. At 0.0, every event plays; at 1.0, maximum removal is applied (the exact amount depends on the method — some methods are inherently denser than others at the same setting).