Mathematical Rhythm Pattern Generator and Analyzer
A comprehensive system for generating, analyzing, and manipulating rhythmic patterns using advanced mathematical algorithms including Euclidean rhythms, Barlowβs indispensability theory, and progressive transformations.
This repository is organized into three main components:
Note: For backward compatibility,
app/in the project root is a symbolic link toWebApp/app/
Serpe/
βββ Source/ # Single shared C++ source tree
β βββ Core/ # Pattern engine, UPI parser, quantization
β βββ Managers/ # Presets, scenes, progressive transforms
β βββ Platform/ # Processor/editor, platform glue
β βββ Tests/ # Test suites
βββ Serpe.jucer # JUCE project (macOS exporters)
βββ Builds/ # Generated Xcode projects
βββ Documentation/ # Plugin-specific docs
Formats: Audio Unit (AU), VST3, Standalone β plugin code RPEd
Platform: macOS
Status: β
Production ready
Serpe-iOS/
βββ Serpe_iOS.jucer # JUCE project (iOS exporter)
βββ Builds/iOS/ # Generated Xcode project (AUv3 AppExtension)
Contains no duplicated sources β it references Serpe/Source directly.
Kept as a separate thin project because the shipped plugin identities differ
(iPad AUv3 = RPEi, bundle com.enkerli.serpe); see SERPE_UNIFICATION_PLAN.md.
Formats: AUv3 (MIDI effect) + Standalone host app
Platform: iPadOS
Status: β
Stable
WebApp/
βββ app/ # Web application files
βββ serve-app.py # Development server
βββ minimal-midi-bridge.py # MIDI bridge utility
βββ *.md # Shared documentation
βββ WEBAPP_README.md # WebApp guide
Platform: Any modern web browser
Features: Full algorithm reference, interactive UI
Status: β
Stable reference implementation
# Desktop (macOS AU/VST3/Standalone)
open Serpe/Serpe.jucer # or: Serpe/Builds/MacOSX/serpe.xcodeproj
# iPad (AUv3)
open Serpe-iOS/Serpe_iOS.jucer # or: Serpe-iOS/Builds/iOS/Serpe.xcodeproj
If JuceLibraryCode/ is missing or JUCE modules moved, regenerate with
Projucer --resave <project>.jucer first (module path: /Applications/JUCE/modules).
# Option 1: Use WebApp directory (recommended)
cd WebApp/
python3 serve-app.py
# Option 2: Use legacy app/ link (backward compatibility)
cd app/
python3 -m http.server 8000
# Open browser to http://localhost:8080 or http://localhost:8000
| notation>, +, * operators{...} notation{accent}pattern or pattern{accent}Three distinct modes for controlling pattern timing and duration:
subdivision_duration Γ pattern_steps = total_durationExamples:
8 steps Γ 16th notes = 8 Γ 0.25 = 2 beats (half note duration)
9 steps Γ 8th notes = 9 Γ 0.5 = 4.5 beats total
9 steps Γ 8th triplets = 9 Γ (1/3) = 3 beats total
Use Case: Create microrhythmic variations by changing subdivision while keeping the same pattern.
pattern_fits_in_X_beatspattern_fits_in_X_bars Γ 4_beats_per_barE(3,8) # Euclidean: 3 onsets in 8 steps β 10010010
B(3,8) # Barlow indispensability: 3 onsets in 8 steps β 10001010
W(3,8) # Wolrab (anti-Barlow): 3 onsets in 8 steps β 01100100
D(3,8) # Dilcue (anti-Euclidean): 3 onsets in 8 steps β 01101001
P(5,12,0) # Pentagon rhythm: 5 vertices in 12 steps with 0 offset
R(4,8,42) # Random: 4 onsets in 8 steps with seed 42
# Binary patterns
10010010 # Direct binary: tresillo pattern
101010 # Binary: alternating pattern
# Hex patterns (LSB-first, digit-reversed input)
0x94:8 # Hex: 10010010 (tresillo)
0x1:4 # Hex: 1000 (leftmost bit = LSB)
0x8:4 # Hex: 0001 (rightmost bit = MSB)
# Octal patterns (same LSB-first principle)
o12:6 # Octal: 100010 (using 3-bit groups)
o7:3 # Octal: 111 (all bits set)
# Decimal patterns
d73:8 # Decimal: 10010010 (same as 0x94:8)
d85:8 # Decimal: 10101010 (alternating)
Important: Hex and octal use reversed digit order during input parsing to maintain strict left-to-right bit ordering where the leftmost position represents the least significant bit (LSB).
E(1,8)E>8 # Progressive Euclidean: 1β8 onsets (manual trigger)
E(8,8)B>1 # Progressive Barlow dilution: 8β1 onsets (manual trigger)
B(3,13)W>11 # Progressive Barlow to Wolrab: 3β11 onsets
E(1,8)@3 # Progressive offset: rotation by 3 steps per trigger
E(1,8)@#5 # Auto-advancing offset: rotation by 5 steps per beat
E(3,8)|P(5,12) # Scene cycling: alternate between tresillo and pentagon
100|110|101 # Scene cycling: alternate between binary patterns
{100}E(3,8)|{010}B(5,13) # Scene cycling with different accent patterns
{100}E(3,8) # Accented tresillo: accent on first onset
{10010}E(5,8) # Quintillo with accents on 1st and 4th onsets
{10}E(4,8) # Alternating strong/weak accents (polyrhythmic)
{E(2,5)}E(3,8) # Euclidean accent pattern over Euclidean rhythm
{P(3,0)}B(5,13) # All-accent pattern cycling over Barlow rhythm
{101}E(1,8)B>8 # Progressive transformation with accents
E(3,8)+P(5,12) # Pattern combination: union of onsets
E(3,8)-P(5,12) # Pattern subtraction: remove overlapping onsets
P(3,0)+P(5,0)-P(2,0) # Complex combination for perfect balance
101010 # Binary pattern: direct onset specification
0x2A:8 # Hexadecimal: 42 in hex spread over 8 steps
0o52:8 # Octal: 42 in octal spread over 8 steps
42:8 # Decimal: 42 spread over 8 steps
[0,2,4,6]:8 # Onset array: specific positions in 8 steps
WebApp (JavaScript) Plugin (C++)
β β
Reference Algorithms β Ported Algorithms
β β
Browser Testing β DAW Integration
β β
Algorithm Validation β Performance Testing
The WebApp serves as the reference implementation - all algorithms are first developed and validated in the browser, then ported to the Plugin for professional music production use.
{accent}pattern> syntax vs automatic with @# syntax# Quick install (if already built)
cp -R "Plugin/Builds/MacOSX/build/Release/Rhythm Pattern Explorer.component" ~/Library/Audio/Plug-Ins/Components/
cp -R "Plugin/Builds/MacOSX/build/Release/Rhythm Pattern Explorer.vst3" ~/Library/Audio/Plug-Ins/VST3/
cd WebApp/app/
python3 -m http.server 8000
# Open http://localhost:8000
Based on extensive research in:
[License information to be added]
Choose Your Platform:
This repo is part of the Enkerli music suite. For the whole-suite picture β repo map, conventions (leftmost-LSB bit order, structural spelling), build/validation ladders, and open queues β start at the suite handoff: https://github.com/Enkerli/music-suite/blob/main/HANDOFF.md.