Cadence
A fast, keyboard-driven musical studio where your synths, drum machines, studio effects, audio recording, and live performance live in one native binary — and musical relationships stay alive instead of flattening into frozen copy-paste clips.
Built on a native wgpu GPU canvas (Metal / Vulkan / DX12) and a zero-allocation 32-bit float audio engine, Cadence lets you compose, sound-design, mix, record, and perform without plugin overhead or mouse fatigue. Change one chord in a 4-bar progression and your pads, stabs, arpeggios, and bassline follow together in lockstep — while you ride macros, sculpt studio FX, and launch live lane overrides on exact bar boundaries.
Quick Start
Requires a current stable Rust toolchain. macOS uses Metal + CoreAudio + CoreMIDI; Linux uses Vulkan + ALSA (libasound2-dev). Pass --silent to run without an audio device, or --no-default-features for headless CLI builds.
git clone https://github.com/cadencefm/cadence.git
cd cadence
# Flagship 64-bar melodic EDM showcase ("Afterglow 3.0")
cargo run --release -- --project examples/demo/project.json
# 48-bar Acid Electro & hardware groovebox showcase ("Iron Circuit")
cargo run --release -- --project examples/iron-circuit/project.json
# 32-bar generative ambient / IDM showcase ("Glass Cathedral")
cargo run --release -- --project examples/glass-cathedral/project.json
# Live keyboard performance set & replayable take ("Fivefold Live")
cargo run --release -- --project examples/fivefold-live/project.json
# Start from a blank canvas
cargo run --release -- --empty
Core Capabilities
- Modeless Keyboard Grammar: Navigate spatially with
h/j/k/l(H/Lcoarse/tabs), sculpt values and reorder items directly in place withAlt+h/j/k/l(Alt+H/J/K/Lcoarse) or one-hand,/.(</>), enter exact values withEnter, and press:/Ctrl+Shift+pfor the Fuzzy Action Palette or?for searchable in-app Help. - 11-Module Unified Eurorack Rack: Every instrument is a patchable
Rack(Panel|Patchbay|Zones) built fromVco(7-voice unison + 2× through-zero FM),Sampler(automatic RIFFsmpl/instloops),Noise,Env(ADSR/Hold-Decay + pre-delay + multi-burst),Lfo,Filter(LowPass6..AcidLowPass),Vca/RingMod,Drive,LoFi,Resonator(32-mode physical String/Bar/Membrane/Plate bank), andOut, with bipolar attenuverter cables and sample-accuratez-1feedback — backed by a 100% MIT external preset and drumkit catalog (TR-808,TR-909,EDM Kit, live synth kits, and 38 single-voice drum presets). - Retained Material Algebra & Inline
:mini: 22 composable pattern operations (AddDegrees,Mask,Transpose,NotesFromValues,Arp,Euclidean,TimeScale,Swing,Ratchet,Shift,Reverse,Chance,Every,RangeFold,Concat,Stack,Shape,SeededValues, and live-validated:mininotation) with fractional sub-step timing (offset ∈ [0.0, 1.0)). - 32-Bit Float Mixer & 8 Studio Effects: Native
Eq,Filter(with extensible 128-slot rhythmicFilterEnvgroove bank),Compressor,Limiter(with lookahead PDC),Drive,Chorus,Delay, andReverb, nestedGroup → Groupbuses, automatedSendlevels, sidechainDuckenvelopes, and+6 dBfader headroom. - Live Performance, 24-Bit Audio Recording & Hardware MIDI: Launch parts on exact bar boundaries, enter modal Jam Mode (
gj/Ctrl+Shift+j), stage atomic multi-gesture drops (S/Alt+Enter), arm crash-safe performance Takes (tr), record live 24-bit WAV audio straight into a project Sampler (ta/tA/ti/:rec), and map hardware MIDI controllers via 1-key Learn (M) with bi-directional feedback in the unifiedAudio | MIDIDevices deck (gd/Ctrl+d). - Scriptable & Agent-Ready: Clean human-readable
v1JSON projects, presets, and JSONL takes, deterministic WAV + per-channel stem export (--render,--stems,--render-kit), clean-room ReBirth.rbsimport (--import-rbs), and a live--ctlUnix control socket (cadence ctl).
Explore the Documentation
- User Guide — Start here for a guided walkthrough from your first 5 minutes through sound design, mixing, hardware MIDI, live recording, performance takes, and CLI scripting.
- Decks, Keymap & Interaction Spec — Complete modeless keybinding contract, directional tiers, canonical verbs, deck layouts, and modal overlay behavior.
- Material & Timing Spec — Formal
Projectv1 graph, 22PatternKindoperations,:minisyntax, fractional sub-step timing, and live launch/keep semantics. - DSP & Audio Engine Spec — Pure
cadence-core::dspsignal math, 11-module Rack runtime, 32-bit float mixer, PDC, and real-time audio invariants. - Protocols & Persistence Spec — JSON schemas,
--script/--stdioJSONL actions, live--ctlUnix socket protocol, and audio/preset/bundle formats. - Design Decisions & Verification Log — Architectural rationale and test/audio verification matrix.
- Source Code on GitHub — MIT-licensed Rust workspace (
cadence-core,cadence-formats,cadence-engine,cadence-app,cadence-gui,cadence).
Cadence User Guide
Cadence is a GPU-accelerated, keyboard-driven musical studio built around retained relationships. Patterns exist independently of the instruments that play them and the arrangement lanes that schedule them: edit one harmonic progression, rhythm, or mini-notation line and every chord, arpeggio, bassline, and filter envelope derived from it updates together—live, without expanding or losing the link.
Where to Start (By Background)
- Coming from a DAW (Ableton Live, Logic, FL Studio): Start with the Quick Tour to learn decks and transport, then jump to Mixing, FX & Signal Graph, Project Macros & Modulation, and Audio Devices, Live Recording & Hardware MIDI. Think of Lanes as tracks, Parts as reusable pattern+instrument clips, Placements as arranged spans, and Macros (
M1–M8) as song-wide performance racks. - Coming from a Hardware Groovebox, Modular Synth or Tracker (Eurorack, Elektron, Renoise, ReBirth): You will feel right at home with the unified 11-module Eurorack Modular Rack (
Panel | Patchbay | Zoneswith bipolar attenuverters, 2× through-zero FM, 32-mode physicalResonator, andz-1feedback), per-note P-locks (:link), multi-zone:zonedrum machines (TR-808,TR-909,EDM Kit— baked & live synth kits), rhythmic Pattern-Controlled Filtering (Filter), and 1-key live staging. Start with Quick Tour, Patterns & Algebra, and Modular Rack Instruments & Assets. - Coming from Live-Coding (Strudel, TidalCycles, SuperCollider): Jump straight into Patterns & Algebra for inline
:mininotation and all 22 composablePatternKindoperations, then read CLI, Scripting & Live--ctlto drive a live Cadence GUI window from scripts or agents.
Deck Map & Modeless Grammar
Every workspace view in Cadence is a deck—either a song-level deck or an object inspector deck. Cadence follows one unified modeless 4-tier keyboard grammar across every deck with zero axis flips:
- Tier 1 · Navigate (
h j k l+ Arrows): Pure spatial cursor movement matching screen axes—never mutating audio. - Tier 2 · Coarse Nav / Tabs (
H J K L): Coarse jumps or deck tabs (Panel | Patchbay | Zoneson Rack,Audio | MIDIon Devices, bars±16, sections, Mixer pages)—never mutating audio. - Tier 3 · Direct 2D Manipulate & Reorder (
Alt+h j k lfine ·Alt+H J K Lcoarse): Directly sculpt knobs, faders, pitch/gate, placement positions, curve breakpoints, or reorder inserts/zones/pins/bindings along their visual axis with coalesced single-gesture undo (u/Ctrl+z). - Tier 4 · One-Hand Scalar Adjust (
, / .fine ·< / >coarse ·Alt+Backspacereset): Nudge any focused scalar one-handed; pressEnteron any scalar for exact Value Entry (ValueInput). - Focused Input Modes (only where needed):
ienters Step Insert piano entry on Pattern Notes;gj/Ctrl+Shift+jtoggles modal Jam Mode (1–0sections,q–planes,z–,piano,Tab/Shift-Tabbank).
Press g<letter> or unshifted Ctrl+<letter> to jump straight to any of the 10 docked decks, Ctrl+Shift+<key> (or direct triggers like :, ?, n, B) for modals and overlays, z1–z4 for 1-key workspace layouts, Tab to cycle focus, zz to zoom full-screen, zp to pin/unpin, Esc to unwind your trail, and ? for the tabbed, / searchable Help reference.
SONG DECKS (g prefix / Ctrl+<key>) OBJECT DECKS & MODALS (Ctrl+Shift+<key>)
────────────────────────────────── ────────────────────────────────────────
ga / Ctrl+a · Arrange (Placements/Roll) ───▶ gi / Ctrl+i · Instrument Rack (Panel|Patchbay|Zones)
gb / Ctrl+b · Bank (Parts / Material) ───▶ Enter · Object Deck (Placement/Part/Channel/FX)
gp / Ctrl+p · Pattern (2D/Values/Mini) ───▶ P · Preset / Filter Groove Browser (live)
gm / Ctrl+m · Mixer (32f Strips + GR) ───▶ B / gS · Sample Browser (Ctrl+Shift+b)
gG / Ctrl+g · Signal Graph Patchbay ───▶ gf · File Hub (Ctrl+Shift+f/o/s/e)
gk / Ctrl+k · Project Macros (M1–M8) ───▶ gP · Song Properties (Ctrl+Shift+i)
gd / Ctrl+d · Devices (Audio | MIDI) ───▶ g, · Settings & Themes (Ctrl+,)
gt / Ctrl+t · Take Deck (tr / v / X) ───▶ : · Fuzzy Action Palette (Ctrl+Shift+p)
go / Ctrl+o · Output Scope & Meters ───▶ gj · Jam Mode HUD (Ctrl+Shift+j)
Quick Navigation Cheatsheet
| Prefix / Key | Action |
|---|---|
h/j/k/l · H/J/K/L · w/b | Strictly navigate & switch tabs (H/L tabs/bars/sections/pages · w/b groups/events/breakpoints/cables) |
Alt+h/j/k/l (Alt+H/J/K/L) · ,/. (</>) | Direct 2D manipulation & reorder · one-hand scalar adjust · Alt+Backspace reset |
Enter / i / gj / Esc | Open / launch / exact Value Entry · Step Insert (Pattern Notes) · Jam Mode · unwind trail |
: or Ctrl+Shift+p | Open Fuzzy Action Palette (fuzzy-search actions, decks, FX, song objects + live top-slot Ex passthrough) |
ga gp gb gm (or Ctrl+a/p/b/m) | Jump to Arrange, Pattern, Bank, or Mixer |
gi gk gt gG gd go (or Ctrl+i/k/t/g/d/o) | Jump to Instrument Rack, Macros, Take, Signal Graph, Devices (Audio | MIDI), toggle Output |
gs gS/B gP gf g, | Follow Source, Sample Browser, Song Properties, File Hub, Settings |
z1 z2 z3 z4 | 1-key workspace presets: Compose, Perform, Sound Design, Mix |
zz zp zx zo | Zoom active deck full-screen, Pin/unpin, Close, or Only (close others) |
Tab · A · ? | Cycle visible decks · universal Audition · open searchable Help (H/L/Tab tabs, / filter) |
Chapters
- Quick Tour: First 10 Minutes — Learn the modeless 4-tier keyboard grammar, Fuzzy Action Palette, Song Properties (
gP), themes, transport (trTake Arming &talive audio recording), and build a living 3-part groove. - Patterns, Algebra & Inline
:mini— 2D polyphonic chord editing,Step Insert, Patterns/Parts/Placements/Lanes, shared vs. local/'“From here” editing, all 22PatternKindoperations, the value curve editor, and the live-validated Mini-Notation Editor. - Modular Rack Instruments, Patchbay, Zones & Assets — Unified 11-module Eurorack Modular Rack (
Panel | Patchbay | Zones, incl.Resonator), cubic-Bezier cables with bipolar attenuverters &z-1feedback, 32-zone kits & choke groups,:mod/:patch/:unpatch/:pin/:unpin/:new, 6-category Preset Browser (P) with live non-destructive preview, baked + live-synth drum kits, bounce-to-zone, File Hub, and portable bundles. - Mixing, Studio FX & Interactive Signal Graph — Vertical Mixer channel detail stack (
Fader,Pan,Inserts,Sends,Output,Duck), unclipped 32-bit float metering (-60..+6 dBFS,0 dBhairline,HOT (32f)vs!CLIP),+6 dBconsole headroom, nestedGroup → Grouprouting, all 8 zero-alloc studio FX, and direct cable patching ingG. - Project Macros & Modulation — 8 assignable Project Macros (
M1–M8), exact compilation precedence, global:modcurves, and per-note:linkP-locks across Rack/Zone/Module/Cable/FX/Send/Channel targets. - Audio Devices, Live Recording & Hardware MIDI — Unified
Devices(Audio | MIDI) deck (gd/Ctrl+d/:audio), live CPU/xrun/input metering, live 24-bit WAV audio recording (ta/tA/ti/:rec), 1-key MIDI Learn (M), live Note+CC recording (R), hardware controller profiles & OLED/RGB feedback, plus Global Settings & GPU Themes (g,). - Live Performance & Armed Takes — Evaluated Arrange views (
vp/vo/vr) and event provenance, row-oriented Bank Launchpad, Jam Mode (gj/Ctrl+Shift+j), universalAltlayer, quantization boundaries, live staging,Alt+c/Alt+CKeep, and explicit Take Arming (tr/gtwithvVisual range marking &Xdiscard). - CLI, Headless Rendering, Formats & Live
--ctl— Offline validation, WAV/stems rendering, audio/MIDI session flags, clean-room ReBirth.rbsimport (--import-rbs), factory kit rendering (--render-kitemittingv1Rack kits),--key-script/--script/--stdio, and controlling/auditioning a live GUI session via--ctl&cadence ctl.
Showcase Projects & Technical Specs
Showcase Projects (100% MIT)
- Afterglow 3.0 (
examples/demo/project.json) — 64-bar modern EDM centerpiece featuring 8 Synth Racks, the 9-zoneEDM KitRack,Bell Miniinline:mini, 6 automated Project Macros, and studio mastering. - Iron Circuit (
examples/iron-circuit/project.json) — 48-bar Acid Electro flagship withTR-808&TR-909multi-zone Rack kits, Detroit chordSamplerRack,AcidLowPass303,Fold/HardClipDrive, rhythmicFilterPCF, nestedPercussion → Rhythmgroups, and all 8 Macros. - Glass Cathedral (
examples/glass-cathedral/project.json) — 32-bar generative ambient/IDM showcase with polymetric clocks,Cathedral Bells:mini, automated Send swells, and 4 Ambient Macros. - Fivefold Live (
examples/fivefold-live/project.json) — 60-bar live performance set with a replayable.keys.jsonlperformance script and deterministic.take.jsonlrecording. - Signal Garden (
examples/material-lab/project.json) — Compact 10-bar retained-material authoring lab accompanied by modular.keys.jsonlscripts. - Agent Session (
examples/agent-session/session.jsonl) — Typed JSONLRequest/Actionscripting session for headless and--stdioco-production.
Architecture & Implementation Specs
- Decks, Keymap & Interaction Spec
- Material & Timing Spec
- DSP & Audio Engine Spec
- Protocols & CLI Spec
- Design Decisions · Verification Suite
Chapter 1 · Quick Tour: First 10 Minutes
Guide Home · Chapter 1 · Next: Patterns, Algebra & Inline
:mini
This chapter gets you listening, navigating decks, switching themes, controlling transport, and building your first living 3-part groove from scratch—in under ten minutes.
1. Launch a Showcase Project
Start Cadence with the built-in Afterglow 3.0 demo or open any showcase directly:
# Built-in demo (Afterglow 3.0)
cargo run --release
# Or open an explicit showcase project
cargo run --release -- --project examples/demo/project.json
cargo run --release -- --project examples/iron-circuit/project.json
Press Space to start playback and Space again to pause. Press Home (or ts) to stop and return to bar 1.
Discover Everything Without Leaving the App
- Press
:orCtrl+Shift+panywhere to open the Fuzzy Action Palette—search any deck, layout, workflow, FX, theme, section, pattern, or instrument by name (↑/↓/Tabselect,Enterrun,Escclose). Power users can also type any Ex command directly (e.g.,bpm 132,derive Moving add Motif Harmony) and run it from the live top▶ Run command:slot! - Press
?(orCtrl+Shift+/) anywhere to open the tabbed, searchable Help reference (H/L,h/l, orTab/Shift-Tabswitch tabs across All, Navigate, Compose, Mini & Algebra, Sound & FX, Live & Jam, and Files & CLI; press/to filter live,Enterto lock the filter forj/kscrolling, andEscto clear the filter then close). - Open the Action Palette (
:/Ctrl+Shift+p) and run Interactive Tutorial (or:tutorial) to walk through the built-in 10-step guided tour (j/kpicks a lesson,Enterprefills its command into the Action Palette so you can inspect or run it). - Press
gP(orCtrl+Shift+i) to open Song Properties—edit song Title, Tempo (BPM), Key Root, Scale (all 13 named scales), Length (Bars), End Rule, and Live Timing on the normaluundo stack without memorizing:keyor:bpmcommands. - Press
g,(orCtrl+,) to configure Global Settings—focus GPU Theme withj/k, cycle live between Cadence Dark, Midnight Neon, and Studio Light withAlt+h/lor,/., and pressCtrl+sto save (see Chapter 6 · Audio Devices, Live Recording & Hardware MIDI for all settings and themes).
2. The Unified Modeless Keyboard Grammar
Every deck and modal in Cadence follows the exact same four-tier spatial grammar—zero accidental edits while browsing, and direct in-place manipulation without toggling a general edit mode:
| Tier / Mode | Keys | What It Does |
|---|---|---|
| 1. Navigate | h j k l (+ Arrows) · w / b | Strictly move and select along screen axes—never mutates audio. w/b jumps parameter groups, sections, active notes, breakpoints, or attached Patchbay cables. |
| 2. Coarse Nav & Tabs | H J K L | Switch deck tabs (Panel | Patchbay | Zones on Rack, Audio | MIDI on Devices, modal tabs), jump sections, bars (±16), or Mixer pages—never mutates audio. |
| 3. Direct 2D Manipulate | Alt+h j k l (fine) · Alt+H J K L (coarse) | Directly sculpt knobs, faders, pitch/gate, placement bars/lanes, curve breakpoints, or reorder inserts/zones/pins/bindings along their visual axis with coalesced single-gesture undo (u / Ctrl+z). |
| 4. One-Hand Scalar Adjust | , / . (fine −/+) · < / > (coarse) · Alt+Backspace (reset) | Adjust any focused scalar one-handed right beneath k/l; press Enter for exact Value Entry (ValueInput). |
Step Insert | i (on Pattern Notes) · Esc → Normal | Piano-keyboard step entry (1–8 scale degrees, z–, 13-key chromatic notes, Shift accent, </> octave, . rest) preserving sibling voices on existing chords. |
Jam | gj or Ctrl+Shift+j (toggles on/off) | Modal live-performance keyboard: 1–0 sections, q–p lane layers, z–, 13-key piano, </> octave, Tab/Shift-Tab bank paging when >10 lanes/sections. |
Universal / Search
Across the Sample Browser (B/gS), Preset Browser (P), Groove Browser (P on Filter), File Hub (gf), Pickers, and Help (?), pressing / enters live search:
- Type to filter immediately (arrows
↑/↓step matches while typing;Ctrl+uclears). - Press
Enter(orTab) to lock the filter and return toj/klist navigation. - Press
Esconce to clear an active filter, andEscagain to close the overlay.
3. Navigate Decks & Layouts
Cadence organizes everything into decks. Pinned decks stay anchored (wide decks across the top, tall decks docked on the right), while your working deck opens below Arrange and automatically follows your selection until you pin it (zp).
Jump to Any Deck (g prefix or Ctrl+<key>)
g Prefix | Direct Ctrl | Destination |
|---|---|---|
ga / gp / gb / gm | Ctrl+a / Ctrl+p / Ctrl+b / Ctrl+m | Arrange · Pattern · Bank Launchpad · Mixer |
gi / gk / gt / gG | Ctrl+i / Ctrl+k / Ctrl+t / Ctrl+g | Instrument Rack · Project Macros · Take Deck · Signal Graph |
gd / go | Ctrl+d / Ctrl+o | Devices (Audio | MIDI) · Toggle 32-bit float Output monitor |
gj / gf / gP / g, / gS (B) | Ctrl+Shift+j/f/i/,/b | Jam · File Hub · Song Properties · Settings · Sample Browser |
gs / gg / ge | — | Follow upstream Source pattern · jump to start / end of focused deck |
Arrange Your Workspace (z prefix / Ctrl+w)
| Keys | Effect |
|---|---|
z1 | Compose preset (Arrange + Pattern) |
z2 | Perform preset (Arrange + Bank Launchpad + Output) |
z3 | Sound Design preset (Pattern + Instrument + Output) |
z4 | Mix preset (Arrange + Mixer + Output) |
zz | Zoom the focused deck full-screen (press zz again to restore) |
zp · zx · zo | Pin/unpin working deck · Close focused deck · Only (close others) |
zh zj zk zl | Move focus directionally between visible decks |
z= z- z0 (or Ctrl+=/-/0) | Zoom Arrange or Pattern timeline horizontally / reset to 100% |
Tab · Enter · Esc | Cycle visible decks · open/launch/enter exact value · unwind trail (Backspace also steps back) |
4. Transport, Loops, Recording & Timing (t prefix)
| Keys | Command | What It Does |
|---|---|---|
Space | — | Play / pause transport |
Home or ts | :stop | Stop and rewind to bar 1 |
\ | :loop | Toggle the song/region loop on or off |
tl | :loop SECTION | Loop the section under the Arrange cursor |
tx | :loop clear | Clear remembered loop brackets and return to linear song playback |
tf | :follow | Toggle viewport follow (auto-pauses when you scroll manually; tf resumes) |
tc / tp / tg | :cue / :play | Cue transport to Arrange cursor (paused / playing) or jump to an exact bar (tg) |
ta / tA / ti | :rec ... | Toggle 24-bit WAV audio recording (ta) · open Record Audio dialog (tA) · cycle live input monitor Off|Auto|On (ti) |
tr | :take toggle | Arm / disarm Take recording (default OFF; Chrome shows TAKE ARM / ● REC TAKE; enable Auto-Record Takes in g, for always-on capture) |
tR | :restart | Restart the current loop from its start boundary |
te | :end loop|stop|continue | Cycle what happens at the end of the song |
tq / tQ | :quantize ... | Cycle launch quantization boundary / pick a Cycle <PATTERN> boundary |
tE | :quantize edits now|launch | Toggle whether live edits land immediately or wait for the launch boundary |
tb / tC | :bounce ... | Resample focused part, pattern, bar range, or Rack zone to WAV (tb) · clear all clipped meters (tC) |
5. Build a Living 3-Part Groove from --empty
Every musical object in Cadence can be created through cancellable modal forms (n / Ctrl+Shift+n)—which validate and commit once with zero partial state—or through the Fuzzy Action Palette (: / Ctrl+Shift+p), which also runs typed Ex commands directly from its top passthrough slot.
Launch an empty workspace:
cargo run --release -- --empty
Press Space whenever you want to hear your groove come alive as you build it, and press gP anytime to set your song’s title, tempo, key, and scale.
Step 1 · Create Independent Material (Motif + Harmony + Derivation)
We will build a 5-step melodic motif, a 4-bar (64-step) harmonic degree curve, and a live AddDegrees derivation that shifts the motif through the harmony without copying a single note.
| Step | Modal Form Workflow | Equivalent Ex Command (via : Palette) |
|---|---|---|
| 1a. Five-step motif | Press n → n (Notes), name Motif, length 5, Enter. Press i (Step Insert) and type 1 3 5 8 7 (or sculpt directly with Alt+j/k pitch, Alt+h/l gate, ,/. vel), then Esc. | :pattern notes Motif 0 2 4 7 6 (zero-based offsets → degrees 1, 3, 5, 8, 7) |
| 1b. 64-step harmony | Press n → d (Degrees), name Harmony, period 64, Enter. Navigate to offsets 0, 24, 32, 56, and nudge directly with Alt+j/k or ,/. (or press Enter for exact Value Entry). | :pattern degrees Harmony 64 0:0 24:-2 32:2 56:-1 |
| 1c. Live derivation | Inside Pattern deck press d (or n → a Derive pattern), choose AddDegrees, name Moving, pick Motif + Harmony. | :derive Moving add Motif Harmony |
Step 2 · Create Instruments, Parts, Lanes & Placements
Now attach sounds and schedule them on the timeline—plus register a launchable bass part on the Bank launchpad.
| Step | Modal Form Workflow | Equivalent Ex Command (via : Palette) |
|---|---|---|
| 2a. Lead synth Rack | n → i (Instrument), name Lead, choose pulse-lead (or Init Synth; creates its Lead Audio channel automatically; press gi then P anytime to audition presets live across all 6 categories!). | :instrument Lead pulse-lead (or :new synth Lead) |
| 2b. Bind material → sound | n → b (Part), name LeadPart, pattern Moving, instrument Lead. | :part LeadPart Moving Lead |
| 2c. Create lane | n → l (Lane), name LeadLane. | :lane LeadLane |
| 2d. Place on timeline | n → o (Placement), part LeadPart, lane LeadLane, bar 1, length 8 bars, phase Song. | :place LeadPart LeadLane 1 8 song |
| 2e. Quick 1-step bass part | n → p (Placed part) creates Pattern + Instrument + Part + Lane + Placement in one atomic form! | :part new Bass sub-bass 0 . . . 0 . 4 . |
2f. Add drums (TR-808 Rack kit) | n → i → Drums → tr-808 (or tr-808-synth live synth kit), then n → m (Mini) + n → b + n → o. | :kit Drums tr-808:mini Beat 16 c2 ~ f#2 ~ c#2 ~ f#2 ~ c2 ~ f#2 c2 c#2 ~ a#2 ~:part DrumPart Beat Drums:lane DrumLane:place DrumPart DrumLane 1 8 song |
| 2g. Add to Bank launchpad | Open gb (Bank Launchpad) to launch lane parts live. | :lane LeadLane add LeadPart song |
Step 3 · Watch Relationships Work Live
- Press
Spaceto hear the 5-step motif shift across the 64-step harmony above your bass and 808 beat. - Open
HarmonyviaCtrl+Shift+p→Open Pattern: Harmony(or pressgpand followgsfromMoving). - Move to step 33 (offset
32) withh/lorw/b, and nudge the harmony value directly withAlt+j/kor,/.(or pressEnter, type4, and confirm). Every bar ofMovingupdates instantaneously whileMotifstays untouched. - Run
:inspect Movingfrom the Action Palette to view its dependency tree and consumers. - Save your song with
Ctrl+s(or:w my-groove.json). Undo any step anytime withu(Ctrl+z) and redo withU(Ctrl+Shift+z/Ctrl+r).
Next: Learn all 22 retained
PatternKindoperations, scoped editing, and inline:mininotation in Chapter 2 · Patterns, Algebra & Inline:mini.
Chapter 2 · Patterns, Algebra & Inline :mini
Previous: Quick Tour · Chapter 2 · Next: Modular Rack Instruments & Assets
Cadence never forces you to bake musical ideas into disconnected clips. This chapter explains the four core song entities, how shared vs. scoped edits work, all 22 PatternKind operations, the value curve editor, and the complete inline :mini notation language.
1. The Four Musical Entities
| Entity | Role | Key Properties |
|---|---|---|
| Pattern | Live musical definition—independent of sound or song position. | One of 22 PatternKinds (literal notes, rhythms, value curves, inline :mini, Euclidean rhythms, or retained derivations). |
| Part | Joins one Pattern to one Instrument. | transpose (semitones), velocity_scale, and per-note Parameter Links / P-locks (:link PART PARAM VALUE_PAT). |
| Placement | Schedules one Part onto a Lane for a bar span. | start_step, length_steps, Phase (Song or Restart), offset_steps, and optional step-level local exceptions. |
| Lane | Arrangement track & live performance channel. | Holds non-overlapping Placements plus a launchpad part list (:lane LANE add PART) for live overrides. |
Phase Modes: Song vs. Restart
Song(default): Evaluates the pattern against the global song clock (song_step + offset_steps). A 5-step motif or 64-step harmony stays phase-aligned across breaks, muting, and separate placements.Restart: Resets pattern time to0 + offset_stepsat the placement’s start step—ideal for drum fills, intro phrases, or turnarounds that must begin from step 1 wherever you place them.
2. Shared Edits, Local Exceptions, ' “From Here”, Fork & Freeze
Because patterns are shared by reference, Cadence gives you five explicit ways to decide who hears an edit:
| Scope | How to Invoke | What Changes |
|---|---|---|
| Shared definition (default) | Edit normally inside gp (Pattern deck) | Updates the pattern everywhere—all placements and downstream derivations update together. |
| Placement-local exception | Press o on a Placement deck or run :local [ID]; clear a step with Backspace or :inherit | Overrides individual steps for this placement only while staying linked to upstream sources on every other step. |
| Scoped “From here” fork | Press ' (apostrophe) in Arrange or Pattern, then make one pattern edit | Forks the edited pattern (plus any dependent derived patterns & parts) and splits/retargets placements from the current bar onward—earlier bars stay untouched, all in one undoable transaction. |
| Explicit fork | Press f on a Pattern or Placement deck or run :fork NAME [SOURCE] | Creates a new independent copy of the pattern. Derived forks keep their upstream source links so shared harmonic edits still reach them. |
| Freeze | Press F on a Derived/Mini/Generator pattern or run :freeze NAME START_STEP LENGTH [SOURCE] | Evaluates any derived, Euclidean, seeded, or :mini pattern across [START_STEP, START_STEP + LENGTH) and bakes the result into a literal Notes, Rhythm, or Values pattern. |
3. All 22 PatternKind Operations
Cadence provides 6 source kinds and 16 retained derivation operators (6 + 16 = 22). Every derivation is evaluated lazily from its inputs and can be chained up to 32 levels deep.
A. Source Patterns (6)
PatternKind | Modal n | Ex Command | Description |
|---|---|---|---|
Notes | nn | :pattern notes NAME TOK... | Literal step/chord sequence (degrees, MIDI names like C4, chords 0,2,4 up to 6 tones, . rests). |
Rhythm | nr | :pattern rhythm NAME x..x... | Boolean trigger grid (x/X/1/+ on, ./~/-/0 off). |
Values (Degrees / Normalized) | nd / nv | :pattern degrees|values NAME PERIOD [hold|ramp] STEP:VAL... | Sparse breakpoint curve in Degrees or Normalized (0..1) with Hold or Ramp interpolation. |
SeededValues (Degrees / Normalized) | ng / ns | :pattern seed|seed-degrees NAME PERIOD SEED MIN MAX | Deterministic hash-based value sequence reproducible across runs and platforms. |
Mini | nm | :mini [NAME [STEPS]] <CODE...>:pattern mini NAME STEPS <CODE...> | Strudel/Tidal-inspired inline mini-notation with fractional sub-step timing. |
Euclidean | ne | :pattern euclid NAME PULSES STEPS [ROT] | Bjorklund Euclidean rhythm E(pulses, steps, rotation). |
B. Harmony & Pitch Derivations (5)
PatternKind | :derive Op | Syntax | Description |
|---|---|---|---|
AddDegrees | add | :derive NAME add NOTES DEGREES | Shifts a note pattern’s scale degrees by a Degrees value pattern on its own independent clock. |
Mask | mask | :derive NAME mask NOTES RHYTHM | Gates a note pattern so notes only sound where Rhythm triggers. |
Transpose | transpose | :derive NAME transpose SOURCE SEMITONES | Chromatically transposes any note pattern by signed semitones. |
NotesFromValues | from | :derive NAME from DEGREES RHYTHM [OFFSET VEL GATE] | Combines a Degrees curve and a Rhythm trigger stream into a live note pattern. |
RangeFold | fold | :derive NAME fold SOURCE LOW_MIDI HIGH_MIDI | Octave-folds out-of-range notes cleanly into [LOW_MIDI, HIGH_MIDI] (keeps basslines or leads in their sweet spot). |
C. Time, Groove & Articulation Derivations (6)
PatternKind | :derive Op | Syntax | Description |
|---|---|---|---|
TimeScale | fast / slow | :derive NAME fast SOURCE NUM [DEN]:derive NAME slow SOURCE DEN [NUM] | Rational time-scaling (num > den speeds up into triplets/subdivisions; num < den stretches). |
Swing | swing | :derive NAME swing SOURCE AMOUNT | Sub-step 16th-note swing (0.0..=0.45, e.g. 20%), delaying odd 16th steps cleanly. |
Ratchet | ratchet | :derive NAME ratchet SOURCE COUNT | Subdivides every active hit into count (1..=8) evenly spaced sub-step retriggers. |
Shift | shift | :derive NAME shift SOURCE STEPS | Rotates/shifts any pattern in time by signed 16th-steps. |
Reverse | reverse | :derive NAME reverse SOURCE | Mirrors any pattern backwards over its natural period. |
Arp | arp | :derive NAME arp SOURCE up|down|updown|random [RATE] | Arpeggiates held chord tones at rate (1..=4) sub-step notes per step. |
D. Probability, Form & Dynamics Derivations (5)
PatternKind | :derive Op | Syntax | Description |
|---|---|---|---|
Chance | chance | :derive NAME chance SOURCE PROB [SEED] | Deterministic per-hit probability gate (0..1 or 0%..100%) using a pure seeded hash. |
Every | every | :derive NAME every INTERVAL BASE ALT | Plays BASE normally and switches to ALT every INTERVAL-th cycle (bar/phrase turnarounds). |
Concat | concat | :derive NAME concat P1 P2 ... | Sequences multiple patterns end-to-end as a longer live form. |
Stack | stack | :derive NAME stack P1 P2 ... | Layers multiple patterns simultaneously, merging sub-step events in exact time order. |
Shape | shape | :derive NAME shape SOURCE VELOCITY [GATE] | Shapes a note pattern’s velocity (and optionally gate length) from normalized Values curves. |
4. Editing Patterns & Value Curves (gp / Ctrl+p)
Open any pattern in the Pattern deck (gp / Ctrl+p). Pattern editing follows Cadence’s modeless 4-tier grammar: hjkl strictly navigates, Alt+hjkl and ,/. sculpt directly in place, and i opens Step Insert for piano-keyboard entry on editable Notes patterns.
2D Polyphonic Notes & Rhythm Controls
- Navigate (never mutates notes):
h/lstep ·H/L(orPgUp/PgDn) jump 16 steps (1 bar) ·0/$/Gfirst/last step ·w/bjump active notes/hits ·=/-quick zoom.j/kselect stacked chord voices vertically (sorted visually from lowest pitch0to highestN-1; the status bar showsVoice 2/4 · A♭4 · len 1.50 · vel 88%).
- Direct Modeless Sculpting on
Notes(or:localPlacement scope):Alt+j/knudge pitch±1degree (Alt+J/K±1octave) ·[/](and#) flat/sharp accidental.Alt+h/lgate length±0.25steps (Alt+H/L±1.0, range0.05..64.0).,/.velocity±5%(</>±15%).c/CcycleStepCondition·ostack chord voice (up to 6 simultaneous voices) ·mtoggle step rest/active (preserving pitch/chord) ·xdelete focused voice ·Xclear step ·Backspace(in Placement scope) re-inherit step from definition.
- Direct Editing on
Rhythm:Enterorxtoggles the hit directly under the cursor. - Piano Step Entry (
Step InsertviaionNotes;Esc→Normal):1–8enters scale degrees;z s x d c v g b h n j m ,plays and writes chromatic notes (Shiftaccents to1.0velocity);</>shifts octave;.writes a rest;Left/Rightsteps cursor.- When overwriting a voice inside an existing chord stack,
Step Insertpreserves all sibling chord voices cleanly!
- Derive / Edit / Inspect:
nopens the create menu,dopens the Derive form targeting the current pattern,redits the current pattern definition/length/rename in-place (works onNotes,Mini,Euclidean,SeededValues, and all derived patterns),Atoggles pattern audition,fforks,Ffreezes derived/generator patterns to literal,;repeats the last single-step edit, and on derived patternsj/khighlights upstream source chips right in theSOURCES:bar whileEnter/gsopens the selected source directly. - Clipboard (
[N]y,p,P): Pressyto yank the step under the cursor—or type a count like4yto yank a 4-step span—thenpto paste after/at cursor orPto paste before. Works seamlessly acrossNotes,Rhythm, andValuespatterns.
Value Curve Editor (Degrees & Normalized)
- Navigate:
[count]h/lsteps across time offsets ·H/Ljumps 1 bar ·w/bjumps between authored breakpoints ·0/$/Gfirst/last step. - Direct Sculpting:
Alt+j/kand,/.nudge value fine (±0.01/±1deg) ·Alt+J/Kand</>coarse (±0.10/±7deg) ·Alt+h/lslide breakpoint in time±1step (Alt+H/L±4steps) ·Enteropens unified live-validated Value Entry (0.5or50%for Normalized; signed integers for Degrees) ·mtogglesHold ↔ Ramp·xdeletes breakpoint ·einspects or jumps to downstream Modulation/Link consumers. - Direct edit from anywhere (even mid-set):
:value [PATTERN] STEP VALUE|off(1-based step) or:value-mode [PATTERN] hold|ramp|toggle.
5. Dedicated Mini-Notation Editor & Syntax Reference
Cadence includes a pure, deterministic Strudel/Tidal-inspired mini-notation engine with true fractional sub-step timing—every triplet, quintuplet, Euclidean hit, and ratchet renders directly onto the Pattern roll and audio engine with zero rounding loss.
Dedicated Live-Validated Mini-Notation Editor (Enter on Mini)
- Open editor: Select any
Minipattern ingpand pressEnter(or run Edit Mini-Notation from the:/Ctrl+Shift+pAction Palette) to launch the dedicatedMINI EDITORmodal. - Live feedback on every keystroke: Parses immediately via
cadence_core::mini::parse_mini, showing a real-time green valid status with Cycle 1 event count and resolved note preview (e.g.,C5 E♭5 F5 G5 …), or highlighting exact syntax errors before you commit. - Controls: Type code directly ·
Ctrl+uclear ·Entercommits when valid (single undo entry) ·Esccancels cleanly. - Create or script by name: Press
n→mto create via modal form,rongpto edit name/step length in-place, or run:mini LeadLine 16 c4 [e4 g4] ~ <a4 b4>via the Action Palette orcadence ctl cmd(defaults to 16 steps if omitted).
Complete Syntax Reference
| Syntax | Meaning | Example |
|---|---|---|
c4, eb3, f#5, bb2 | Absolute MIDI note names (s or # sharp, b flat; octave defaults to 4) | c4 eb4 g4 bb4 |
1, 3, -2, 5#, 3b, 0 | Scale degrees relative to project key (1 = tonic, 0 = leading tone below tonic) | 1 3 5 7b |
~ or . | Rest (empty slot) | c4 ~ e4 . |
[a b c] | Recursive subdivision (fits items evenly inside one slot) | [c4 [e4 g4]] |
[c4,e4,g4] or c4,e4,g4 | Simultaneous chord (up to 6 notes: 1 main + 5 chord tones) | [c4,eb4,g4]! |
<a b c> | Cycle alternation (advances one choice per pattern cycle) | <c4 f4 g4 eb4> |
*N | Repeat N times (1..=16) within the item’s span | eb5*2 · c4*4 |
/N | Slow down (1..=16): item plays once every N cycles | [c5 g5]/2 |
@N | Weight / elongate (0.125..=32.0) relative to sibling slots | c4@3 eb4@1 |
(k,n) / (k,n,r) | Euclidean distribution (0 <= k <= n <= 64, optional rotation r) | c2(5,16) · f#2(7,16,2) |
? / ?p | Deterministic probability (? = 50%, ?0.7 = 70% hit chance) | g5?0.6 |
! | Accent (velocity = 0.98 vs. default 0.80) | c#3! |
Modifiers chain cleanly in any order—for instance, c4(3,8)*2?0.8! distributes 3 pulses across 8 slots, doubles each pulse into a two-hit ratchet, gates each hit at 80% deterministic probability, and accents every surviving hit.
Real Recipes from the Showcase Projects
- Afterglow 3.0 (
Bell Mini, 16 steps) — syncopated sub-step grace notes and a 32nd-note double tap (eb5*2)::mini "Bell Mini" 16 ~ c5 ~ [eb5 f5] ~ ~ [g5 f5] eb5 ~ c5 ~ [bb4 c5] eb5*2 ~ [f5 g5] ~ - Iron Circuit (
808 Conga Mini, 16 steps) — triggeringTR-808multi-zone Rack pads (B2=Low Conga,C3=Mid Conga,C#3=High Conga accented!,D3=Claves,F2=Rimshot)::mini "808 Conga Mini" 16 ~ ~ b2 ~ ~ c3 ~ f2 c#3! ~ ~ b2 ~ d3 ~ c3 - Iron Circuit (
808 Drop Perc, 16 steps) — denser electro percussion with cowbell (g#2) and maracas (d#3)::mini "808 Drop Perc" 16 b2 ~ g#2 d3 ~ c3 g#2 ~ c#3! d3 b2 ~ d3 g#2 c3 ~ - Glass Cathedral (
Cathedral Bells, 16 steps) — cascading sub-step triplets ([c5 e5 g5]) and pairs over a gentle ambient clock::mini "Cathedral Bells" 16 d5 ~ [a5 c6] ~ ~ f5 [e5 d5] ~ a4 ~ [c5 e5 g5] ~ ~ [f5 a5] ~ ~
Next: Build custom modular voices, patch bipolar cables with
z-1feedback, layer 32-zone kits, and explore the MIT preset/asset library in Chapter 3 · Modular Rack Instruments, Patchbay, Zones & Assets.
Chapter 3 · Modular Rack Instruments, Patchbay, Zones & Assets
Previous: Patterns & Algebra · Chapter 3 · Next: Mixing, FX & Signal Graph
Every instrument in Cadence (Project v1, InstrumentPreset v1) is powered by one unified Eurorack Modular Rack (Rack → Zones → Modules [Panel] + Patchbay)—combining analog/FM synthesis, stereo sampling with automatic RIFF loop metadata, bit-crushing/wavefolding, 32-mode physical modal resonators, bipolar audio-rate CV/FM patching with deterministic z-1 feedback, and 32-zone note/velocity-layered drum kits inside a single orthogonal zero-allocation voice engine.
1. One Unified Rack Architecture (Rack → Zones → Modules + Patchbay)
Instead of separating synths, samplers, and drum machines into incompatible engines, every Cadence instrument is a Rack:
- 1-Zone Synths & Samplers: A classic dual-oscillator synth, an
Acid 303ladder lead, a single-file stereo sampler, or an experimental FM/feedback modular voice is simply a 1-zone Rack whose zone spans the full keyboard (0..127). - Multi-Zone Kits & Layered Instruments: A drum machine (
TR-808,TR-909,EDM Kit— either baked samples or pure live-synthesized kits!) or velocity-layered multisample is an N-zone Rack (up to 32 zones and 8 choke groups) where every individual zone contains its own complete modular graph (sample playback, analog/FM/modal synthesis, or both side-by-side!). - 4 Neutral Bare Templates (
RackTemplate): Start fresh with zero disk dependencies fromInit Synth,Blank Sampler,Blank Kit, orBlank Modular, or load any external MITv1preset frompresets/.
Creating Instruments (n → i, :new, :instrument, :kit, :sampler)
:new synth Lead # Bare Init Synth template (VCO -> Filter -> VCA -> Out)
:new sampler Stab # Bare Blank Sampler template
:new kit Drums # Bare Blank Kit template
:new modular Patch # Minimal [Out] modular canvas (also `:new rack Patch`)
:instrument Lead pulse-lead # Load any v1 catalog preset (synth, drums, kit, or modular)
:instrument Stab sampler stab.wav # Sampler Rack loaded directly from an audio file
:instrument Drums kit tr-808 # Multi-zone kit from preset (`tr-808`, `tr-808-synth`, or `folder DIR`)
:kit Drums tr-909-synth # Live-synthesized 11-zone TR-909 Rack kit
:sampler Vocal samples/vox.wav # Shorthand for a Sampler Rack
Universal 3-Tab Instrument Deck Controls (gi / Ctrl+i)
Every instrument opens onto the 3-tab Instrument Deck—Panel | Patchbay | Zones—obeying Cadence’s modeless 4-tier grammar:
- Switch Tabs:
H/L(or:page panel|patchbay|zones/:tab ...) - Universal Actions:
P: open the unified 6-Category Preset Browser with live non-destructive audio preview on scroll (also includes Save Preset &Rreload)r: rename the focused instrument (or focused module/pin/zone)A: audition a note (or the focused zone at its root MIDI note)B: open the Sample Browser to assign a WAV/FLAC/MP3/Ogg/AIFF/WavPack file to the active zone (auto-insertingSampler → Out.Inif the zone has no Sampler module yet)o: route output channelM: arm 1-key MIDI Learn on the focused control or cable attenuverter (see Chapter 6)X: delete instrument (confirmation-guarded)
- Direct Modeless Sculpting (no mode toggle):
Alt+h/lor,/.: fine adjust ·Alt+H/Lor</>: coarse adjust ·Alt+Backspace: reset to defaultEnter: open unified live-validated Value Entry (1200hz,-3dB,50%,L35,+2.5 oct) — or open the Sample Browser / link picker on link rowse: inspect or bind Project Macros (M1–M8) & Modulations targeting the focused control
2. Panel Tab — Quick Faceplate, 11 Orthogonal Modules & 12 Live Visualizers
The Panel tab gives you instant studio ergonomics without diving into cables unless you want to:
- Horizontal Module Pill Strip: Cycles with
h/lacrossQuick(your curatedpanel_pinsperformance faceplate—up to 16 pinned Rack, Zone, Module, or Cable controls) followed by every module in the active zone. Walk controls vertically withj/k(w/bjump groups), and reorder pins onQuickwithAlt+j/k. - Live GPU Visualizers (
12Dedicated Painters):QuickshowsPinnedOverview(oscillator waveform, live modulated filter response curve, primary envelope contour, and live Dry Scope together); selecting any individual module pill switches to its dedicated real-time visualizer (VCO waveform + unison/FM state, Sampler 512-bin peak waveform + trim/loop markers, Noise filter tilt, Multi-Burst Env contour, LFO wave, Filter response + live mod band, Drive transfer curve, LoFi quantized staircase, Resonator 32-mode physical spectrum, VCA/RingMod transfer, or Out stereo spread/scope). - Direct Panel Workflows:
aopens the Add Module picker (:mod add),xremoves the focused module (the singular mandatoryOutmodule is always protected),ppins or unpins the focused control on theQuickfaceplate (:pin/:unpin), andAlt+h/l/,/./Entersculpt values directly.
All 11 Orthogonal Eurorack Modules (1..=24 Modules per Zone)
Every zone executes its modules at full f64 audio rate inside zero-allocation ModularVoice, strictly composing cadence_core::dsp::*:
| # | Module | Patchbay Column | Accepted InPorts | DSP Highlights & Key Parameters |
|---|---|---|---|---|
| 1 | Vco | SOURCES | PitchCv, FmIn, PwCv | Bandlimited PolyBLEP/PolyBLAMP (Sine, Triangle, Saw, Pulse with DC-compensated PWM), up to 7-voice stereo unison (unison_detune, unison_width), Chromatic/Fixed pitch tracking, ±48 st / ±100 ct tuning, and 2× Halfband2x-oversampled through-zero linear FM (step_vco_bank_fm_2x) via FmIn. |
| 2 | Sampler | SOURCES | PitchCv, TrigIn | Pure-Rust stereo sample player (PCM/Float WAV, Ogg-in-RIFF WAV, FLAC, Ogg Vorbis, MP3, AIFF, WavPack .wv) with 4-point Catmull-Rom cubic Hermite interpolation (SamplerVoice), automatic RIFF smpl/inst root & loop metadata (Off/Forward/PingPong, loop_xfade), start/end trim, one_shot, audio-rate PitchCv, and external TrigIn retriggering. |
| 3 | Noise | SOURCES | (none) | Sample-rate-invariant White (NoiseGen) or Paul Kellet 7-pole Pink (PinkFilter) noise with dedicated TPT highpass (20..18k Hz), lowpass (20..20k Hz), and level—freely patchable pre- or post-filter. |
| 4 | Env | MODULATORS | TrigIn | ModularEnv supporting both Adsr and HoldDecay modes, Gate/OneShot trigger modes, pre-delay (0..500 ms), and 1..=8 multi-bursts (2..50 ms spacing for authentic TR-909 claps & flams), plus Acid accent decay snap and click-free 3.5 ms choke fades. |
| 5 | Lfo | MODULATORS | (none) | Sine, Triangle, Saw, Square, or SampleHold; free rate (0.01..40 Hz) or tempo-synced across 12 rhythmic divisions (1/64..4/1), key retrigger, and bipolar ([-1, 1]) vs unipolar ([0, 1]) polarity. |
| 6 | Filter | PROCESSORS | In, Cv | 5 modes: 2-pole ZDF SVF (LowPass, BandPass, HighPass), 1-pole 6 dB/oct LowPass6, and 4-pole 24 dB/oct nonlinear diode ladder AcidLowPass (with velocity accent vel_amount & bass compensation), plus drive, key_track, mix, and audio-rate octave Cv. |
| 7 | Drive | PROCESSORS | In, Cv | Stereo multi-circuit waveshaper (Tape, HardClip, West-Coast Fold with 2× Halfband2x oversampling), asymmetry (-1..+1), post-tone LPF, output trim, mix, DC blocker, and audio-rate Cv. |
| 8 | LoFi | PROCESSORS | In | Continuous mid-tread bit-depth quantizer (bits: 2..24, transparently bypassed >= 23.95), phase-accumulating clock decimator (sample_rate: 500..48k Hz), and dry/wet mix. |
| 9 | Resonator | PROCESSORS | In, PitchCv, Cv | Sample-rate-invariant 32-mode physical modal bank (String, Bar, Membrane, Plate; up to 4 per zone) with Chromatic/Fixed pitch (PitchCv), dispersion/inharmonicity (structure), exact -60 dB RT60 (decay), frequency damping (brightness, modulatable via Cv), strike position, and mix—plus z-1 Drive feedback for realistic cymbals, plucked strings, bars, and drums. |
| 10 | Vca | VCA / OUT | In, Cv | Gain (0..2) + bias (0..1). Acts as a classic envelope VCA (Env → Vca.Cv, bias = 0), a parallel mixer, or a 4-quadrant audio-rate Ring Modulator (Vco → Vca.Cv). |
| 11 | Out | VCA / OUT | In, Cv | Singular mandatory terminal sink for every zone (gain_db -36..+12 dB, pan, M/S stereo spread, optional Cv, DC blocker, and transparent voice safety guard). |
3. Patchbay Tab — Multi-Column Cables, Bipolar Attenuverters & z-1 Feedback
Switch to Patchbay (H/L or :page patchbay) to wire your voice directly across four color-coded signal columns—SOURCES → MODULATORS → PROCESSORS → VCA / OUT—using up to 64 patch cables per zone.
Bipolar Attenuverter Cables & z-1 Feedback Safety
- Every cable is a first-class modulatable parameter: Audio (
In:-200%..+200%),PitchCv(±48 st),FmIn(±100%),PwCv(±45%),TrigIn(-2..+2),Filter.Cv(±6 oct),Vca.Cv(±200%),Resonator.Cv(±100%), andDrive/Out.Cv(±100%). Negative depths invert polarity for inverted filter sweeps, counter-phase audio cancellation, or negative FM feedback! - Cycle-safe
z-11-sample feedback: Patch any downstream module back upstream (e.g.,Fold Drive → VCO.fm -28%orPlate → Drive → Plate) without deadlocks or crashes. Cadence’s Kahn DAG compiler automatically flags back-edges with a 1-sample delay (z-1), soft-bounds feedback energy, and renders feedback cables as glowing arc-length-dashed Bezier curves badgedz-1.
Patchbay Keyboard Controls
| Key | Action |
|---|---|
h/j/k/l | Navigate 2D across Patchbay columns and module cards |
w/b or [/] | Cycle through cables attached to the focused module (and back to module focus) |
Alt+h/l or ,/. (Alt+H/L or </>) | Nudge selected cable attenuverter fine / coarse (Alt+Backspace resets to default) |
c | Patch a new cable from the focused module (opens target module.port picker → exact attenuverter ValueInput) |
C or Enter (on cable) | Select/edit cable amount via exact ValueInput |
x | Disconnect the selected cable (or remove the focused module when no cable is selected; never Out) |
a | Add a new module to the active zone |
p / e | Pin cable to Quick Panel / bind Macro or Modulation to cable attenuverter |
Enter (on module) | Jump straight to that module’s Panel controls & visualizer |
Modular Rack Ex Commands (:mod, :patch, :unpatch, :pin, :unpin)
:mod add vco "Sub FM" # Add a module to the active zone
:mod add resonator "Bronze Plate" # Kinds: vco, sampler, noise, env, lfo, filter, vca, drive, lofi, resonator
:mod rename "Sub FM" "FM Osc" # Rename a module by ID or name
:mod del "FM Osc" # Remove module and sever attached cables (protects Out)
:patch "FM Osc" VCO.fm 35% # Connect cable with explicit port & bipolar depth
:patch "Fold Drive" VCO.fm -28% # Cross-column feedback cable (auto-compiled with z-1 delay!)
:patch VCO "Acid Filter" # Omit .port to infer the default compatible port
:unpatch c13 # Cut cable by ID (or `:unpatch "Fold Drive" VCO.fm`)
:pin # Pin/unpin the currently focused control on the Quick Panel
:pin "Acid Filter".cutoff "Cutoff" # Pin any Rack/Zone/Module/Cable target with custom label
:pin c2 "FM Depth" # Pin a Patchbay cable attenuverter right onto Quick!
:unpin 1 # Remove Quick Panel pin by 1-based index, param, or label
4. Zones Tab — Multi-Zone Kits, Key/Vel Splits & Unified Addressing
Switch to Zones (H/L or :page zones) to build drum machines (TR-808, TR-909, EDM Kit) or multi-layered chromatic instruments with up to 32 zones (0..127 MIDI ranges, 0%..100% velocity windows) and 8 choke groups (e.g., Closed Hat choking Open Hat). Every zone owns its own independent Eurorack module graph—so one kit can freely combine sampled hits, pure analog/FM/modal synth pads, and hybrid layered zones!
Navigating & Editing Zones
h/l: move left/right across the scrollable horizontal Zone pill strip and synchronized 2D Key×Velocity piano-roll zone map at the top of the deck (synced cleanly withPanelandPatchbay, so switching tabs inspects the selected zone’s modules and cables!)j/k(w/bgroup jump): walk Zone, Voice, and Rack inspector controls below (key range, root MIDI, velocity window, zone gain/pan, choke group, sample path, links, routing)Alt+h/l&,/.(Alt+H/L&</>coarse,Alt+Backspacereset): adjust the focused zone/voice/rack control directly (Enteropens exactValueInputor Sample Browser)Alt+j/k: reorder the active Zone in the stripa/d/x/r: open"Add Zone…"picker / duplicate zone / delete focused zone (at least 1 zone always remains) / rename zoneB/A/e: assign a sample via Sample Browser / audition the active zone at its root MIDI note / bind Macro or Modulation links
Unified Parameter Addressing (Rack, Zone, Module, Cable)
Every continuous Rack bus control (gain, pan, tune, cutoff, resonance), Zone control (gain, pan, glide, root_midi, etc.), Module parameter (all 62 ModuleParams), and Patchbay Cable attenuverter (c<id> / cable.<id>) is addressed through one orthogonal ParamAddress system across :param, :mod, :link P-locks, Project Macros, and MIDI Learn:
:param cutoff 1200hz # Shorthand: checks panel_pins -> unique module -> zone/rack
:param "Acid Filter".cutoff 920hz # Module parameter on a 1-zone Rack
:param c5 +2.75 # Patchbay cable attenuverter by cable ID
:param rack.cutoff 14khz # Rack-level master bus filter (`rack.` or `bus.`)
:param TR-808.BD.cutoff 1200hz # Global zone/module path (`INST.ZONE.PARAM`)
:param TR-808.z1.gain -2dB # Address zone by stable 1-based zone ID (`z1..z32`)
:param BD.decay 420ms # Short zone form while TR-808 deck is focused
:mod "Hat Air" TR-808.OH.cutoff Lfo1 # Automate a single pad's filter
:link DrumPart CH.tune GrooveVals # Per-note P-lock on Closed Hat pitch
:macro 4 bind TR-808.BD.tune 0.3 0.75 # Bind a Project Macro to a single kit zone
:zone Management Commands
| Command | Effect |
|---|---|
:zone add [NAME] [MIDI] [synth|sample PATH] | Add a new synth or sample zone (auto-picks next free MIDI note if omitted) |
:zone dup [NAME] · :zone del | Duplicate or remove the focused zone |
:zone select NAME|IDX · :zone next|prev | Select the active zone |
:zone sample PATH | Load an audio file into the active zone’s Sampler module (auto-inserting Sampler → Out.In & applying RIFF smpl/inst bounds) |
:zone preset NAME|PATH | Load a single-zone v1 Rack preset into the focused zone |
:zone import DIR | Auto-build a multi-zone Rack from a folder (using RIFF inst & filename MIDI hints) |
:zone name NAME · :zone choke none|1..8 | Rename zone or assign choke group |
:zone range LOW HIGH [ROOT] · :zone vel LOW HIGH | Set MIDI key split (C2 or 36) and velocity layer (0%..100%) |
:zone set FIELD VALUE | Set any zone field (low_midi, root_midi, choke, gain, pan) or module param |
Bounce / Resample to Sampler or Rack Zone (tb / :bounce)
Resample any Part, Pattern, or Arrangement bar range offline at studio quality into your project’s samples/ folder and load it immediately—either as a brand-new Sampler Rack (BounceTarget::NewSampler) or straight into a multi-zone Rack’s active zone (BounceTarget::RackZone):
- Press
tbin Arrange/Pattern to bounce the current selection to a new Sampler Rack, or presstbwhile a multi-zone Instrument Rack deck is focused to bounce directly into its active zone! - Explicit Ex syntax:
:bounce part LeadPart "Lead Resample" --part :bounce bars 1..2 zone TR-808 C3 "Layered Clap"
5. 6-Category Preset Browser (P), External MIT Catalog, File Hub & Bundles
Unified 6-Category Preset Browser (P) with Live Non-Destructive Preview
Press P on any Instrument Rack deck (or run Browse Instrument Presets in the : / Ctrl+Shift+p Action Palette) to explore every sound in your catalog effortlessly:
- 6 Category Filter Tabs: Cycle
All|Synth|Sampler|Drums|Kit|Modularwithh/l,H/L, orTab/Shift-Tab, alongside all 4 neutral bare templates (Init Synth,Blank Sampler,Blank Kit,Blank Modular) plus in-browser Save Preset andRcatalog reload. - Instant Live Preview on Scroll: Moving with
j/k(or↑/↓) swaps the live audio engine to each highlighted Rack non-destructively from a fullProjectsnapshot (so zone modulations, P-locks, and macro bindings are preserved cleanly during preview). - Search, Audition, Commit or Restore: Press
/to filter (Enterlocks filter forj/k,Escclears filter),Ato audition,Spaceto play/pause while scrolling,Enterto commit the chosen preset as a single undoable transaction, orEscto restore your exact original Rack with zero undo entries and unchangeddirty()state.
External MIT v1 PresetCatalog (Zero Compiled-In Patches)
Cadence compiles zero hardcoded sound patches into the binary. All 63 factory presets are editable MIT v1 InstrumentPreset JSON files discovered dynamically on disk:
presets/synth/(11) —acid-303,brass-pad,closed-hat,kick,open-hat,pluck,pulse-lead,reese,snare,sub-bass,warm-padpresets/drums/(46) — standalone analog/FM drum patches (analog-kick,analog-snare,analog-clap,analog-cowbell,analog-rim,analog-tom,fm-hat,fm-cymbal) plus all 38 individual live-synthesizedtr-808-*,tr-909-*, andedm-kit-*drum voices loadable into any single zone or standalone trackpresets/kits/(6) — multi-zonev1Rack kits in both baked-sample (tr-808,tr-909,edm-kit, reproducibly rendered with 1:1 loudness parity fromfactory-sources/{tr-808,tr-909,edm-kit}/project.jsonviacadence --render-kit) and pure live-synthesis (tr-808-synth,tr-909-synth,edm-kit-synth) flavors (see Chapter 8)presets/filter_grooves.json— clean-room MIT factory bank of 24 rhythmic filter grooves (00..=23) across 6 categories (Pulses,Grooves,Syncopation,Swells,32nd Gates,Polyrhythms), extensible up to 128 grooves (00..=127) via user-supplied or saved custom banks in<project_dir>/presets/filter_grooves.jsonor~/.config/cadence/presets/filter_grooves.json
Sample Browser, File Hub & Portable Bundles
- Sample Browser (
B,gS,Ctrl+Shift+b, orEnteronSamplerows): Universal/live filter (Enterlocks filter forj/klist navigation,Ctrl+uclears,Escclears filter then closes), off-thread audition (A), assign (Enter, auto-inserting aSampler → Out.Inmodule if the active zone has none and importing RIFFsmpl/instroot/loop metadata), reload/rescan (r/R). - File Hub (
gf,Ctrl+Shift+f/o/s/e): 4-tab workspace (H/L,Tab/Shift-Tab, or1–4switch between Open/Recent/Examples/Bundles/Takes, Save & Bundle, Import [Preset Library, MIDI profiles & clean-room ReBirth.rbs], and Export Audio [WAV/Stems]). Quick-saving an existing project withCtrl+swrites immediately without opening the dialog. Loading an instrument preset, MIDI profile, or take from File Hub auto-closes File Hub cleanly. Press/to filter,Fin any tab to open a native OS Finder/file dialog, orRon Import to refresh the preset catalog. - Portable Bundles (
:bundle DIR): WritesDIR/project.jsonand copies every audio file referenced by anySamplermodule across every Rack zone intoDIR/samples/with clean relative paths—ready to share or archive anywhere. - Diagnostics & Custom Paths: Run
:assetsto inspect sample readiness and missing files,:reload-samples/:reload-presetsto refresh assets from disk, or open Settings (g,/Ctrl+,) to manage persistentsample_dirsandpreset_dirs(atype path,Fnative folder picker,xdelete,Ctrl+ssave). You can also pass repeatable--sample-dirand--preset-dirflags on the CLI.
Next: Shape, route, and meter your mix in 32-bit float with all 8 native studio effects and the interactive Signal Graph in Chapter 4 · Mixing, Studio FX & Signal Graph.
Chapter 4 · Mixing, Studio FX & Interactive Signal Graph
Previous: Modular Rack Instruments & Assets · Chapter 4 · Next: Project Macros & Modulation
Cadence’s audio engine runs an unclipped 32-bit float signal chain with zero hidden post-master soft-clipping, +6 dB studio console headroom, nested Group → Group DAG routing, 8 zero-allocation native studio effects, and an interactive 5/6-column Signal Graph patchbay.
1. 32-Bit Float Console & Metering (gm / Ctrl+m & go / Ctrl+o)
Press gm (or Ctrl+m, or z4 for the Mix layout) to open the Mixer Console, and go (Ctrl+o) to toggle the bottom Output oscilloscope and peak monitor.
How Metering Works
- Scale &
0 dBHairline: Every strip meters-60..+6 dBFSwith a crisp0 dBhairline reference. - Pre-Fader & Post-Fader: Narrow input bars show pre-fader level feeding your insert chain, alongside wide stereo post-fader peak and peak-hold meters.
HOT (32f)vs.!CLIP: Internal 32-bit float Audio, Group, and Return buses have virtually unlimited transient headroom. When an internal bus crosses0 dBFS(> 1.0), Cadence informs you withHOT (32f)—never silently distorting it. True digital clipping (!CLIP) fires strictly when Master post-fader exceeds1.0(0 dBFS) at the final DAC / 16-bit WAV boundary (or if any non-finite sample occurs anywhere). Clear latched peak/clip indicators withC(selected strip),tC(all strips), or:clips clear [all].- Top-Down Gain Reduction (GR) Micro-Meters: Any channel hosting an active
Compressor(CMP) orLimiter(LIM) displays a live top-down gain-reduction meter directly on its strip.
+6 dB Headroom, Pan Law & Clean Gain Staging
- Channel Fader (
-inf..+6.0 dB): Linear gain spans0.0..=2.0(+6.0 dBboost headroom above unity, with exact0.0 dBunity at the 75% console detent). - Equal-Power Stereo Balance Panning: Stereo mixer channels use unity-normalized equal-power stereo balance (
[1.0, 1.0]exact center pass-through with true analog-console L/R attenuation acrossL100..C..R100), while mono voices use-3.01 dBconstant-power panning. - Three Independent Level Layers: Static channel trim (
:param trim +3dB), automatedChannelGainmodulation (a0..1multiplicative level envelope), and triggered sidechainDuckenvelopes multiply cleanly—pulling down a strip fader preserves every volume ride and sidechain pump without fighting automation.
Mixer Console Keys (gm / Ctrl+m) — Modeless Direct Mixing
Every Mixer strip presents its vertical detail slots below the fader strip in canonical top-to-bottom order: Fader → Pan → Inserts → Sends → Output → Ducks (omitting unfocusable Output on Return/Master). Navigate with h/j/k/l (never mutating audio) and sculpt directly with Alt+h/j/k/l or ,/.!
| Keys | Action |
|---|---|
h/l · H/L (PgUp/PgDn) · 0/$/G | Select channel strip · page strips · jump first / Master |
j/k | Focus vertical slot on the selected strip (Fader, Pan, Insert, Send, Output, Duck) |
Alt+h/l & ,/. (coarse: Alt+H/L & </>) | Directly adjust focused Fader (±0.5 / ±3 dB), Pan (±5% / ±25%), Send level, Duck depth, or cycle Output bus |
Alt+j/k | Push Fader dB up/down vertically · or reorder focused Insert FX up/down |
Alt+Backspace | Reset focused Fader (0.0 dB), Pan (center), or Send to default |
Enter | Open focused Insert FX deck · Output route picker · EditDuck · or exact ValueInput on scalars |
o | Open the full Channel inspector deck (trim, pan, output bus, sends, inserts, ducks) |
a (or f / d) | Contextual Add picker (c Channel / f Effect / w Send / d Duck) |
m / s · b | Mute / solo channel (live flags—never pollute song undo history) · bypass focused Insert (b) |
v · e · r · C | Move Insert to another channel (v) · inspect/bind Macros & Modulations (e) · rename (r) · clear clip (C) |
x / X | Remove focused Insert/Send/Duck (x) · delete channel (X, confirm-guarded) |
Channel / Effect Deck: j/k · w/b · Alt+h/l · ,/. · Alt+j/k · m · v | Walk controls/groups (h/l strictly no-op) · sculpt values directly · reorder Insert (Alt+j/k) · bypass FX (m) · move FX (v) |
2. Nested Group → Group Routing, Sends & Sidechain Ducking
Cadence supports up to 16 Audio, 4 Group, and 4 Return channels plus Master (with up to 4 inserts and 4 sends per channel, 24 total FX devices, and 16 sidechain ducks).
- Nested Group DAGs: Any
AudioorGroupchannel can route into anotherGrouporMaster(validated acyclic at edit time). For example, Iron Circuit routes808 Kit+909 Kit→PercussionGroup →RhythmGroup (alongsideFold Bass) →Master. - Sends & Automated Send Throws: Post-fader sends feed
Returnbuses (Echo,Hall,Dub Tape). You can automate any send amount withModulationTarget::Sendfor dub throws and build swells. - Triggered Sidechain Ducking: Any
Part’s note triggers can duck any target channel (Audio,Group,Return, orMaster) with configurable depth (0%..100%) and exponential recovery time (ms).
Routing & Mixer Ex Commands
:channel audio|group|return NAME # Create a mixer channel
:channel rename OLD NEW # Rename an existing channel
:route "808 Kit" Percussion # Route Audio -> Group
:route Percussion Rhythm # Nested Group -> Group routing
:route-instrument "Acid 303" SynthsCh # Reassign an instrument's Audio channel
:send "Acid 303" "Dub Tape" 35% # Set send amount (or `off` to remove)
:duck "Kick Pump" KickPart Music 65% 180ms # Triggered sidechain duck
:param trim +3dB # Exact fader trim (in focused Channel deck)
:param pan L25 # Exact pan (C, L50, R25%, -0.5..+0.5)
3. All 8 Zero-Allocation Native Studio Effects
Insert any effect with a → f (or f in Mixer/Channel deck), n → f, or :fx <kind> [CHANNEL] (e.g., :fx filter "Gate Pad", :fx limiter Master). Manage inserts with :fx bypass ID_OR_NAME, :fx delete ID_OR_NAME, and :fx move ID_OR_NAME CHANNEL SLOT.
Effect (:fx) | Modes / Architecture | Key Parameters |
|---|---|---|
eq | 4-stage zero-alloc studio EQ with live frequency response plot | hpf (Hz), low (dB), mid (dB), mid_hz (Hz), mid_q (Q), high (dB) |
filter | Stereo resonant multi-mode filter (LowPass, BandPass, HighPass, AcidLowPass, LowPass6) + built-in rhythmic Pattern-Controlled Filter (FilterEnv) | mode, cutoff, resonance, drive, mix, env_pattern (00..=127 bank slots), env_amount (-4..+4 oct), env_decay (15..1500 ms), plus :param source <PATTERN|factory>, P Groove Browser (incl. Save to Bank), f Fork to Pattern |
comp / compressor | Stereo-linked feed-forward soft-knee (6 dB) bus/master compressor + transfer curve & live GR meter | threshold (dB), ratio, attack (ms), release (ms), makeup (dB), mix |
limiter | Stereo-linked lookahead (1.5 ms, full PDC latency compensation) brickwall peak limiter (2 dB soft knee) | ceiling (dB), input_drive (dB), release (ms), mix |
drive | Multi-circuit stereo waveshaper: Tape (warm saturation), HardClip (aggressive diode/fuzz), Fold (West-Coast wavefolder, 2× Halfband2x oversampled) | drive_mode, drive, asymmetry, tone (Hz), output (dB), mix |
chorus | Dual-tap stereo modulated chorus | rate (Hz), depth, width, mix |
delay | Tempo-synced stereo delay (0.5..=32.0 16th-steps) in PingPong or Stereo mode | delay_mode, time (steps), feedback, mix |
reverb | Algorithmic stereo 8×8 Hadamard FDN hall/room reverb | size, decay (s), damping (Hz), predelay (ms), width, mix |
Rhythmic Filter (Pattern-Controlled Filter / PCF)
When env_amount is 0, Filter acts as a clean static/modulated studio filter. Dial env_amount positive or negative (-4.0..=+4.0 octaves) to turn it into a tempo-locked rhythmic filter:
- Extensible Groove Bank (
00..=127, 24 Clean-Room Factory Grooves): Ships with 24 original MIT grooves (00..=23) inpresets/filter_grooves.jsonspanningPulses,Grooves,Syncopation,Swells,32nd Gates, andPolyrhythms(8th, 16th, and 32nd-note resolutions, odd lengths, per-step velocity accents, and snappy vs. smooth wah contours). Drop a custom bank (up to 128 grooves,00..=127) into<project_dir>/presets/filter_grooves.jsonor~/.config/cadence/presets/filter_grooves.jsonto override or extend it; stepping withAlt+h/lor,/.cycles strictly over loaded IDs, and missing IDs degrade gracefully to a neutral 1-step pulse without aliasing. - Filter Groove Browser (
PorEnteronPattern): Open the live Groove Picker from any Filter deck (or Action Palette:Browse Filter Grooves) with/live search, step-bar + coupled-ODE envelope contour preview, non-destructive live audio audition while scrolling, single-undo commit onEnter, zero-trace restore onEsc, and Save-to-Bank (presets/filter_grooves.json) with instant audio-engine reload. - Fork to Pattern (
f): Pressf(or Action Palette:Fork Filter Groove to Pattern) to extract any bank groove into an editable projectPattern(preserving exact step velocities, 8th/16th/32nd resolution, andHold/Rampattack contour) and bindenv_pattern_idin one undoable step. - Bind Any Project Pattern: Inside the Filter deck, cycle
Sourceor run:param source <PATTERN_NAME>to drive the filter envelope directly from anyNotes,Rhythm,Euclidean,Mini, or normalizedValuespattern in your project (:param source factoryreturns to the loaded groove bank).
4. Interactive Signal Graph (gG / Ctrl+g)
Press gG (Ctrl+g) to inspect and patch your entire song as a live, interactive left-to-right DAG:
SOURCES— root literal/mini/Euclidean/value patternsDERIVED— retained pattern-algebra derivationsPARTS— material-to-instrument parts- (Optional
MACROScolumn when Project Macros are configured) INSTRUMENTS— Unified ModularRackinstruments (displayingRACKbadges + zone/module counts like16z/48m)MIXER / FX— Audio, Group, Return, and Master buses plus every insert FX node
Selecting any node illuminates its complete upstream and downstream signal path across all 6 cable types (Pattern, Signal, Routing, Modulation, Macro, Sidechain) and displays live peak/hot/clip telemetry on every audio node.
Direct Undo-Safe Cable Patching in gG
| Key | Action |
|---|---|
h/j/k/l | Move across columns and nodes (0/gg top, G/End bottom of column) |
Enter | Open the selected Pattern, Part, Macro, Instrument, Channel, or Effect deck |
o | Re-route selected Instrument → Audio channel, or Channel/Effect → Group/Master bus |
a (or s / m / d) | Add a connection (or quick-add a Send, Modulation, or Sidechain Duck pre-filled from the selected node) |
e | Edit an attached Send, Modulation, or Duck cable (opens a picker if multiple cables touch the node) |
x / X | Unlink one cable (picker if multiple) / unlink all removable cables on the selected node |
zz | Zoom the Signal Graph full-screen |
Next: Wire multi-target performance Macros and continuous & per-note automation in Chapter 5 · Project Macros & Modulation.
Chapter 5 · Project Macros & Modulation
Previous: Mixing, FX & Signal Graph · Chapter 5 · Next: Audio Devices, Live Recording & Hardware MIDI
Cadence connects sound design and dynamic performance through two complementary modulation layers: 8 Assignable Project Macros (M1–M8) for multi-target song-wide sweeps, and Global Modulations (:mod) & Per-Note P-Locks (:link) for sample-accurate continuous and note-onset automation across every Rack, Zone, Module, Cable, Effect, Send, and Mixer parameter.
1. Project Macros (gk / Ctrl+k, M1–M8)
Press gk (or Ctrl+k, or run :macro) to open the Project Macros Deck. Each project provides 8 assignable macros (M1 through M8) in a single horizontal strip above a scrollable Bindings table, and each macro fans out to up to 16 simultaneous targets across:
- Any Rack bus, Zone, Module, or Patchbay Cable attenuverter parameter (
Rack,Zone,Module,Cable) - Individual multi-zone kit targets (
KIT.ZONE.PARAMorKIT.ZONE.MODULE.PARAM) - Any of the 8 Studio
Effectparameters Channelgain/pan andSendamounts
Each target mapping defines its own min and max normalized range (0.0..=1.0 or 0%..=100%)—displayed inside gk in each target’s native units (Hz, dB, ms, %, pan). Setting min > max (or pressing v on a binding row) creates an inverted sweep (for instance, opening a synth cutoff while pulling a reverb send dry on the same macro turn!).
Macros Deck Controls (gk / Ctrl+k)
| Focus & Keys | Action |
|---|---|
h/l · 1–8 · 0/$/G | Select Macro slot M1–M8 across the horizontal dial strip |
j/k | Move vertically between the Dial header and scrollable Binding rows (never mutates values) |
Dial: Alt+h/l & ,/. (coarse: Alt+H/L & </>) | Nudge macro dial fine (±2%) · coarse (±10%) · Alt+Backspace resets to 0% |
Dial: Enter · a · r · e · x / X | Exact ValueInput (0..1 or 0%..100%) · add binding picker (a) · rename slot (r) · edit/jump driving Modulation (e) · unbind all (x) / clear slot (X) |
Binding: Alt+h/l & ,/. · Alt+H/L & </> | Adjust binding min (±2%) · adjust binding max (±2%) |
Binding: Alt+j/k · Enter · v · x | Reorder binding row · jump to target deck · invert min ↔ max · unbind row |
Anywhere on gk: M / R | Arm 1-key MIDI Learn on the focused slot · toggle live Note+CC/Macro recording |
:macro Ex Commands
:macro 1 name "Acid Squelch"
:macro 1 bind instrument "Acid 303" cutoff 0.18 0.92
:macro 1 bind instrument "Acid 303" c5 0.15 0.95 # Bind a Patchbay cable attenuverter!
:macro 1 bind effect "303 Diode" drive 0.10 0.78
:macro 1 bind send "Acid 303" "Dub Tape" 0.00 0.65
:macro 1 bind channel "Acid 303" pan 0.50 0.75
:macro 1 bind zone TR-808.BD cutoff 0.25 0.90 # Explicit zone syntax
:macro 1 bind TR-808.BD.cutoff 0.25 0.90 # Dotted zone/module shorthand
:macro 2 bind effect "Sky Hall" mix 0.70 0.15 # Inverted range (70% -> 15%)
:macro 1 60% # Set static macro position
:macro 1 unbind 2 # Remove 1-based target #2 (or `all`)
:macro 1 clear # Remove the entire macro slot
Static vs. Automated Macros & Exact Compilation Precedence
You can turn a macro live by hand/MIDI or automate any macro slot over time with a Values pattern (:mod "Squelch Ride" macro 1 SquelchCurve). Both the real-time audio compiler and every live GPU visualizer evaluate controls in this exact deterministic order:
- Static Macros (
M1→M8ascending) — applied to bound targets, skipping any macro slot that has aModulationTarget::Macrodriving it. - Automated Macro Fan-Out (
M1→M8ascending) — fans each automated macro’s live value across every automatable target range. - Direct
Modulation— always overrides Macro fan-out on that specific target parameter.
Multiplicative
ChannelGainRule: DirectModulationTarget::ChannelGaincompiles as a multiplicative scale (0.0..=1.0) on top of the channel’s strip/macro trim—never replacing your mixer fader—so mixing trim adjustments and volume rides always work together cleanly.
2. Global Modulations (:mod) & Per-Note P-Locks (:link)
Global Modulations (:mod or n → y)
Drive any automatable parameter on the song clock using a Values (Hold or Ramp) or SeededValues pattern:
:mod "Lead Sweep" instrument Lead cutoff FilterCurve
:mod "FM Swell" instrument Lead c2 FmCurve # Automate a Patchbay cable attenuverter!
:mod "BD Punch" TR-808.BD.cutoff KickSweep # Dotted zone/module shorthand
:mod "BD Decay" zone TR-808.BD decay KickDecay # Explicit zone form
:mod "Echo Throw" send Lead Echo ThrowCurve # Automated Return send throw
:mod "Dub Ride" channel "Acid 303" send:Echo ThrowCurve # Alternate channel send form
:mod "Auto Pan" channel Chords pan PanLfo
:mod "Filter Lift" macro 1 LiftCurve # Automate Project Macro M1
Note:
:mod add|del|rename ...manages Eurorack modules inside the active Rack zone (see Chapter 3), whereas:mod NAME <target> ...creates a song-level global Modulation.
Per-Note Parameter Links / P-Locks (:link / :unlink)
Attach a normalized Values or SeededValues pattern directly to a Part so each note samples and locks its own parameter value at note onset (using the placement’s own Song/Restart clock!):
:link AcidPart cutoff AccentCurve # Rack module/pin per-note P-lock
:link AcidPart c5 AccentEnvDepth # Per-note P-lock on a Patchbay cable!
:link DrumPart TR-808.OH.decay HatDecayCurve # Per-zone Rack kit P-lock
:link DrumPart OH.decay HatDecayCurve # Short zone form for the part's kit
:unlink AcidPart cutoff
Switch any modulation or P-lock curve between stepped Hold and smooth linear Ramp right in the Pattern deck with m (or :value-mode <PATTERN> hold|ramp|toggle), or bind any Macro or continuous parameter straight to hardware knobs via 1-key MIDI Learn (M) in Chapter 6.
Next: Configure your audio interface, live 24-bit WAV recording, hardware MIDI controllers, and GPU themes/settings in Chapter 6 · Audio Devices, Live Recording & Hardware MIDI.
Chapter 6 · Audio Devices, Live Recording & Hardware MIDI
Previous: Project Macros & Modulation · Chapter 6 · Next: Live Performance & Armed Takes
Cadence puts your audio interface, live 24-bit audio recording, hardware MIDI controllers, and global studio settings inside two dedicated, zero-friction surfaces: the unified Devices (Audio | MIDI) deck (gd / Ctrl+d) and Global Settings (g, / Ctrl+,), both persisted cleanly to your user config.json.
1. Devices · Audio Tab (gd / Ctrl+d / :audio)
Press gd or Ctrl+d (or run :audio to open directly on the Audio tab) to configure hardware audio output, input capture, latency, and engine health without restarting Cadence. Switch between the Audio and MIDI tabs anytime with H/L.
Live Engine Health & Active Stream Panel
The right-hand health panel monitors your real-time audio callback continuously:
ENGINE HEALTH: Live callbackAUDIO CPUload and peak CPU marker, stream status (RUNNING,SILENT,OVERLOADED,FAILED), andXRUNSbuffer overrun counter.ACTIVE STREAM: Active hardware device, sample rate, callback buffer size + exact buffer latency (ms), sample format (32-bit float), and channel count.AUDIO INPUT: Live stereo L/R input peak and peak-hold meters (dBFS),MON/ACTIVE/CLIP/SILENCEindicators, active routing mode, and estimated round-trip latency (ms).
Audio Configuration Rows (j/k navigate · w/b jump groups)
| Group | Row | Values & Behavior |
|---|---|---|
AUDIO INTERFACE | Output | System Default or any detected OS audio output device (Alt+h/l or ,/. cycle; Enter opens device picker; Alt+Backspace resets to System Default). |
Sample Rate | Auto (Device) or discrete 44.1 / 48 / 88.2 / 96 / 176.4 / 192 kHz. | |
Buffer Size | Auto (512 frames release / 1024 debug) or discrete 64 / 128 / 256 / 512 / 1024 / 2048 frames, displaying exact callback latency (ms) and device min/max range. | |
Cue Out | Reserved device selector for a future independent cue bus (Off by default). | |
AUDIO INPUT & RECORDING | Input | None (no OS microphone/input stream opened) or any detected hardware audio input. Changing input settings never interrupts active output playback. |
Input Mode | Channel routing before metering and capture: Stereo (1+2), Mono (Ch 1), or Mono (Ch 2). | |
Input Monitor | Software live monitoring policy: Off (default — prevents speaker/mic feedback loops), Auto (Armed), or On (also cycled globally anytime with ti; lights the top Chrome ● IN MON badge when active). | |
Latency Trim | Manual recording alignment offset (-250.0..=+250.0 ms, Alt+h/l fine ±1 ms, Enter exact ValueInput, Alt+Backspace resets to 0.0 ms) applied on top of measured hardware round-trip buffer latency. | |
ENGINE & RECOVERY | Audio Panic | Immediately silences all ringing voices, synths, and FX tails and clears any overload latch (Enter or :panic / :audio panic). |
Restart Audio | Reopens the active hardware audio stream with your current device settings (Enter or :audio restart). | |
Rescan Devices | Re-enumerates hot-plugged USB/Thunderbolt audio interfaces and MIDI ports (Enter, r, or :audio rescan). |
Press Ctrl+s in Devices to save your Audio & MIDI device preferences to config.json.
Audio CLI Overrides (Per-Session)
Override saved device settings for a single launch without mutating config.json:
cargo run --release -- --project examples/demo/project.json \
--audio-device "Scarlett" \
--buffer-size 256
# Run GUI interactively without opening any OS audio device
cargo run --release -- --project examples/demo/project.json --silent
2. Live 24-Bit WAV Audio Recording (ta / tA / ti / :rec)
Record vocals, hardware synths, guitars, drum machines, or external percussion straight into Cadence as 24-bit stereo WAV files wired automatically into a portable Sampler Rack instrument, Part, and Arrangement placement:
- Select & check your input in
Devices · Audio(Ctrl+d/:audio): Pick yourInputdevice andInput Mode(Stereo (1+2)/Mono (Ch 1)/Mono (Ch 2)), watch the live stereo input meters to set clean preamp gain without clipping, and adjustLatency Trimif needed. If your hardware input and output run at different sample rates, Cadence converts the stream automatically. - Monitor safely (
ti): Presstifrom any deck (or run:rec monitor off|auto|on) to cycle live input monitoring (Offby default to prevent acoustic feedback). - Record immediately (
ta) or open the Record Audio dialog (tA):tastarts/stops capture immediately using your current recording settings (:rec,:rec start [NAME],:rec stop,:rec cancel).tA(or:rec dialog) opens the Record Audio workflow dialog to choose:- Timing mode:
Synced(quantized bar-aligned punch-in/out),CountIn(bar pre-roll before punch-in), orFree(unquantized start/stop). - Length: Fixed bar count (
1..=64bars via:rec bars <1..=64> [NAME]) or manual stop. - Destination: A brand-new
SamplerRack (with Part + Placement on the arrangement) or directly into an existing multi-zone Rack slot (:rec zone ...).
- Timing mode:
- Latency-trimmed portable commit: Stopping capture waits for the lock-free post-roll compensation tail, trims round-trip latency, writes a clean 24-bit WAV under
<project>/recordings/(or your session recordings directory for untitled projects), reloads the sample bank, and commits the Sampler Rack + Part + Placement as a single undoable transaction (uundoes cleanly).
3. Devices · MIDI Tab (H/L, M, R)
Cadence treats hardware MIDI controllers as first-class instruments—with hot-plugging, 1-key MIDI Learn, live Note+CC recording, soft-pickup takeover, Focused Smart Macros, and bi-directional LED/OLED feedback.
cargo run --release -- --list-midi
cargo run --release -- --project examples/demo/project.json \
--midi-in "MiniLab" --midi-out "MiniLab"
The MIDI tab presents Performance Pads (live RGB mirrors), Project + Smart Macros (Knobs 1–8), vertical DEVICE & PROFILE rows (IN, OUT, Profile, Pads, Pickup) above MAPPINGS, and a LIVE MIDI MONITOR log on the right:
Keys in Devices · MIDI | Ex Command | Action |
|---|---|---|
H/L | :audio / :midi | Switch between Audio and MIDI tabs |
j/k · w/b | — | Move vertically across DEVICE & PROFILE (IN, OUT, Profile, Pads, Pickup) and MAPPINGS |
Alt+h/l & ,/. | :midi profile|pads|pickup ... | Cycle active port, profile (generic / standard_cc / minilab3_daw), pad mode (notes / sections / mutes), soft pickup, or mapping value mode (Abs, Rel±, Rel64, Trig, Tog, Mom) |
Enter / M | :midi learn | Open port/profile picker, toggle Pickup, or arm/re-learn selected mapping |
a · v · r | :midi rescan | Add mapping (a) · toggle invert (v) · rescan OS MIDI ports (r) |
x / X | :midi unlearn / :midi clear | Delete focused user mapping (x) · clear all user mappings (X, confirm-guarded) |
R | :midi rec | Arm/disarm live MIDI Note, Chord & CC automation recording |
Ctrl+s | — | Persist Audio & MIDI ports, profile, pad mode, pickup, and learned mappings to config.json |
1-Key MIDI Learn (M) & Unlearn (M then x)
From anywhere in Cadence, focus a target and press M:
- Focused control inside an Instrument Rack (
Panel,Patchbaycable attenuverter, orZones), Effect, or Channel deck - Focused slot
M1–M8inside Project Macros (gk) - Selected channel strip inside Mixer (
gm) - Selected part cell inside Bank Launchpad (
gb)
Cadence arms Learn (and displays MIDI LEARN on hardware OLEDs). Move any CC knob, fader, Pitch Bend, or Note pad to bind it immediately and save it globally. Press M then x to unlearn the focused target, or Esc to cancel.
Live MIDI Note, Chord & CC Automation Recording (R)
Press R (or :midi rec, or your hardware Record MMC button) to arm recording:
- While Stopped (Step Entry): Play single notes or polyphonic chords (up to 6 tones) on your MIDI keyboard to write directly into the selected literal
Notespattern and advance step-by-step. - While Playing (
REC · NOTE+CC):- Notes and chords overdub quantized onto the playing pattern.
- Twisting any mapped hardware CC, Pitch Bend, or Project Macro knob automatically records smooth
Rampautomation points into aValuesmodulation lane (lazily creating the pattern andModulationif none exists) with 1.5-second gesture undo coalescing—so one knob sweep undoes cleanly with a singleu.
Built-In Device Profiles, Smart Macros & Bi-Directional Feedback
- Universal MMC Transport: Standard MIDI Machine Control SysEx (Play, Stop, Pause, Record) works on every controller out of the box—even on the blank
Generic MIDIprofile. - Focused Smart Macros 1–8: Profiles map 8 encoders to
FocusedMacro 0..7, which automatically follow whichever Instrument, Effect, or Channel deck you focus (and control Project MacrosM1–M8when outside an object deck). - 3 Built-In Profiles (export/customize any profile with
:midi profile-save my-ctrl.jsonand:midi profile-load my-ctrl.json):Generic MIDI(generic): Clean MIDI Learn canvas + MMC +StandardCcNotefeedback.Standard CC(standard_cc): Knobs CC 74/71/72/93/73/75/79/78 → Focused Macros 1–8; Faders CC 22–25 → Lanes 1–3 + Master; CCs 105–109 → Loop/Stop/Play/Rec/Tap.Arturia MiniLab 3 (DAW)(minilab3_daw): Switch the MiniLab 3 to DAW mode (Shift+Pad 3) for instant 8-knob Focused Macros, 4 channel/master faders, endless main-encoder scroll/click, Shift+Pads 4–8 transport, 2-line OLED feedback (live parameter names, native units, value bars, Learn/Rec banners), and RGB pad & transport LED feedback viaArturiaDawSysEx.
4. Global Settings & GPU Themes (g, / Ctrl+,)
Press g, (or Ctrl+,, or run :settings) to open Settings & Live Timing. Navigate rows with j/k (w/b jump groups), adjust directly with Alt+h/l or ,/., press Enter for exact values or toggles, Alt+Backspace to reset a row, r to restore defaults, and Ctrl+s to write your user config.json.
Built-In Semantic GPU Themes
Switch GPU Theme live with zero restart—every deck, Bezier cable, 32-bit float meter, oscilloscope, visualizer, and HUD updates on the very next frame (zero hardcoded colors exist outside the theme palette):
Cadence Dark(default) — balanced charcoal studio canvas with high-contrast cyan, amber, and violet accents for extended sessions.Midnight Neon(shown above) — deep obsidian background with luminous neon-cyan, electric-magenta, and acid-green highlights tailored for dark stages and live clubs.Studio Light(see Chapter 1) — crisp daylight workstation theme engineered for sunlit studios and projectors.
Complete Settings Reference
| Group | Settings | Notes |
|---|---|---|
APPEARANCE | GPU Theme | Cadence Dark · Midnight Neon · Studio Light |
WORKSPACE | Startup Layout · Output Monitor · Contextual Key Hints | Default launch layout (z1–z4), visibility of the 32-bit float Output strip (go), and footer key-hint bar |
TRANSPORT | Viewport Follow · Auto-Record Takes | Default follow mode (tf); opt-in automatic take arming on Space (default Off so everyday playback stays lean; tr toggles live) |
NEW PROJECT | Default Tempo · Default Key · Default Scale | Starting BPM (20–300), root note (C1–C6), and scale (all 13 named scales) for new blank projects |
LIVE TIMING (PROJECT) | Launch Quantize · Live Edit Timing · Late Tolerance | Project-level launch boundary (c picks a Cycle pattern), immediate vs. quantized live edits (tE), and 0–4 step late-hit grace window |
ASSET DIRECTORIES | Sample Directories (sample_dirs) · Preset Directories (preset_dirs) | Persistent library roots across sessions: a/Enter types a path, F opens a native OS folder picker, x removes a directory, and saving automatically rescans the Sample Browser and Preset Catalog |
Next: Jam over your arrangement, stage multi-lane drops, commit live improvisations, and work with explicitly armed crash-safe Takes in Chapter 7 · Live Performance & Armed Takes.
Chapter 7 · Live Performance & Armed Takes
Previous: Audio Devices, Live Recording & Hardware MIDI · Chapter 7 · Next: CLI, Headless Rendering, Formats & Live
--ctl
Cadence lets you trace every evaluated note back to its musical source, jam over your arrangement without losing your song structure, stage synchronized multi-lane transitions, commit live improvisations back into the score atomically, and arm a crash-safe Take journal (tr) whenever you want to capture a set. (For live 24-bit WAV audio input recording via ta / tA / ti, see Chapter 6 · Audio Devices, Live Recording & Hardware MIDI.)
1. Evaluated Arrange Views, Placement Editing & Event Provenance (vp / vo / vr)
Inside the Arrange deck (ga / Ctrl+a), navigate lanes and bars with h/j/k/l (H/L or w/b jump sections), manipulate placements directly in vp (Alt+h/l move start ±4 steps, Alt+H/L ±16, Alt+j/k move placement across lanes, ,/. shrink/extend length ±4 steps, </> ±16, d duplicate, x release override else delete, Enter open detail), and press v to switch views (or run :arrange placements|overview|roll):
| Keys | View | Purpose |
|---|---|---|
vp | Placements | Bar-level placement blocks and named timeline sections (n → t add, r edit, X delete, Alt+hjkl / ,/. move & resize placements). |
vo | Evaluated Overview | Multi-lane note overview evaluated directly from live patterns and derivations—zero extra material created. |
vr | Lane Roll | Full-height pitch roll of the selected lane’s evaluated notes. |
Event Provenance (Enter in vo / vr)
In Evaluated Overview or Lane Roll, jump from note to note with w/b (sections with H/L, pages with PgUp/PgDn), then press Enter (or :inspect-event) to open Event Provenance:
- Shows the exact derivation tree and pattern times that produced that note (e.g.,
Motif+Harmony→Moving→LeadPartat bar 12, step 5). j/k: step through upstream sources ·s/Enter: jump straight into that source pattern ·o: open a placement-local exception (:local) at that occurrence ·i: open the note’s instrument.
2. Performing Over the Arrangement
Your arrangement plays linearly (or loops a section/region) on a single performance clock. Launching a part on a lane creates a live override over that lane—everything else keeps playing the arrangement, and releasing the lane hands control right back to the arranged song.
Row-Oriented Bank Launchpad (gb / Ctrl+b)
Press gb (Ctrl+b) to focus the Bank deck (v toggles between Parts Launchpad and Material Library; press zz to expand full-screen). Lanes run vertically as rows (j/k) and each lane’s launchable parts run horizontally left-to-right (h/l) in both docked and zoomed views—matching Arrange with zero axis flip. Populate any lane’s launchable parts with a or :lane LANE add PART [song|restart] [OFFSET] (and remove with X or :lane LANE drop PART):
Keys in gb (Parts) | Action |
|---|---|
j/k · h/l · 0/$/G | Select lane (rows) and part card (columns) · jump first/last lane |
Enter (or Shift+Enter) | Launch selected part as a live override on the next quantization boundary (Shift+Enter immediate at now) |
A | Audition part pattern |
a / r | Add Part to lane / edit launch phase & offset |
x / X | Release lane override back to the arrangement / drop Part from lane |
m / s | Toggle lane mute / solo (queued on the launch boundary while playing) |
zz | Toggle full-screen Launchpad Matrix |
Modal Jam Mode (gj / Ctrl+Shift+j) & the Universal Alt Layer
Press gj or Ctrl+Shift+j to toggle modal Jam Mode—framed by a glowing electric violet deck border and floating performance HUD (Esc or Ctrl+Shift+j leaves Jam and releases held notes).
1–0(number row): Jump to Sections 1–10 in the current bank (looping the section automatically if loop is enabled!).q w e r t y u i o p(lane row): Open a Lane Layer for Lanes 1–10:- Press
1–9to launch that lane’s part override (re-launching the active part restarts it). - Press the same lane key again to toggle the lane override on/off.
- Press
Alt+xto release,Alt+cto keep, or any other key to close the layer and act immediately.
- Press
z s x d c v g b h n j m ,(bottom two rows): 13-key chromatic piano playing the focused lane’s instrument (Shiftaccents to1.0velocity;</>shifts octave0..8).Tab/Shift-Tab: Page between 10-lane / 10-section banks when a project has more than 10 lanes or sections.Spaceplay/pause ·\toggle loop ·Backspacecancel last queued launch/jump ·Enterfire staged scene ·:/Ctrl+Shift+pAction Palette or?Help without leaving Jam.
Universal Alt Layer: Jam is simply the Alt performance layer locked on. From any deck or mode, you always have instant performance access (while Alt+h/j/k/l handles direct 2D manipulation):
| Chord | Action |
|---|---|
Alt+1..Alt+0 | Jump to Section 1–10 |
Alt+q..Alt+p | Open Lane 1–10 layer (1–9 launch, repeat key toggle) |
Alt+m / Alt+s | Mute / solo focused lane (or selected channel in Mixer) |
Alt+M / Alt+S | Unmute all lanes / clear all lane solos |
Alt+x / Alt+X | Release focused lane override / release all overrides |
Alt+c / Alt+C | Commit / Keep focused lane override (or Take selection) / Keep all active overrides |
Alt+Enter | Start staging / open finish prompt / fire staged changes |
3. Quantization Boundaries, Late Tolerance & Live Staging
Boundaries & Live Timing
Every launch, release, section jump, and lane mute/solo lands cleanly on your chosen launch boundary:
- Standard grid:
now,beat,bar,N bars(2 bars,4 bars,8 bars, …) - Polymetric cycle:
cycle PATTERN— waits for a specific pattern (even a 5-step or 40-step cycle!) to finish its pass cleanly.
Configure boundaries with tq (cycle choices), tQ (pick any project pattern for Cycle), tE (toggle whether live edits land Now or follow the launch boundary), inside Song Properties (gP) or Settings (g,), or via Ex commands:
:quantize bar # Launch on bar boundaries
:quantize 2 bars # Launch every 2 bars
:quantize cycle "Harmonic Current" # Land on a polymetric pattern's exact cycle boundary
:quantize edits launch # Queue live pattern edits onto the launch boundary
:tolerance 2 # 2-step late-hit grace window (0..4 steps)
:launch Drums 2 at bar # Explicit one-off launch override (:launch LANE [PART] [at BOUNDARY])
:release Drums at bar # Release one lane (or `:release all`)
:cancel [all] # Cancel last (or all) pending launches/jumps
Late tolerance (:tolerance STEPS): If you hit a launch key a sixteenth-note after a downbeat, Cadence snaps it gracefully within the tolerance window so your groove never misses an entire 4-bar cycle over a few milliseconds of human timing.
Live Staging (S or Alt+Enter)
Need to launch three new parts, mute the kick, and jump to the Chorus all on the exact same downbeat?
- Press
S(orAlt+Enter, or:stage) to enter Staging. - Queue any combination of lane launches, releases, mutes, solos, and a section jump—nothing fires yet (
uunstages the last gesture). - Press
Sagain (orAlt+Enter→Enter/S, or:stage fire) to fire every staged change atomically on one boundary (Escor:stage discardcancels).
4. Growing Keep, Atomic Keep & ' “From Here”
When a live jam clicks, turn it straight into permanent arrangement structure without stopping playback:
- Growing Keep (
Alt+c): Keeps the focused lane’s active override. In Song mode, Cadence writes a placement starting where the override landed and grows it bar-by-bar with the playhead as a single coalesced undo entry until you release the lane or stop playback (inside a loop region, it commits across the loop span). - Atomic Keep (
Alt+Cor:keep): Writes every currently active lane override into the arrangement in one undoable transaction. '(“From here” scoped fork): Arm'right before making a pattern edit during a live set—your edit forks the pattern and dependent parts from the next quantized bar onward, leaving everything earlier in the song completely untouched.
5. Explicit Take Arming (tr) & Crash-Safe Take Deck (gt / Ctrl+t)
Take recording is explicitly armed by default (OFF on launch) so everyday playback never fills session storage with throwaway takes. Press tr (or run Arm Take Recording in the Action Palette / :take arm) whenever you are ready to capture a live performance—the top Chrome bar displays an amber TAKE ARM pill while stopped and switches to a glowing red ● REC TAKE (N) pill (or ● TAKE CAPPED if the in-memory cap is reached) as playback streams every landed launch, section jump, flag change, and live edit safely off-thread to <session_dir>/takes/ as compact v1 JSONL.
Prefer always-on capture? Open Settings (
g,) and turn onAuto-Record Takes(UserConfig::auto_record_takes = true) to auto-arm take recording whenever you pressSpace(see Chapter 6).
Press gt (Ctrl+t) to open the Take Deck below Arrange (or zz to zoom full-screen):
Keys in gt | Ex Command | Action |
|---|---|---|
tr | :take arm|disarm|toggle | Arm or disarm live Take recording |
h/l · 0/$/G | — | Scrub across recorded bars |
v (then h/l · v) · x / Esc | — | Visual range mark: anchor start bar, extend with h/l, press v again to lock range · x / Esc clears marks |
Enter or Alt+c | :keep START_BAR END_BAR | Keep the marked bar range into your arrangement (auto-forking any patterns edited mid-take!) |
Ctrl+s | :take save [NAME|PATH] | Save a permanent portable .take.jsonl into your project’s takes/ folder |
X | :take discard | Discard the active unsaved take (confirmation-guarded via Mode::Confirm when events exist) |
| — | :take load PATH.take.jsonl | Reload any saved .take.jsonl into the Take Deck to inspect, keep, or export |
Deterministic Offline Take Rendering
Because a Take stores exact musical transitions rather than raw audio, you can replay and render any saved .take.jsonl offline with sample-accurate determinism:
cargo run --release -- \
--project examples/fivefold-live/project.json \
--take examples/fivefold-live/takes/set.take.jsonl \
--take-tail-bars 2 \
--render fivefold-set.wav
Explore Fivefold Live (examples/fivefold-live/perform.keys.jsonl) for a complete scripted performance set and replayable take.
Next: Automate builds, render WAVs & stems, import ReBirth
.rbssongs, bake factory kits, and control a running GUI session live over--ctlin Chapter 8 · CLI, Headless Rendering, Formats & Live--ctl.
Chapter 8 · CLI, Headless Rendering, Formats & Live --ctl
Previous: Live Performance & Armed Takes · Chapter 8 · Guide Home
Everything you can do interactively in Cadence can also be validated, rendered, imported, scripted, or driven live from external tools and AI co-producers via the CLI and Unix control socket (--ctl).
1. Offline Verification, Audio Export & Recovery
All offline commands run headless with zero GUI window or audio device required:
# Validate schema, derivations, and sample readiness (prints JSON summary)
cargo run --release -- --project examples/demo/project.json --check
# Render stereo 16-bit WAV + JSON overload/RMS/tail report
cargo run --release -- --project examples/demo/project.json \
--render afterglow.wav \
--render-report afterglow-report.json \
--sample-rate 48000
# Render Master + isolated per-channel stereo WAV stems (optional --bars limit)
cargo run --release -- --project examples/iron-circuit/project.json \
--stems ./stems/iron-circuit --bars 16 --sample-rate 48000
# Render a saved live performance take offline (with 2-bar reverb/delay tail)
cargo run --release -- --project examples/fivefold-live/project.json \
--take examples/fivefold-live/takes/set.take.jsonl \
--take-tail-bars 2 --render fivefold.wav
# Export the built-in Afterglow demo as a standalone JSON project
cargo run --release -- --write-demo my-demo.json
# Restore unsaved edits from a crash-recovery snapshot (never overwrites disk until you save)
cargo run --release -- --project my-song.json --recover
Useful Session, Audio & Discovery Flags
--silent: run interactively without opening an OS audio output device.--audio-device NAME: preferred live audio output device name (substring match; overridesconfig.jsonfor this session).--buffer-size FRAMES: preferred live audio callback buffer size (32..=8192frames; overridesconfig.jsonfor this session).--sample-dir DIR/--preset-dir DIR: repeatable extra search roots (--sample-roots-onlyrestricts Sample Browser discovery to explicit--sample-dirroots).--session-dir DIR: override the per-project session directory (instance lock,recovery.json, armedtakes/, defaultctl.sock).--list-midi,--midi-in [PORT],--midi-out [PORT]: inspect or connect hardware MIDI ports at launch.
2. Clean-Room Formats Crate & ReBirth RB-338 .rbs Import (crates/formats)
Third-party song format importers live in the dedicated, feature-gated cadence-formats crate (crates/formats/), keeping cadence-core and cadence-engine free of external format parsers. It houses Cadence’s clean-room MIT parser and converter for classic ReBirth RB-338 .rbs songs behind feature = "rbs" (enabled by default in the root cadence binary)—supporting both ReBirth 1.x (MThd SMF with 7-bit-packed TinY SysEx: 2× TB-303 + TR-808) and ReBirth 2.0 (CAT RB40 IFF, file versions 4.0, 4.1, and 4.2, adding TR-909):
# Open a ReBirth .rbs song directly in the GUI (or convert headless with --output)
cargo run --release -- --import-rbs classic-acid.rbs
cargo run --release -- --import-rbs classic-acid.rbs --output classic-acid.cadence.json
cargo run --release -- --import-rbs classic-acid.rbs --render classic-acid.wav
# Passing an .rbs file to --project also auto-imports it cleanly
cargo run --release -- --project classic-acid.rbs
Inside the GUI, use :import-rbs PATH (or open File Hub gf → Import tab). The importer translates 303 patterns (6-module AcidLowPass Racks with filter_vel_amount accent, slide, deduplicated transposed parts), TR-808/TR-909 multi-zone Rack kits, Synths/Drums Groups, Echo Return + automated Send, Drive, Pattern Controlled Filter (PCF), Compressor, Global Shuffle (Swing), Song Mode sections, and live knob/mixer automation into an editable native Cadence project with calibrated mix headroom.
3. Provenance Factory Kit Builder (--render-kit)
Build portable, 100% MIT multi-zone Rack drum kits deterministically from pure-synthesis source projects (factory-sources/{tr-808,tr-909,edm-kit}/project.json) with 1:1 baked-vs-synth loudness parity:
cargo run --release -- \
--render-kit factory-sources/tr-808/project.json \
--out-samples factory-samples/tr-808 \
--out-preset presets/kits/tr-808.json \
--out-synth-preset presets/kits/tr-808-synth.json \
--out-voices-dir presets/drums \
--kit-name "TR-808" \
--sample-rate 48000
Each Audio channel in the source project is rendered, trimmed cleanly, measured (duration, peak, DC offset), written as a WAV with embedded RIFF inst + smpl metadata into --out-samples, and wired into a ready-to-load v1 InstrumentPreset JSON (category: "Kit", 1-based RackZone pads with [Sampler -> Out]) at --out-preset. Passing optional --out-synth-preset also writes the matching pure live-synthesis multi-zone Rack kit, and --out-voices-dir exports each individual drum voice as a standalone 1-zone preset.
4. Reproducible Automation: --key-script, --script & --stdio
Key Scripts (--key-script FILE.keys.jsonl)
Replay real keyboard sessions directly through the pure cadence-app controller, advance the headless performance clock, and assert exact project/mode invariants (including JSON Pointer assertions like "/bpm": 132.0):
{"label": "Enter Jam and play", "keys": "gj ", "expect": {"mode": "JAM", "playing": true}}
{"label": "Jump to section 2 after 4 bars", "keys": "2", "advance": "4 bars", "expect": {"step": 64}}
Note that : (and Ctrl+Shift+p) opens the Fuzzy Action Palette (PALETTE), which automatically surfaces any recognized Ex command line as its top ▶ Run command: passthrough slot—so :bpm 132<Enter> or :derive ...<Enter> key scripts execute deterministically alongside interactive deck workflows (NORMAL, STEP INSERT, JAM, PRESETS, SONG PROPS, MINI EDITOR, VALUE ENTRY).
Supported special key tokens include <Tab>, <s-tab>, <Enter>, <Esc>, <Home>, <End>, <Space>, <bs>, <up>/<down>/<left>/<right>, <pgup>/<pgdn>, <lt>/<gt>, <c-x> (Ctrl+x), <c-s-x> (Ctrl+Shift+x), <m-x> / <m-X> (Alt+x / Alt+Shift+x), and <m-enter>.
cargo run --release -- --empty \
--key-script examples/material-lab/build.keys.jsonl \
--check --output built-garden.json
Typed JSONL Protocol (--script & --stdio)
Both batch --script and interactive headless --stdio speak Cadence’s unified newline-delimited HostRequest JSON protocol (id, expected_revision, compact, action, cmd, meters, listen):
# Batch-apply typed actions from examples/agent-session/session.jsonl and render
cargo run --release -- --empty \
--script examples/agent-session/session.jsonl \
--output session.json --render session.wav
# Run a live headless engine over stdin/stdout (transport ticks every ~16 ms while idle)
cargo run --release -- --empty --stdio
See Agent Session (examples/agent-session/session.jsonl) and the Protocols Spec for the complete Action and HostRequest schema.
5. Live GUI Control Socket (--ctl & cadence ctl)
Co-produce live alongside a script, terminal, or AI agent while watching and hearing Cadence’s real GPU window update in real time! Every edit sent over --ctl passes through the exact same Document pipeline and lands cleanly on your u undo stack.
1. Launch Cadence with --ctl
# Bind at default <session_dir>/ctl.sock (auto-falls back to a short $TMPDIR path on macOS/Unix if >96 bytes)
cargo run --release -- --project examples/demo/project.json --ctl
# Or bind an explicit socket path
cargo run --release -- --project examples/demo/project.json --ctl /tmp/cadence.sock
The control socket is created with strict 0o600 (owner-only) permissions, checks for live listeners before replacing stale files, wakes the GUI event loop immediately on incoming requests, and cleans up both the socket file and temporary ear.wav on exit.
2. Drive & Audition the Live Session with cadence ctl
cadence ctl auto-discovers --sock PATH, --session-dir DIR, CADENCE_CTL_SOCK, or the most recently active session socket:
| Subcommand | Description |
|---|---|
cadence ctl state [--compact] | Fetch live session state, transport position, revision, and (without --compact) full project JSON. |
cadence ctl meters | Fetch live 32-bit float channel input/output peaks, peak holds, hot/clipped flags, and Compressor/Limiter gain-reduction meters. |
cadence ctl cmd "<LINE>" [--expected-revision N] [--compact] | Execute any Cadence Ex command line on the live GUI session (pushed onto u undo stack). |
cadence ctl action '<JSON>' [--expected-revision N] [--compact] | Execute any typed cadence_app::Action JSON object with optional optimistic-concurrency revision checking. |
cadence ctl listen --bars A..B [--solo CH,...] [--sr 24000] [--out WAV] | Render an exact 1-based half-open A..B (or inclusive A..=B) bar window from live in-memory state (temporary --solo never alters GUI flags) with peak/RMS/clip telemetry. |
cadence ctl listen --live SECS [--sr 24000] [--out WAV] | Capture 0.25..=30.0 seconds of live speaker output from the lock-free audio tap ring on a background thread so live Jam/MIDI/GPU rendering never stalls. |
Example Live Co-Production Loop
# 1. Inspect current revision & compact telemetry
cadence ctl state --compact
# 2. Mutate the live project cleanly (guarded by expected revision)
cadence ctl cmd "bpm 132" --expected-revision 4 --compact
cadence ctl cmd "macro 1 75%" --compact
cadence ctl action '{"op":"play","playing":true}' --compact
# 3. Check live 32-bit float headroom & bus compression
cadence ctl meters
# 4. Audition bars 17..21 with temporary solo on Drums + Bass (without mutating GUI solo flags!)
cadence ctl listen --bars 17..21 --solo Drums,Bass --out /tmp/drop-check.wav
# 5. Or tap 4 seconds of whatever is currently playing live out of the speakers
cadence ctl listen --live 4.0 --out /tmp/live-tap.wav
Go deeper: Read the Specifications (Material & Timing, DSP & Audio Engine, Protocols), Design Decisions, and Verification Suite, or return to the User Guide Home.
GPU Presentation, Modeless Keymap & Deck Contract
This specification defines the strict purity boundary between cadence-app and cadence-gui, the GPU display-list and semantic theming pipeline, the unified modeless keyboard grammar and global modifier boundaries, the six visual-axis deck alignments, all workspace decks and modal overlays, live 24-bit audio recording, and the hardware MIDI contract.
Related specifications: Material & Timing · DSP & Audio Engine · Protocols & Persistence · User Guide
1. Pure Controller (cadence-app) & HostIo Boundary
cadence-app owns all session state, keyboard routing, undo history (HISTORY_LIMIT = 128), navigation trail (capped at 32), drafts, commands, device/recording state, MIDI dispatch, and semantic view projection with zero audio, MIDI, GPU, or direct OS filesystem dependencies:
- Minimal pure
Cargo.tomlcontract (crates/app/Cargo.toml): Depends strictly onanyhow,cadence-core,cadence-formats(feature-gatedrbs),serde, andserde_json(plushoundandtempfilefor dev tests). Directstd::fs,std::env, orFile::calls insidecrates/app/src/are forbidden and verified by integration tests. HostIoabstraction (crates/app/src/host_io.rs): All path queries, bounded reads, bounded directory scans, atomic writes,UserConfigpersistence,PresetCatalog/SampleLibrarydiscovery, filter groove loading, portable bundle export, sample decoding, and take-journal sinks route throughArc<dyn HostIo>.CoreHostIodelegates tocadence-core::storein production binaries.MemoryHostIoprovides a 100% pure in-memory virtual filesystem andMemoryJournalSinkfor deterministic, disk-free testing.
- Pure
Outcomeintents: Mutating operations (App::apply,App::handle_key,App::handle_midi) return anOutcomevalue describing required host side effects (changed,samples_changed,project_boundary,transport,live_notes_on/off,rack_audition,audition_instrument,preview_sample,clear_mixer_meters,audio_device,audio_record,export,bounce,inspection,midi_feedback,midi_connect,file_dialog,quit). - Single-point parameter & visual math:
- All
ParamAddress(Rack,Zone,Module,Cable,Channel,Send,Effect) resolution, parsing, formatting, and nudging routes throughcrates/app/src/param_ops.rscomposingcadence_core::rack::*andcadence_core::dsp::*. - All live modulated parameter and Macro values across every deck resolve through
crates/app/src/view/live_params.rs, mirroring the exact 3-tier compiler precedence (Static Macro → Automated Macro → Direct Modulation) at smooth sub-steplive_query_time.
- All
2. GPU Presentation Pipeline (FrameView → DisplayList → wgpu)
Semantic View Projection (crates/app/src/view/mod.rs)
App::frame_view(&self, snapshot: &AudioSnapshot, audio_status: &str) -> FrameView produces an immutable, frontend-neutral snapshot of the frame:
FrameView
├── chrome: ChromeView (theme, title, dirty, transport, tempo/key, live timing,
│ take_armed/take_recording/take_capped, audio_recording,
│ overrides/pending/staged, MIDI/Macro badges, peak L/R,
│ master_hot/clipped, mode_name, mode_kind, pending_key_count,
│ hints, status, trail)
├── zoomed: bool
├── focused: Spot
├── decks: Vec<DeckSlot> (ordered visible decks with DeckView payload)
├── jam_hud: Option<JamHudView>
├── lane_layer: Option<LaneLayerView>
└── overlay: Option<OverlayView>
Ordered DisplayList, App Icon & WGSL Pipelines (crates/gui/src/{display.rs,gpu/mod.rs,icon.rs})
cadence-gui transforms (&FrameView, &Theme) into a logical-pixel DisplayList (scaled seamlessly to physical pixels on upload), split into base: DisplayLayer (decks & chrome) and overlay: DisplayLayer (modal overlays strictly above base text):
- Single ordered painter’s pass: Both
QuadInstances (rounded/gradient/bordered/hatched SDF rectangles) andCurveVertexgeometry (anti-aliased waveforms, filter/EQ frequency curves, Bezier Signal Graph & Patchbay cables, filled ADSR/Hold-Decay/reverb envelopes) emit into oneVec<DrawCmd>(DrawCmd::Quads(DrawBatch)|DrawCmd::Curves(DrawBatch)), coalescing adjacent same-kind, same-clip batches while preserving exact back-to-front draw order. - Shared multi-column cable-graph SPOT (
crates/gui/src/decks/cable_graph.rs): One reusable renderer powers both the Project Signal Graph (gG,decks/graph.rs) and the Eurorack Instrument DeckPatchbaytab (decks/instrument/), sharing column layout, node cards, arc-length-dashed feedback Bezier curves (flagged with ASCII"z-1"for JetBrains Mono glyph compatibility), selected-cable halos/ringed jacks, collision-free midpoint pill badges, and upstream/downstream path illumination. - Balanced scissor clipping: Every container clip pairs
push_clip(rect)withpop_clip();begin_overlay()resets the clip stack to the full viewport. - Embedded cross-platform app icon (
crates/gui/src/icon.rs): Embeds the canonical 256×256 PNG derived fromassets/icons/cadence.svg, attachingwinit::window::Icon(+ Windows taskbar icon) on window creation and setting macOSNSApplication::setApplicationIconImageon startup so unbundled terminal runs show the Cadence Dock/Cmd-Tab icon. - 3-stage
wgpu+glyphonrenderer (Rgba16FloatHDR target):- Main + Selective Emissive MRT pass:
sdf_quad.wgsl+scope.wgslwrite both main color and selective emissive channels (playhead, active notes, focused/active deck borders, scopes, clip indicators). - Half-resolution separable Gaussian bloom:
bloom.wgslapplies a 2-pass phosphor bloom scaled bytheme.glow.bloom_strength. - Additive composite + hermetic HiDPI typography:
glyphoncomposites razor-sharp text via a hermeticFontSystem(create_embedded_font_system) backed exclusively by the 2 embeddedJetBrains Monofaces—Regular (weight 400) and Bold (weight 700)—with zero OS font scanning or proportional fallback, programming ligatures disabled (calt/liga/clig/dligviano_ligatures_features(), ensuring hints like-/=,!=,->, and</>always shape as literal separate monospace glyphs), and a generation-sweptTextBufferCache(TEXT_CACHE_EVICT_AGE = 120,TEXT_CACHE_TRIM_INTERVAL = 60,TEXT_CACHE_SOFT_CAP = 2048).
- Main + Selective Emissive MRT pass:
Semantic Theme System (crates/gui/src/{theme.rs,chrome.rs})
Zero hardcoded hex/RGBA colors are permitted outside crates/gui/src/theme.rs. Every deck, chrome bar, visualizer, and overlay queries &Theme:
- Token groups:
SurfaceTokens,BorderTokens,TextTokens,AccentTokens(focus,edit,jam,routing,playhead,warning_key,modulation,alert,override_bar,audition),MeterTokens(low,mid,high,hot,clip,pre_fader,zero_db,gr,track_bg,hold_tick),tracks: [Color; 8],RadiusTokens,GlowTokens, andFontTokens. - Deck framing (
draw_deck_frame): Focused decks display the crisp cyan focus border (theme.accent.focus);Mode::Insertsignals step-entry mode in amber (theme.accent.edit);Mode::Jamdisplays the glowing violet border (theme.accent.jam) and floating Jam HUD. - 3 Built-in Themes (
ThemeId):Cadence Dark(default slate + phosphor),Midnight Neon(deep obsidian + high-bloom stage contrast), andStudio Light(daylight high-contrast slate).
3. Modeless Keybinding Grammar & Input Pipeline (crates/app/src/input/)
Cadence is strictly keyboard-driven, consistent, and direct. Parameter sculpting, note shaping, placement resizing, and item reordering happen directly in place without toggling a general edit mode.
3A. Mode Inventory
Only genuine input/selection modes exist:
| Mode | Trigger | Role |
|---|---|---|
Normal | Default | Modeless workspace: pure spatial navigation (hjkl/HJKL), direct 2D manipulation & reorder (Alt+hjkl/HJKL), one-hand scalar adjust (,/. </>), and canonical action verbs. |
Insert | i on editable Pattern Notes | Piano step entry (zsxdcvgbhnjm, + Shift accents, 1–8 scale degrees, </> octave, . rest, Left/Right step cursor). |
Jam | gj / Ctrl+Shift+j | Modal floating live-performance keyboard (top-row lanes, number-row sections, bottom-row chromatic piano, Tab/Shift-Tab bank). |
ValueInput | Enter on any scalar control | Exact number/unit/text entry with live validation and formatted preview. |
MiniEditor | Enter on a Mini pattern | Live-validated Mini-Notation code editor with Cycle 1 note preview. |
| Overlays & Browsers | Ctrl+Shift+<key>, :, /, ?, n, P, B, g/t/z/v | Fuzzy Action Palette, File Hub, Preset/Groove/Sample Browsers, Song Properties, Settings, Workflows, Pickers, Help, Inspect, Confirm, Prefix HUDs. |
3B. Deterministic Routing Order (crates/app/src/input/route.rs)
Every keyboard event (KeyEvent) passes through App::handle_key in one strict priority order:
KeyEvent
1. Normalize shifted char; on Press break undo coalescing & MIDI CC rec gesture
2. KeyEventKind::Release -> release matching held computer-keyboard notes (live_notes_off)
3. KeyCode::Home -> clear count, Action::Stop (non-repeat)
4. Active lane_layer HUD -> intercept part digit (1..9) or toggle lane across ALL modes;
any other key closes the layer and falls through
5. Ctrl+Shift+j -> toggles Mode::Jam ON and OFF (even inside Jam)
6. Universal Alt Layer -> Alt+Enter (stage/fire), Alt+1..0 (sections), Alt+q..p (lane layer),
Alt+m/M (mute/unmute all), Alt+s/S (solo/clear all),
Alt+x/X (release/release all), Alt+c/C (keep/keep all) — active everywhere
(Alt+hjkl / Alt+HJKL / Alt+Backspace flow to Tier 3 direct manipulation;
Alt+b/f/d stay free in text inputs)
7. Ctrl+c -> in Normal: Mode::Confirm(Quit); in any other mode: cancel to Normal
(restoring live-preview browsers cleanly if active)
8. Modal forms & popups -> Create, Workflow, Browser, PresetBrowser, GrooveBrowser, SongProperties,
MiniEditor, Palette, FileHub, Pick, Authoring, ValueInput,
Interpolation, ArrangeViews, ArrangementInspect
9. Ctrl / Ctrl+Shift -> Ctrl+<deck> (all 10 docked decks), Ctrl+Shift+<modal> (all modals),
Ctrl+s Save, Ctrl+z/Ctrl+Shift+z/Ctrl+r Undo/Redo, Ctrl+w Window,
Ctrl+=/−/0 zoom, Ctrl+u clear input
10. Jam & Stage modes -> Mode::Jam (Alt layer locked on + z–, 13-key piano HUD + </> octave + Tab/Shift-Tab bank)
Mode::Stage (Enter/S fire staged batch, x discard, Esc keep staging)
11. Esc unwinding -> cancel MIDI Learn -> clear count -> discard staging -> clear Take marks
-> clear sub-search filter -> exit Insert -> cancel preview browser
-> resume Jam -> unwind trail (`back`)
12. Prefix / overlay / -> Search (/), Transport (t), Window (z), Go (g), Help (?),
Insert / Normal Settings (g,), Inspect, Assets, Tutorial, Confirm, Insert (i), Normal
3C. The Four Directional Tiers
Every deck obeys the same four directional tiers with zero axis flips:
| Tier | Keys | Invariant | Undo / Repeat |
|---|---|---|---|
| 1. Navigate | h j k l (+ Arrows) | Pure spatial cursor movement matching the visual screen axes. Never mutates. Bare h/l is strictly a no-op on 1-axis vertical inspector decks. | Key-repeat enabled; no undo |
| 2. Coarse Nav / Tabs | H J K L (Shift + nav) | Coarse spatial jump or deck-level tabs (Rack tabs, Devices Audio | MIDI tabs, Modal tabs, Arrange sections, Pattern bars ±16, Mixer strip pages). Never mutates. | Key-repeat enabled; no undo |
| 3. Direct 2D Manipulate & Reorder | Alt+h j k l (fine)Alt+H J K L (coarse)(+ Alt+Arrows / Alt+Shift+Arrows) | Directly manipulate, move, nudge, or reorder the focused item along its visual axis (turn knob, push fader, shift pitch/gate, move placement bar/lane, slide breakpoint, reorder inserts/zones/pins/bindings). | Key-repeat enabled with coalesced single-gesture undo (u / Ctrl+z) |
| 4. One-Hand Scalar Adjust | , / . (fine − / +)< / > (coarse − / +) | Decrease / increase the focused scalar value right below k/l (zero modifier for fine). Works on every knob, fader, pan, send, duck, macro dial, cable amount, BPM, curve value, note velocity, and placement length. | Key-repeat enabled with coalesced single-gesture undo (u / Ctrl+z) |
3D. Global Modifier & Prefix Boundaries
No individual deck may shadow any global prefix, live-performance key, or Ctrl shortcut in this section. In native winit, physical_fallback keeps Ctrl+i and Ctrl+m distinct from Tab and Enter, and on macOS Cmd+=/−/0 maps onto the Ctrl zoom chords.
All 10 Docked Decks (Ctrl+<letter>, zero Shift)
| Deck | g Prefix | Direct Ctrl |
|---|---|---|
| Arrange | ga | Ctrl+a |
| Pattern | gp | Ctrl+p |
| Bank | gb | Ctrl+b |
| Mixer | gm | Ctrl+m |
| Instrument Rack | gi | Ctrl+i |
| Macros | gk | Ctrl+k |
| Take | gt | Ctrl+t |
| Signal Graph | gG | Ctrl+g |
Devices (Audio | MIDI) | gd (preserves active tab; :audio / :midi jump directly) | Ctrl+d |
| Output Monitor (toggle) | go | Ctrl+o |
All Modals & Overlays (Ctrl+Shift+<key>, always Shift)
| Modal / Overlay | Direct / g Prefix | Ctrl+Shift Chord |
|---|---|---|
| Action Palette | : | Ctrl+Shift+p (works in Normal & Jam) |
| Jam (modal floating overlay) | gj | Ctrl+Shift+j (toggles Jam ON and OFF even inside Jam) |
| File Hub | gf | Ctrl+Shift+f |
| File Hub: Open | gf (tab 1) | Ctrl+Shift+o |
| File Hub: Save As / Bundle | gf (tab 2) | Ctrl+Shift+s |
| File Hub: Export Audio | gf (tab 4) | Ctrl+Shift+e |
| Song Properties / Info | gP | Ctrl+Shift+i |
| Settings | g, | Ctrl+Shift+, (plus Ctrl+, alias) |
| Sample Browser | B / gS | Ctrl+Shift+b |
| Create New Object Menu | n | Ctrl+Shift+n |
| Help | ? | Ctrl+Shift+/ (i.e. Ctrl+?) |
Core CUA & Window Shortcuts
| Chord | Scope | Behavior |
|---|---|---|
Ctrl+s | Normal (also Settings / Devices / Take) | Save immediately (opens File Hub Save tab only if untitled) |
Ctrl+z / Ctrl+Shift+z (+ Ctrl+r) | Normal | Undo / Redo (alongside u / U) |
Ctrl+c | Any mode | Cancel overlay/input back to Normal (restoring live-preview browsers); in Normal opens Quit confirm |
Ctrl+w | Normal | Window / Deck prefix (Mode::Window, alias of z) |
Ctrl+= / Ctrl+- / Ctrl+0 | Normal / Insert | Horizontal zoom in / out / reset (only when Arrange or Pattern focused) |
Ctrl+u | Text inputs / Search | Clear active input buffer |
Alt — Top-Row Live Performance + Home-Row Direct Manipulation
| Chord | Scope | Behavior |
|---|---|---|
Alt+1..0 | Any mode (non-repeat) | Section jump 1–10 in current bank (or stage jump) |
Alt+q..p | Any mode (non-repeat) | Open lane layer for bank lanes 1–10 |
Alt+m / Alt+M | Any mode (non-repeat) | Mute focused lane (or Mixer channel) / Unmute all lanes |
Alt+s / Alt+S | Any mode (non-repeat) | Solo focused lane (or non-Master Mixer channel) / Clear all solos |
Alt+x / Alt+X | Any mode (non-repeat) | Release focused lane / Release all lanes |
Alt+c / Alt+C | Any mode (non-repeat) | Commit / Keep focused override (or Take selection on Take deck) / Keep all overrides |
Alt+Enter | Any mode (non-repeat) | Toggle / fire Staging (Mode::Stage) |
Alt+Backspace | Non-text decks (non-repeat) | Reset focused parameter / fader / pan / send / macro / cable / setting to default |
Alt+h/j/k/l & Alt+H/J/K/L | Non-text decks (repeat OK) | Tier 3 Direct 2D Manipulation & Reorder (plus Alt+Arrows / Alt+Shift+Arrows) |
Text-entry fields keep Alt+b, Alt+f, Alt+d, and Alt+[ free.
Global Normal Keys & Prefixes
| Key | Behavior |
|---|---|
g | Go prefix: ga Arrange · gp Pattern · gb Bank · gm Mixer · gi Instrument · gk Macros · gG Signal Graph · gd Devices (Audio | MIDI) · gt Take · go Output · gj Jam · gf File Hub · gP Song Properties · g, Settings · gS Sample Browser · gs Follow Source / Pattern Def · gg Start · ge End |
t | Transport prefix: tf Follow · tg Cue bar · tl Loop section · tx Clear loop · tX Cancel pending · ts Stop · te End rule · tr Take arm · tR Restart loop · ta Toggle 24-bit audio record · tA Record Audio dialog · ti Cycle input monitor (Off|Auto|On) · tc Cue · tp Cue & play · tb Bounce dialog · tq Launch quantize · tQ Cycle boundary · tE Edit timing · tC Clear all clipped meters |
z | Window prefix: zw/Tab cycle · zz zoom deck · zp pin · zx close · zo only · zh/j/k/l directional focus · z=/z-/z0 timeline zoom · z1..4 layout presets |
: / / / ? | Action Palette / Bank Material search / Help |
Space / Home | Play / Pause · Stop & rewind |
u / U | Pop staged change or Undo / Redo |
S / M / R | Stage toggle/fire · MIDI Learn · MIDI Record |
n / B / \ / ' | Global Create menu / Sample Browser / Toggle song loop / Arm From-Here fork |
; | Repeat last single-step pattern edit |
Tab / BackTab | Cycle focus across open decks forward / backward |
0 / $ / G / End | Start / end of the deck’s active focused list or timeline (never leaks to hidden cursors) |
PgUp / PgDn | Page along the deck’s primary scrollable axis |
Esc | Cancel MIDI Learn → clear count → discard staging → clear Take marks → back() (stop audition / deselect cable / unzoom / pop trail) |
Backspace | Cancel pending timeline jump else back() |
3E. Canonical Action Verbs
| Key | Intent | Scope |
|---|---|---|
Enter | Primary action: open / drill-down on links & containers · launch on Bank Parts · toggle on booleans & Rhythm · open exact ValueInput on scalars | Every deck |
a | Contextual Add (item into current deck/list) | Rack Panel/Patchbay (Add Module), Zones (Add Zone picker), Macros (Add Binding), Bank Parts (Add Part to Lane), Detail::Part (Add P-lock Link), Settings (Add Dir), Devices/MIDI (Add Mapping), Mixer/Channel (Add Insert/Send/Duck picker) |
A | Universal Audition / Preview | Pattern, Part, Placement, Bank Parts, Rack (all 3 tabs), PresetBrowser, SampleBrowser, Pickers |
x | Remove / unlink / release focused child item | Arrange (release override else remove placement), Notes (delete voice), Values (delete point), Panel (remove module), Patchbay (disconnect cable else remove module), Zones (delete zone), Mixer/Channel (remove Insert/Send/Duck), Macros (unbind binding), Graph (unlink cable), Bank Parts (release lane), MIDI (delete user mapping), Settings (remove dir), Take (clear marks) |
X | Delete whole entity / clear container (Mode::Confirm for entities) | Channel, Instrument, Effect, Pattern, Part, Lane, Section, Notes (clear step), Macro slot, Graph (unlink all), Take (discard), MIDI (clear all user mappings) |
r | Rename / edit metadata | Instrument, Module, Quick Pin, Zone, Channel, Effect, Pattern (incl. literal length/mode), Part, Lane, Section, Duck, Macro slot, Devices (r rescans audio/MIDI ports) |
d | Derive / duplicate (non-destructive) | Pattern (Draft::derive), Zones (duplicate zone), Arrange (duplicate placement), Mixer/Channel/Graph (Add Duck) |
e | Edit / inspect Modulation & Macro links | Any focused parameter on Rack (Panel/Zones), Detail::Channel, Detail::Effect, Mixer slots, Macros header (bind to M1–M8, attach/edit/unlink Modulation, jump to source), plus Signal Graph cables & FileHub inline path edit |
m | Mute / Bypass / Mode toggle | Lane Mute (Arrange, Bank), Channel Mute (Mixer, Channel), Effect Bypass (Detail::Effect; b on Mixer Insert slot when channel Mute owns m), Values Hold ↔ Ramp toggle, Notes step mute/rest (preserves pitch/chord) |
s | Solo | Lane Solo (Arrange, Bank), Channel Solo (Mixer, Channel) |
y / p / P | Clipboard (Arrange Placements & Pattern only) · Rack Pin (p on Rack) · Preset / Groove Browser (P on Rack / Filter) | Save Preset/Groove lives inside the P browser and gf Save tab; never leaks Paste errors onto non-clipboard decks |
v | View / Visual / Move FX | Arrange views prefix (vp/vo/vr), Bank Parts ↔ Material, Take visual range, Move Effect (Detail::Channel/Effect/Mixer Insert) |
f | Fork (or Add Effect on Mixer/Channel) | Pattern fork, Placement fork, Filter groove fork |
o | Open detail / local occurrence / route output / stack chord | Mixer → Detail::Channel; Placement/Inspect → local occurrence; Rack/Graph → route output; Pattern Notes → stack chord voice |
i | Step Insert (Pattern Notes only) | Enters piano-keyboard Mode::Insert |
C | Clear clipped meter (Mixer / Channel / Output) · Cable exact amount (Patchbay) | Pairs with tC (clear all clips) |
4. Deck Layout Engine, Visual Alignments & Deck-by-Deck Contract
4A. Pure Layout Model (crates/app/src/layout.rs, crates/app/src/decks.rs)
Layout stores pinned: Vec<Deck>, working: Option<Deck>, focus: Spot::{Pinned(usize), Working}, and zoomed: bool. Every workspace and focus query (workspace(), focus(), focused_canvas(), focused_deck_kind()) is derived purely from self.layout with zero shadow state.
- Deck shapes (
Shape):Widedecks (Arrange,Output,Take,Graph,Midi[Devices],Macros) stack horizontally;Talldecks (Bank,Mixer) dock along the right column;Blockdecks (Patternand object decks) adapt to available slots. - Working-deck selection tracking: While another deck holds focus, an unpinned working deck automatically retargets to follow the current selection; pinning (
zp) locks a deck’s target indefinitely. - Navigation trail: Navigating via
g<key>/Ctrl+<key>orEnterrecords aNavigationsnapshot onback(up to32entries) soEscunwinds cleanly without affecting musical undo.
4B. Six Visual-Axis Deck Layout Alignments
Six deck layout alignments guarantee every hjkl and Alt+hjkl binding matches the screen 1:1:
- Uniform control lists (
crates/gui/src/decks/object.rs,crates/app/src/controls.rs):j/kwalks rows andw/bjumps groups on every control list regardless of 1-column or 2-column visual flow; bareh/lnever mutates. - Rack
Zoneshorizontal Zone strip (crates/gui/src/decks/instrument/zones.rs): Renders a scrollable horizontal Zone pill strip at the top ofZones(matchingPanel’s module strip) soh/lselects zones left-to-right,j/kwalks Zone/Voice/Rack controls below, andAlt+j/kreorders zones. - Bank
Partsrow-oriented layout (crates/gui/src/decks/bank.rs): Renders Lanes as rows (j/k) and each Lane’s Parts as horizontal cards/pills left-to-right (h/l) in both unzoomed and zoomed (zz) views, matching Arrange with zero zoomed transpose. - Mixer vertical channel-detail stack (
crates/gui/src/decks/mixer.rs): Renders the selected channel’sFX,SND,OUT, andDUCKslots as a vertical stacked list below the strips soj/kslot navigation andAlt+j/kInsert reorder match the visual axis 1:1 (omitting unfocusableOUT → MasteronReturnandMasterchannels). - Macros 1D horizontal dial strip + scrollable Bindings (
crates/gui/src/decks/macros.rs): KeepsM1–M8in a single horizontal strip across all pane widths and scrolls the vertical Bindings table around the focused row. - Devices (
Audio | MIDI) navigable inspector rows (crates/gui/src/decks/midi.rs): RendersAudiotab rows (AUDIO INTERFACE,AUDIO INPUT & RECORDING,ENGINE & RECOVERY— 11 typedAudioDeckRows) andMIDItab rows (DEVICE & PROFILE— 5 typedMidiDeckRows:IN,OUT,Profile,Pads,Pickup— directly aboveMAPPINGS) as standard vertical inspector rows withH/Lswitching tabs, keeping globalt,i, andBackspaceunshadowed.
4C. All 11 Primary Deck Surfaces
DeckKind defines 14 targetable deck kinds projected into 11 visual surfaces (Placement, Part, and Channel share the unified ObjectDeckView):
| # | Deck | Jump | DeckView | Role & Key Capabilities |
|---|---|---|---|---|
| 1 | Arrange | ga / Ctrl+a | Arrange | Placements (vp), Evaluated Overview (vo), Evaluated Piano Roll (vr), live override rows, pending/staged badges, sections (H/L, w/b), Event Provenance (Enter) |
| 2 | Bank | gb / Ctrl+b | Bank | Row-oriented Launchpad (Parts) & searchable Material pattern/section library (v toggles) |
| 3 | Pattern | gp / Ctrl+p | Pattern | 2D polyphonic voice-sorted piano roll (j/k voice, o stack, Alt+j/k pitch, Alt+h/l gate, ,/. velocity, i Step Insert), fractional sub-step visualization, rhythm matrix, Values Hold/Ramp curve editor, MiniEditor (Enter), derived source inspector (gs/Enter) |
| 4 | Mixer | gm / Ctrl+m | Mixer | 32-bit float console (Audio, Group, Return, Master), -60..+6 dB faders with 0 dB hairline, pre-fader ticks, HOT/!CLIP, CMP/LIM GR bars, vertical detail slots (Fader/Pan/Inserts/Sends/Output/Duck), o Channel deck |
| 5 | Macros | gk / Ctrl+k | Macros | All 8 Project Macros (M1..M8) in 1 horizontal strip + scrollable Bindings, live automated sweeps, native-unit spans, inverted badges, MIDI CC badges |
| 6 | Devices (Audio | MIDI) | gd / Ctrl+d | Midi | Two-tab hardware deck (H/L switches Audio ↔ MIDI): Audio configures output/input device, sample rate, buffer size, cue out, input mode (Stereo | Left | Right), live input monitor (Off | Auto | On), latency trim (-250..+250 ms), audio panic/restart/rescan + live input meters & health; MIDI configures ports, profile, pads, soft pickup, Smart Macro & RGB pad previews, mappings, and event log |
| 7 | Graph | gG / Ctrl+g | Graph | Interactive 5/6-column Signal Graph patchbay (Sources → Derived → Parts → [Macros] → Instruments [RACK, {z}z · {m}m badge] → Mixer / FX), illuminated cubic-Bezier cables via shared cable_graph.rs, undo-safe wiring (o/a/s/m/d/e/x/X) |
| 8 | Take | gt / Ctrl+t | Take | Explicitly armed performance timeline (tr toggle, default OFF; Auto-Record Takes setting; Chrome TAKE ARM / ● REC TAKE / ● TAKE CAPPED badges), bar summaries, event markers, v Visual range selection, Enter/Alt+c keep with auto-forking, Ctrl+s save, X confirm-guarded discard |
| 9 | Instrument | gi / Ctrl+i | Instrument | Unified 11-module Eurorack Modular Rack (Panel | Patchbay | Zones via H/L): Panel (Quick panel_pins + module strip + 12 pre-sampled DSP ModuleVisualView visualizers), Patchbay (4-column cable_graph.rs with bipolar attenuverters & dashed z-1 feedback), Zones (horizontal zone strip + 32-zone key/vel/choke map); universal P Preset Browser, B Sample Browser, A audition, r rename |
| 10 | Effect / Object | Enter | Effect / Object | Dedicated visualizers for all 8 EffectKinds (EQ response, Filter + FilterEnv step bars, Comp/Limiter transfer + GR, Drive 3-mode curve, Chorus LFO, Delay taps, Reverb RT60) + ObjectDeckView for Placement, Part, and Channel |
| 11 | Output | go / Ctrl+o | Output | Non-focusable live stereo oscilloscope, L/R 32-bit float meters, 0 dB hairline, Master HOT/!CLIP latch, and Master LIM/CMP GR badge |
4D. Deck-by-Deck Binding Contract
- Arrange (
ga/Ctrl+a— Placements, Overview, Roll):- Nav:
h/lbar±1(Placements) or step±1(Overview/Roll) ·j/klane±1·H/Lprev/next section ·w/bsection (Placements) or note event (Overview/Roll) ·0/$/Gstart/end ·PgUp/PgDnlanes±6or visible bar page ·=/-quick zoom. - Direct Manipulation (Placements):
Alt+h/lmove start±4steps (Alt+H/L±16) ·Alt+j/kmove placement across lanes ·,/.shrink/extend length±4steps (</>±16). - Verbs:
EnteropenDetail::Placement(or Place workflow on empty bar;ArrangementInspecton Overview/Roll) ·vviews (vp/vo/vr) ·xrelease override else delete placement ·Xdelete section (or lane) ·redit section (or rename lane) ·dduplicate placement ·m/slane mute/solo ·[/]loop start/end ·y/p/Pyank/paste.
- Nav:
- Pattern (
gp/Ctrl+p— Notes, Rhythm, Values, Derived, Mini):- Shared:
h/lstep±1·H/L&PgUp/PgDnbar±16·0/$/Gfirst/last step ·=/-quick zoom ·Aaudition ·dderive ·redit metadata/length/rename ·ffork ·Xdelete pattern (confirm) ·y/p/Pyank/paste ·;repeat last edit. - Notes:
j/kchord voice ↓/↑ ·w/bnext/prev active note ·Alt+j/kpitch±1deg (Alt+J/K±1oct) ·Alt+h/lgate±0.25steps (Alt+H/L±1.0) ·,/.velocity±5%(</>±15%) ·[/](and#) flat/sharp accidental ·c/CcycleStepCondition·ostack chord voice ·mtoggle step rest/active ·xdelete voice ·Xclear step ·iStep Insert ·Backspace(in Placement scope) re-inherit step from definition. - Values:
w/bnext/prev breakpoint ·Alt+j/k&,/.value fine (±0.01/±1deg) ·Alt+J/K&</>coarse (±0.10/±7deg) ·Alt+h/lslide breakpoint±1step (Alt+H/L±4) ·EnterexactValueInput·mtoggleHold ↔ Ramp·xdelete breakpoint ·einspect/jump downstream Modulation/Link consumers. - Rhythm:
w/bnext/prev hit ·Enter/xtoggle hit directly. - Derived / Mini / Generators:
j/ksource chip (Derived) ·Enter/gsopen selected source (Derived) orMode::MiniEditor(Mini) ·Ffreeze to literal pattern.
- Shared:
- Modular Rack (
gi/Ctrl+i—Panel,Patchbay,Zones):- Shared:
H/Lswitch tab (Panel | Patchbay | Zones, or:page panel|patchbay|zones) ·Aaudition ·PPreset Browser (incl. Save Preset &Rreload) ·BSample Browser (auto-insertsSampler -> Out.Inviaensure_zone_sampler_modulewhen absent and applies RIFFsmpl/instmetadata) ·oroute output channel ·rrename instrument (or focused module/pin/zone) ·Xdelete instrument (confirm). Panel:h/lModule pill (Quick+ every module) ·j/kvertical control (w/bgroup) ·Alt+h/l&,/.fine (Alt+H/L&</>coarse) ·Alt+Backspacereset ·EnterexactValueInput(or open Sampler/Link) ·Alt+j/kreorder pin (Quickpill) ·aadd module ·xremove module (neverOut) ·ppin/unpin ·eedit/bind Macro & Modulation links. Displays all 12 pre-sampled GPUModuleVisualViewvisualizers (PinnedOverview,Vco,Sampler,Noise,Env,Lfo,Filter,Vca,Drive,LoFi,Resonator,Out).Patchbay: 4-columncable_graph.rs(SOURCES→MODULATORS→PROCESSORS→VCA / OUT) ·h/lcolumn ·j/kmodule card ·w/b([/]) cycle attached cables ·Alt+h/l&,/.fine cable amount (Alt+H/L&</>coarse) ·Alt+Backspacereset ·Enterjump to modulePanelor cable exactValueInput·aadd module ·cconnect cable ·Cselect/edit cable amount ·xdisconnect cable (else remove module) ·ppin cable ·eedit/bind Macro & Modulation links.Zones:h/lhorizontal Zone pill ·j/kvertical Zone/Voice/Rack control (w/bgroup) ·Alt+h/l&,/.fine (Alt+H/L&</>coarse) ·Alt+Backspacereset ·EnterexactValueInput/ Sample Browser ·Alt+j/kreorder active Zone ·a"Add Zone…"picker ·dduplicate zone ·xdelete zone ·rrename zone ·eedit/bind Macro & Modulation links.- Modular Rack Ex commands:
:new synth|sampler|kit|rack|modular [NAME],:mod add <vco|sampler|noise|env|lfo|filter|vca|drive|lofi|resonator> [NAME],:mod del <ID|NAME>,:mod rename <ID|NAME> <NEW_NAME>,:patch <FROM> <TO[.PORT]> [AMOUNT],:unpatch <CABLE_ID | FROM TO[.PORT]>,:pin [PARAM [LABEL] | LABEL],:unpin [INDEX | PARAM | LABEL],:zone ...,:sample PATH,:bounce ....
- Shared:
- Mixer (
gm/Ctrl+m) & Object Details (Channel,Effect,Part,Placement):- Mixer:
h/lchannel strip (H/L&PgUp/PgDnpage;0/$/Gfirst/Master) ·j/kvertical slot (Fader → Pan → Insert → Send → Output → Duck) ·Alt+h/l&,/.fine (Alt+H/L&</>coarse; step sizes aligned withDetail::Channel) ·Alt+j/kpush Fader dB or reorder Insert ·Alt+Backspacereset ·Enteropen Insert / bus picker /EditDuck/ exactValueInput·oopenDetail::Channel·aadd picker (cChannel /fEffect /wSend /dDuck) ·rrename ·m/smute/solo (bbypass Insert) ·vmove Insert ·elinks ·xremove child ·Xdelete channel (confirm) ·Cclear clip. - Object Details:
j/kvertical control (w/bgroup; bareh/lstrictly no-op) ·0/$/Gfirst/last ·PgUp/PgDn±6·Alt+h/l&,/.fine (Alt+H/L&</>coarse) ·Alt+Backspacereset ·Alt+j/kreorder Insert (Channel/Effect) ·Enterdrill-down link or exactValueInput·eedit/bind links ·rrename/edit ·x/Xremove/delete · deck-specific verbs (Channel:m/s/v/b/C;Effect:m/v, FilterP/f;Part:A/a;Placement:A/r/f/o).
- Mixer:
- Macros (
gk/Ctrl+k), Bank (gb/Ctrl+b), Signal Graph (gG/Ctrl+g), Take (gt/Ctrl+t), Devices (gd/Ctrl+d):- Macros:
h/l(1–8,0/$/G) Macro slotM1–M8·j/kDial header ↔ scrollable Bindings · Dial:Alt+h/l&,/.±2%(Alt+H/L&</>±10%),Alt+Backspace0%,EnterValueInput,abind picker,rrename,edriving Mod,x/Xunbind all / clear slot · Binding:Alt+h/l&,/.min,Alt+H/L&</>max,Alt+j/kreorder,Enterjump target,vinvert,xunbind row. - Bank:
vtoggleParts ↔ Material. Parts:j/klane ·h/lpart in lane ·0/$/Gfirst/last lane ·Enterlaunch (Shift+Enterimmediateat now) ·Aaudition ·aadd Part ·redit phase/offset ·xrelease lane ·Xdrop Part ·m/smute/solo. Material:j/kpattern (PgUp/PgDn,0/$/G) ·Enter/lopen Pattern ·hfocus left deck ·Aaudition ·dderive ·ffork ·rrename/edit ·Xdelete pattern (confirm). - Signal Graph:
h/lnon-empty column ·j/knode row (0/ggtop,G/Endbottom) ·Enterjump to deck ·oroute output ·eedit cable ·x/Xunlink cable / unlink all ·aadd connection (ors/m/dquick-add). - Take:
h/lbar (0/$/Gstart/end) ·vvisual range ·Enter/Alt+ckeep range ·xclear marks ·Xdiscard take (confirm) ·Ctrl+ssave take. - Devices (
Audio | MIDI):H/LswitchAudio ↔ MIDItab ·j/kvertical rows (w/bgroup jump; bareh/lno-op) ·Alt+h/l&,/.cycle values (Alt+Backspacereset) ·Enterpicker / run action / MIDI Learn ·rrescan audio or MIDI ports ·Ctrl+ssave config. OnMIDI:aadd mapping ·vtoggle invert ·x/Xdelete mapping / clear all user mappings (confirm).
- Macros:
- Settings (
g,/Ctrl+,), Song Properties (gP/Ctrl+Shift+i), Modals & Browsers:- Settings & Song Properties:
j/krow ·w/bgroup · bareh/lno-op ·Alt+h/l&,/.fine (Alt+H/L&</>coarse) ·Alt+Backspacereset ·EnterexactValueInput/ title edit ·aadd dir (g,) ·xremove dir (g,) ·FOS folder dialog (g,) ·Ctrl+ssave (g,) ·ccycle boundary picker. - Browsers, File Hub & Help:
h/l,H/L,Tab/BackTabswitch horizontal tabs/categories (FileHubExport rows adjust values withAlt+h/land,/., keepingH/L/Tab/1–4on tabs) ·j/klist ·/search ·Aaudition ·Spaceplay/pause ·Enteropen/commit ·Escclear search → cancel/restore.
- Settings & Song Properties:
4E. Workspace Presets & Window Keys (z / Ctrl+w)
| Key | Action / Layout Preset |
|---|---|
z1 | Compose: Pinned Arrange + working Pattern |
z2 | Perform: Pinned Arrange + Bank (Parts) + Output |
z3 | Sound Design: Pinned Pattern + Output + working Instrument (fallback Bank) |
z4 | Mix: Pinned Arrange + Output + working Mixer |
zz / zp / zx / zo | Toggle full-screen zoom / pin focused deck / close deck / keep only focused deck |
zh/zj/zk/zl, zw | Directional deck focus movement / cycle focus (Tab) |
z= / z- / z0 | Zoom Arrange/Pattern timeline in / out / reset (also Ctrl+= / Ctrl+- / Ctrl+0) |
4F. Modal Overlays (OverlayView)
Palette(:/Ctrl+Shift+p): Fuzzy Action Palette (subsequence search over actions, decks, layouts, 8 quick-add FX, themes, and dynamic Sections/Patterns/Instruments) with live top-slot▶ Run command:Ex passthrough.PresetBrowser(Pon Instrument): Unified Rack preset browser (engine_label: "RACK") with 6 category filter tabs (All/Synth/Sampler/Drums/Kit/Modular), 4 bare neutral defaults (Init Synth,Blank Sampler,Blank Kit,Blank Modular), Save Preset action, and live non-destructive audio preview from a fullProjectsnapshot (j/kpreview,/search,Aaudition,Spacetransport,Entersingle-transaction commit,Esczero-trace restore).GrooveBrowser(Pon Filter Effect): Live filter groove browser across the 128-slotFilterEnvbank (24MIT factory grooves + user grooves) with preview on scroll, Save-to-Bank, and Fork-to-Pattern (f).SongProperties(gP/Ctrl+Shift+i): Modal editor for Title, Tempo (BPM), Key Root, Scale (all 13NAMED_SCALES), Length (Bars), End Rule, and Live Timing on theuundo stack.MiniEditor(EnteronMini): Dedicated live-validated Mini-Notation editor (cadence_core::mini::parse_mini) with real-time Cycle 1 event count and resolved note preview.ValueInput(Enteron scalar controls): Unified exact scalar entry modal with live parse validation and formatted preview across Pattern Values, allParamAddresscontrols, Rack zone structural fields, Macro dials, Placement offsets, and Song Properties.FileHub(gf,Ctrl+Shift+f/o/s/e): 4-tab Open/Recent (with.rbsimport preview whenfeature = "rbs"is enabled), Save & Bundle, Import (auto-closes on preset/profile load), and Export (WAV/Stems), universal/search,H/L/Tab/1–4tabs, andFnative OS dialogs.Browser(B/gS/Samplerows): Universal/sample browser with async off-thread preview decoding, live auditioning, and automaticSampler -> Out.Inmodule insertion + RIFFsmpl/instmetadata application on the active Rack zone.Authoring(n/d/r/tA/ workflow keys): Typed modal draft forms for creating/editing patterns, derivations, instruments (SoundChoice::{Template(RackTemplate), Preset(String), Sampler { path, label }, Folder { path, label }}), channels, effects, sends, ducks, bounces, and live audio recording (RecordDraft).Settings(g,/Ctrl+,/:settings): PersistedUserConfigeditor: theme, startup preset, output monitor, follow,Auto-Record Takes, default BPM/key, project Live Timing, and auto-refreshingsample_dirs/preset_dirs.Help(?/Ctrl+Shift+/): 7-tab wrapped, universal/searchable reference (All,Navigate,Compose,Mini & Algebra,Sound & FX,Live & Jam,Files & CLI;H/L/Tabswitch tabs).Confirm: Unsaved-dirty & destructive protection guarding Quit, New, Open, ImportRbs, DeleteChannel, ClearMidiMappings, and DiscardTake.Tutorial,Picker,EventInspection,Inspect/Assets, andPrefixMenulegends (g,t,z,v,S).
5. Live 24-Bit Audio Recording & Hardware MIDI Control
5A. Live Audio Input & 24-Bit WAV Recording (crates/app/src/{devices.rs,recording.rs})
- Device & input setup (
Devices · Audiotab viaCtrl+dthenH/L, or:audio): Select input/output devices, sample rate, buffer size, mono/stereo channel capture (Stereo,Left (Ch 1),Right (Ch 2)), live monitoring (Off,Auto[monitor while armed/recording],On), latency trim (-100..+100 ms), and recovery actions (Audio Panic,Restart Audio,Rescan Devices). - Capture workflows (
ta,tA,ti,:rec):tatoggles quick recording immediately;tAopens theRecord Audioworkflow dialog (RecordingMode::{Synced, CountIn, Free}, target bar length, destination New Sampler or existing Rack Zone, optional Arrange placement).:rec [start|stop|cancel|dialog|free|countin [BARS]|bars <N>|zone ...|monitor [off|auto|on]|mode <stereo|left|right>|input <NAME|none>].- Audio captures off the RT thread via a lock-free SPSC ring, resamples cleanly when input/output hardware sample rates differ, applies latency trim, writes a portable 24-bit PCM WAV under
<project>/recordings/(or the configured session recordings directory for untitled projects), and commits aSamplerRack instrument + Part + Placement in one undoable transaction.
5B. Hardware MIDI Learn, Live Recording & Bi-Directional Feedback (crates/core/src/midi_map.rs, crates/app/src/midi/)
MIDI mapping and feedback are data-driven and hardware-agnostic inside cadence-app, with raw wire encoding isolated to cadence-engine::midi:
- Device Profiles (
UserConfig::midi_profile):"generic","standard_cc", and"minilab3_daw"(Arturia MiniLab 3 DAW-mode integration). - Sources & Value Modes:
MidiSource::{Cc, Note, PitchBend}(channel-scoped or omni);MidiValueMode::{Absolute, RelativeSigned, RelativeOffset64, Trigger, Toggle, Momentary}with[min, max],invert, and soft-pickup takeover (pickup: true) so absolute knobs catch the live value smoothly without jumps. - Bindable
MidiTargets:Param { address }(any automatableParamAddress, includingRack,Zone,Module, andCableattenuverters),FocusedMacro { slot: 0..8 }(tracks focused Effect/Channel controls, Project Macros 1–8 outside object decks, or active Rack controls prioritizing continuous!param.is_discrete()panel_pinsfirst, then continuous active-zone module controls, thenRackParams, then discrete pins),ProjectMacro { slot: 0..8 },LaneGain,MasterGain,Transport(10MidiTransportActions + universal MMC),LaunchSection,LaunchLanePart,MuteLane,SoloLane. - 1-Key MIDI Learn (
M): Resolves the focused target automatically (Macroslot →Midirow → object-deck automatable parameter →Mixerchannel gain/pan/send →Banklaunch part → active Rack’s first pinned control, first Filter cutoff, or Rack Cutoff). Pressingx/Backspacewhile armed unlearns;Esccancels. Learned mappings persist globally inUserConfig::midi_mappings. - Live Note & CC Recording (
R): Enters notes in step-entry mode when stopped; while playing, overdubs quantized polyphonic chords and lazily creates/updatesValues(Normalized, Ramp)automation curves for any moved MIDI CC or Project Macro (1500 msgesture undo coalescing). - Bi-Directional Feedback (
FeedbackProtocol::{None, StandardCcNote, ArturiaDaw}):App::sync_midi_feedbackemits pure semanticMidiFeedbackevents (InitDawMode, 2-line OLEDDisplaywith value bar, RGB pad LEDs acrossMidiPadMode::{Notes, Sections, Mutes},TransportLedKindLEDs, and CC echo) translated to hardware bytes bycadence-engine::midi.
Material Graph, Typed Edits & Single-Clock Timing
This specification defines Cadence’s authoritative domain model, retained pattern algebra, atomic mutation invariants, single-clock timeline semantics, and flat executable score compilation. Every type, constant, and bound below is verified directly against crates/core/src/.
Related specifications: DSP & Audio Engine · Decks & Interaction · Protocols & Persistence · Design Decisions
1. Authoring Document Schema (Project v1)
Retained musical definitions — not flattened clip audio or compiled note lists — are Cadence’s saved source of truth (crates/core/src/material/types.rs). The on-disk JSON document (crates/core/src/material/codec.rs) flattens Project alongside optional sibling flags: LiveFlags (omitted when empty), with #[serde(deny_unknown_fields)] enforced on every domain type.
Document JSON
├── version: 1 (Project::VERSION = 1)
├── title: String (1..=120 printable chars)
├── bpm: f64 (20.0..=300.0)
├── root_midi: u8 (0..=127)
├── scale: Vec<i8> (1..=12 strictly ascending offsets in 0..=11, scale[0] == 0)
├── bars: usize (1..=MAX_BARS)
├── patterns: Vec<Pattern> (retained literal & derived DAG nodes)
├── instruments: Vec<InstrumentInstance> (each owns one unified `rack: RackPatch` + `channel`)
├── parts: Vec<Part> (Pattern + Instrument + transpose/velocity + ParameterLinks)
├── lanes: Vec<Lane> (launchable LaneParts + non-overlapping Placements)
├── sections: Vec<Section> (named step spans inside the arrangement)
├── mixer: MixerGraph ({ master: MasterChannel, channels: Vec<Channel> })
├── ducks: Vec<Duck> (event-triggered sidechain envelopes)
├── modulations: Vec<Modulation> (global Values automation -> instruments/FX/mixer/macros)
├── macros: Vec<MacroControl> (up to 8 assignable Project Macros, omitted when empty)
├── timing: LiveTiming (launch/edit boundaries & late tolerance, omitted if default)
├── end: EndRule ("loop" | "stop" | "continue")
└── flags?: LiveFlags (live lane/channel mute & solo — saved, never undone)
Unified Eurorack Modular Rack Hierarchy & Parameter Addressing
Every InstrumentInstance { id, name, rack: RackPatch, channel } uses one unified Eurorack instrument architecture (Rack -> Zones -> Modules [Panel] + Patchbay) defined in crates/core/src/rack/. Single-sound synths and samplers are 1-zone Racks; drum kits and multisamples are N-zone Racks with key/velocity splits and choke groups:
RackPatch (bus gain_db/pan/tune_semitones/cutoff_hz/resonance + panel_pins: Vec<PanelPin>)
└── zones: Vec<RackZone> (1..=32; stable id, key/vel splits, choke_group, VoiceSettings)
├── modules: Vec<RackModule> (1..=24; 11 orthogonal ModuleKind variants, <= 4 Resonators, exactly 1 Out)
└── cables: Vec<PatchCable> (0..=64; OutPort::Out -> InPort::{In,Cv,PitchCv,FmIn,PwCv,TrigIn}, bipolar amount)
All P-locks (ParameterLink), global Modulations, Project Macros, MIDI Learn, Live CC Recording, Panel Pins (PanelPin), and :param commands address one orthogonal parameter model (crates/core/src/params.rs, crates/core/src/rack/params.rs):
InstrumentParam:Rack { param: RackParam },Zone { zone: u16, param: ZoneParam },Module { zone: u16, module: u16, param: ModuleParam }, andCable { zone: u16, cable: u16 }.ParamAddress:Rack,Zone,Module,Cable,Channel,Send, andEffect(from_instrument()/as_instrument()/is_automatable()).- Unified path resolution (
InstrumentParam::parse_for_rack): Resolves<zone>.<module>.<param>(e.g.z1.filter.cutoff,BD.body_vco.tune),<zone>.cable.<id>/<zone>.c<id>(andc<id>/cable.<id>on 1-zone Racks),rack.<param>/bus.<param>,<zone>.<zone_param>,<module>.<param>(on 1-zone Racks), and unambiguous shorthand (cutoff,res,decay,env_mod,bits, etc.) checking curatedpanel_pinsfirst, then unique module parameters (disambiguating multipleEnvs toward the primary audio-path lifetime envelope), then zone/rack parameters.
Live State Separation (LiveFlags)
LiveFlags (muted_lanes, solo_lanes, muted_channels, solo_channels, master_muted) is persisted with the document so a workspace reopens as left, but mutating LiveFlags never enters undo history and never increments the authored song revision. Unknown or deleted lane/channel IDs are rejected by Project::validate_flags and pruned on save via Project::prune_flags.
Authoritative Workspace & Domain Bounds
| Constant | Value | Source | Meaning |
|---|---|---|---|
VERSION | 1 | material/types.rs | Exact authoring schema version (zero legacy converters) |
STEPS_PER_BAR | 16 | music.rs | Fixed 16th-note grid per 4/4 bar |
MAX_BARS | 2048 | material/types.rs | Maximum arrangement length (MAX_TIMELINE_STEPS = 32_768 steps) |
MAX_PATTERNS | 2048 | material/types.rs | Maximum pattern nodes in the project DAG |
MAX_LITERAL_STEPS | 1024 | material/types.rs | Maximum stored steps for Notes, Rhythm, Mini, Euclidean, Freeze |
MAX_DEPTH | 32 | material/types.rs | Maximum root-to-leaf DAG depth (enforced per path, memoized by (Id, depth)) |
MAX_INSTRUMENTS | 16 | material/types.rs | Maximum instrument instances |
MAX_LANES | 16 | material/types.rs | Maximum arrangement lanes |
MAX_PARTS | 1024 | material/types.rs | Maximum part bindings |
MAX_PLACEMENTS | 4096 | material/types.rs | Maximum total placements across all lanes |
MAX_LINKS | 16 | material/types.rs | Maximum per-note ParameterLinks (P-locks) per Part |
MAX_GLOBAL_MODULATIONS | 256 | material/types.rs | Maximum global Modulation relationships |
MAX_SECTIONS | 256 | material/types.rs | Maximum named arrangement Sections |
MAX_TRANSACTION_EDITS | 16_384 | material/types.rs | Maximum Edit operations per atomic transaction |
MAX_DERIVED_OFFSET | 1_048_576 | material/types.rs | Maximum |offset_steps| on Placement or LanePart |
MAX_CHORD_TONES | 5 | music.rs | Extra stacked voices per Step (up to 6 simultaneous notes) |
MIN_DEGREE / MAX_DEGREE | -127 / 128 | music.rs | Scale degree bounds covering full MIDI 0..=127 in any scale |
MAX_ZONES / MAX_CHOKE_GROUPS | 32 / 8 | rack/types.rs | Key/velocity zones and choke groups per RackPatch |
MAX_MODULES_PER_ZONE / MAX_CABLES_PER_ZONE | 24 / 64 | rack/types.rs | Eurorack modules and patch cables per RackZone |
MAX_PANEL_PINS | 16 | rack/types.rs | Curated Quick Panel performance pins (PanelPin) per RackPatch |
MAX_PROJECT_MACROS | 8 | macros.rs | Project Macros M1..M8 (index in 0..8) |
MAX_MACRO_BINDINGS | 16 | macros.rs | Parameter bindings per Project Macro (MAX_MACRO_NAME_LEN = 32) |
MAX_LANE_PARTS / MAX_PARTS_ON_LANES | 32 / 256 | material/set.rs | Launchable parts per lane and total across all lanes |
MAX_BOUNDARY_BARS / MAX_LATE_TOLERANCE | 64 / 4 | material/set.rs | Maximum Boundary::Bars span and late-tolerance steps |
LIVE_RING_BARS / LIVE_RING_STEPS | 64 / 1024 | material/live.rs | Sliding live compilation window length |
MAX_PROJECT_BYTES | 16 MiB | cadence-app | Bounded project JSON file size limit |
Musical Step Primitives (music.rs)
Each Step encodes active: bool, degree: i16 (-127..=128), accidental: i8 (-6..=6), velocity: f32 (0.0..=1.0), gate: f32 (0.05..=64.0 steps), condition: StepCondition { turn, every } (1 <= turn <= every <= 16, default 1:1 = ALWAYS), and chord: Vec<ChordTone> (up to MAX_CHORD_TONES = 5). Source steps in persisted projects must have source_part: None.
Scale degrees resolve relative to Project::{root_midi, scale} via music::pitch_midi, where degree 1 is the tonic (root_midi + scale[0]) and degree 0 is the scale tone immediately below tonic. All 13 built-in named scales live in one authoritative music::NAMED_SCALES table (shared by scale_name, scale_label, named_scale, cycle_scale, :key, and the Song Properties modal gP): major, minor, dorian, phrygian, lydian, mixolydian, harmonic_minor, melodic_minor, major_pentatonic, pentatonic, blues, whole_tone, and chromatic.
2. Pattern Algebra & Pure Evaluation
Every Pattern carries a stable Id (u64), unique name, and typed PatternKind. Validation resolves a static signature (PatternType, period: u64) for every node, rejecting missing references, cycles, type mismatches, non-positive periods, and depth >= MAX_DEPTH.
Pattern Types (PatternType)
PatternType::Notes— polyphonic musical note events with sub-step offsets.PatternType::Rhythm— boolean trigger gates (with optional sub-step offsets when derived from temporal operators).PatternType::Values(ValueUnit::Degrees)— integral scale-degree offsets (-63..=63,ValueMode::Holdonly).PatternType::Values(ValueUnit::Normalized)— continuous or stepped control values (0.0..=1.0,ValueMode::HoldorValueMode::Ramp).
All 22 PatternKind Variants
Leaf & Literal Generators (6)
| Variant | Fields & Bounds | Output Type | Natural Period |
|---|---|---|---|
Notes | steps: Vec<Step> (1..=1024) | Notes | steps.len() * lcm(step.condition.every) |
Rhythm | steps: Vec<bool> (1..=1024) | Rhythm | steps.len() |
Values | unit, period (1..=MAX_BARS*16), mode (Hold/Ramp), sorted unique points (1..=period) | Values(unit) | period |
SeededValues | unit, period (1..=MAX_BARS*16), seed: u64, min <= max | Values(unit) | period (SplitMix64 hash, Hold) |
Mini | code: String, steps: u16 (1..=1024) | Notes | steps * mini_cycle_multiplier(ast) |
Euclidean | pulses: u16, steps: u16, rotation: i16 (0 <= pulses <= steps <= 1024) | Rhythm | steps (Bjorklund/Bresenham predicate) |
Note: PatternKind::is_literal() returns true for Notes, Rhythm, Values, Mini, and Euclidean (all resizable via Edit::ResizePattern). SeededValues is a zero-input deterministic generator whose points are frozen before per-step editing.
Retained Derivations & Combinators (16)
| Variant | Input Types | Parameters & Bounds | Output Type & Period | Semantics |
|---|---|---|---|---|
AddDegrees | Notes, Values(Degrees) | — | Notes, lcm(p_n, p_v) | Shifts each active step & chord tone by rounded degree value sampled at time + offset |
Mask | Notes, Rhythm | Notes | — | Notes, lcm(p_n, p_r) | Passes source note events only on steps where mask is active |
Transpose | Notes | semitones: -96..=96 | Notes, p | Chromatically transposes root & chord tones, remapped via midi_to_degree |
NotesFromValues | Values(Degrees), Rhythm | Notes | degree_offset: -63..=63, velocity, gate | Notes, lcm(p_v, p_r) | Generates notes on every rhythm sub-step offset with degree = round(val) + degree_offset + 1 |
TimeScale | Notes | Rhythm | num: 1..=16, den: 1..=16 | Same, max(1, lcm(p*den, num)/num) | Compresses (num > den, e.g. 3/2 triplets) or expands (num < den) timing & scales gate by den/num |
Swing | Notes | amount: 0.0..=0.45 | Notes, lcm(p, 2) | Delays odd 16th steps by amount, carrying offset + amount >= 1.0 cleanly into the next even step |
Ratchet | Notes | count: 1..=8 | Notes, p | Subdivides each hit into count evenly-spaced retriggers (5% per-hit velocity taper floored at 0.5×, gate / count) |
Shift | Any | steps: i32 | Same, p | Rotates pattern in time (source(time - steps)) |
Reverse | Any | — | Same, p | Exact period involution (Reverse(Reverse(x)) == x); mirrors sub-step offset > 0 to 1.0 - offset |
Chance | Notes | Rhythm | probability: 0.0..=1.0, seed: u32 | Same, p | Deterministic per-hit gate using det_hash(seed, id, time, i) < probability |
Every | Two same-type sources | interval: 2..=64 | Same, lcm(p_base * interval, p_alt) | Evaluates alt on every interval-th cycle of base (cycle mod interval == interval - 1) |
Arp | Notes | mode: ArpMode, rate: 1..=4 | Notes, p | Collects all pitches held/sounding at time (lookback up to min(p, 65) steps), steps Up/Down/UpDown/Random at rate sub-steps/step |
RangeFold | Notes | low_midi <= high_midi <= 127, span >= 11 | Notes, p | Octave-folds all pitches & chord tones into [low_midi, high_midi] |
Concat | 1..=16 same-type sources | parts: Vec<Id> | Same, sum(p_i) | Plays parts[0], parts[1], … end-to-end |
Stack | 1..=16 same-type Notes | Rhythm | parts: Vec<Id> | Same, lcm(p_i) | Layers sources simultaneously (merged sub-step events sorted by offset, or logical OR for Rhythm) |
Shape | Notes, Values(Norm), opt. Values(Norm) | velocity, gate: Option<Id> | Notes, lcm | Multiplies velocity by v and (when gate present) scales gate by g * 2.0 |
Inline Mini-Notation Parser (crates/core/src/mini.rs)
PatternKind::Mini { code, steps } parses a Strudel/Tidal-inspired notation into a validated Vec<WeightedNode> AST with zero mutable state:
- Pitches: Note names (
c4,eb3,f#5,cs4, default octave4) or 1-based scale degrees (1,0,-2,5#,3b). - Rests:
~or.. - Recursive subdivisions:
[c4 e4 g4],[c4 [e4 g4]]divide their enclosing span proportionally by node weights. - Chords:
[c4,e4,g4]orc4,e4,g4(up toMAX_CHORD_TONES + 1 = 6notes, validated at parse time). - Cycle alternations:
<c4 e4 g4 b4>selects one branch per cyclecycle.rem_euclid(len). - Chainable modifiers:
*Nrepeat (1..=16),/Nslow (1..=16),@Wrelative weight (0.125..=32.0),(k,n)/(k,n,r)Euclidean (0 <= k <= n <= 64),?(0.5) /?p(0.0..=1.0) deterministic chance viadet_hash,!accent (velocity = 0.98, default0.80; gate =0.85 * dur, clamped0.08..=64.0). - Cycle period:
mini_cycle_multipliercomputes the exact LCM of all nested/Nslow factors and<...>alternation lengths soPatternKind::Miniintegrates cleanly withEvery,Concat,Reverse, andBoundary::Cycle.
Pure Stateless Evaluation (crates/core/src/evaluate.rs)
Offline rendering, the live ring compiler, and UI projections all evaluate through cadence_core::evaluate:
det_hash(seed: u32, pattern_id: Id, step: i64, salt: u32) -> f32: Pure stateless SplitMix64 finalizer mapping(seed, pattern_id, step, salt)deterministically onto[0.0, 1.0). Querying any step in any order (scrubbing, scrolling, live ring window, or offline render) produces bit-identical results.EvaluatedEvent { offset: f32, step: Step }: EveryNotesevaluation at integer 16th-notestepyields 0, 1, or many events sorted ascending by fractionaloffset ∈ [0.0, 1.0).- Value interpolation (
eval_value_points):ValueMode::Holdlatches the prior breakpoint;ValueMode::Ramplinearly interpolates across wrapped period boundaries at arbitrary fractionalf64step time.Project::value_modepropagatesRampcleanly throughShift,Reverse,Every, andConcat.
3. Atomic Typed Edits & Structural Invariants
All persistent document mutations enter through Edit transactions (Project::apply_transaction_validated / apply_transaction_with_flags in crates/core/src/material/mutate.rs):
- Copy-on-write atomicity: Up to
MAX_TRANSACTION_EDITS(16_384) edits execute against a cloned candidateProject. Any failure discards the candidate completely; the live document is untouched. - Monotonic stable IDs: Entity IDs (
Id = u64) are allocated monotonically byDocumentand never recycled across undo/redo. - Unified modular Rack instrument mutations:
Edit::CreateInstrument { instrument }— creates a newRackinstrument (fails if ID already exists).Edit::UpdateInstrumentMeta { id, name, channel }— renames or re-routes an instrument without touching itsRackPatch.Edit::UpdateRackPatch { id, rack }— replaces an instrument’s validatedRackPatch(e.g., loading a preset or editing zone splits).- Atomic modular authoring edits:
Edit::AddRackZone,Edit::RemoveRackZone,Edit::ReorderRackZone,Edit::AddRackModule,Edit::RemoveRackModule,Edit::RenameRackModule,Edit::ConnectCable,Edit::DisconnectCable,Edit::SetCableAmount,Edit::PinPanelControl, andEdit::UnpinPanelControl. - Zone & graph structural invariants (
RackPatch::validate,RackZone::validate): Every Rack holds1..=32zones with unique nonzeroid: u16; every zone holds1..=24modules with exactly one mandatoryOutmodule (RemoveRackModuleandAddRackModuleboth protect the singularOutmodule) and0..=64patch cables with validatedOutPort::Out→ acceptedInPortcompatibility, unique(from_module, from_port, to_module, to_port)edges, and finite attenuverter amounts withincable_amount_range(target_kind, to_port).
- Automatic stale Rack reference pruning: Whenever
UpdateRackPatch,RemoveRackZone,RemoveRackModule, orDisconnectCableremoves zones, modules, or cables (withRemoveRackModulealso severing all attached cables),mutateimmediately runsprune_stale_instrument_refsto prune deadpanel_pins,project.modulations, andpart.parameter_linkstargeting that instrument. At transaction commit, any edit touching instruments, channels, or Master also runsProject::prune_macro_bindings()before finalvalidate(). - Compile-time typed channel & effect edits (
Editmixer invariance):Edit::CreateChannel { channel }— creates a new channel (rejects duplicate channel or insert device IDs).Edit::UpdateChannelMeta { id, name, output, sends }— updates channel name, bus output, or sends without touchingChannelKind,strip, orinserts.Edit::RemoveChannel { id }— removes an existing channel (pruning stale macro bindings at transaction commit).Edit::AddEffect { channel, device, index }— inserts a strictly new effect device onto any channel or Master.Edit::RemoveEffect { device }— removes an existing effect device by ID from whichever channel/Master owns it.Edit::MoveEffect { device, target_channel, target_slot }— reorders or moves an existing effect across channels/Master while preservingid,name,bypassed,kind, and Macro bindings.Edit::UpdateEffect { device, name, bypassed, kind }— updates device metadata/bypass/patch while enforcingstd::mem::discriminant(&existing.kind) == std::mem::discriminant(&incoming)whenkindisSome.- Channel strip
gain/panupdates route throughEdit::SetParam(ParamAddress::Channel), and transaction pre-state checks (check_channel_kind_invariance,check_effect_kind_invariance) additionally prevent delete+recreate kind swaps within a single transaction.
- Placement, overlap & asset portability invariants:
- Placements on the same
Lanemay not overlap ([start_step, start_step + length_steps)). - Placements sharing the same
InstrumentInstanceacross different lanes may not overlap; simultaneous parts require separate instrument instances. - Placement-local
Exceptionsteps must have unique relative offsets< length_stepsand must be unconditional (StepCondition::ALWAYS). - Sample paths on every
SamplerModuleacross every zone (walked via one SPOT iteratorRackPatch::sampler_modules()across validation, asset discovery,SampleBankloading, and Save As / Bundle relativization) must never be absolute filesystem paths — only project-relative paths or catalog labels are accepted.
- Placements on the same
4. Single-Clock Timeline & Live Performance
Pure Timeline Mapping (crates/core/src/timeline.rs)
One monotonic transport clock (u64 16th-note steps) drives both arrangement playback and live performance via Timeline, an ordered non-empty list of Segment transitions:
#![allow(unused)]
fn main() {
pub struct Segment {
pub from: u64, // transport step where this mapping takes effect
pub song: u64, // song step aligned with `from`
pub region: Option<(u64, u64)>, // optional loop (start, length) in song steps
pub end: EndRule, // Loop | Stop | Continue
}
}
song_step(transport, song_length): Mapsraw = song + (transport - from). Ifregion = Some((start, len))withlen > 0andraw >= start, wraps intostart + (raw - start) % len. Otherwise, onceraw >= song_length:EndRule::Loopwrapsraw % song_length, whileEndRule::StopandEndRule::ContinuereturnNone.song_step_unbounded(transport): Evaluates without wrapping or stopping atsong_length, used whenKeepextends the arrangement past its current end.pass_end(transport, song_length): Returns the exact transport step where the active loop region (or full-song loop pass) completes, so section jumps finish the current pass cleanly.stop_at(transport, song_length): Computes the automatic stop step whenEndRule::Stopis active with no loop region and no earlier scheduled remap.remap,cancel_after,prune_before: O(log n) binary search viapartition_point; historical superseded segments are pruned to keep live memory bounded.
Boundaries & Late Tolerance (crates/core/src/material/set.rs, crates/core/src/live.rs)
Live changes (Change::{Song, Flags, Launch, Timeline, Release, ReleaseAll}) land on quantized Boundary steps:
Boundary Variant | Step Quantum | Notes |
|---|---|---|
Now | None (immediate) | Lands on next_step |
Beat | 4 | Next quarter-note downbeat |
Bar | 16 | Default launch boundary (LiveTiming::default()) |
Bars { count } | count * 16 | count ∈ 1..=64 |
Cycle { pattern } | pattern_period(pattern) | Next start of referenced pattern’s full repeat period |
LiveTiming also specifies edits: EditTiming (Now default, or Launch so live song edits queue onto the launch boundary) and late_tolerance_steps: u32 (0..=4, default 1).
Late-tolerance rule (Performance::boundary): While stopped, every change lands immediately at next_step. While playing with quantum q, compute upcoming = next_step.div_ceil(q) * q. If next_step > 0 && upcoming > next_step (never snapping backward when already on an exact boundary), let previous = ((next_step - 1) / q) * q and missed = next_step - previous. If missed <= late_tolerance_steps, the change snaps back onto previous; otherwise it queues at upcoming.
Live Overrides, Staging & Ring Compilation (crates/core/src/material/live.rs)
- Lane overrides (
Override { lane, part: LanePart, anchor }): Launching a part overrides only that lane; every other lane continues playing the underlying arrangement segment. The newest launch claims its part’sInstrumentInstancefrom any other active override.PhaseMode::Songfollows the timeline’s song step;PhaseMode::Restartcounts fromstep - anchor. - Ordering invariants: Queued
Change::SongandChange::Flagsnever overtake one another (at = at.max(last)). A newLaunch/Releasereplaces any pending launch/release on the same lane; a newTimelineremap replaces any pending remap. - Staging (
StagedChange): CollectsLaunch,Release,Mute,Solo, andJumpSectiongestures without landing them until fired atomically on a single boundary (or discarded). - Sliding live ring:
Performance::compilecompiles[base, base + LIVE_RING_STEPS)(64bars =1024steps, aligned to the bar ofnext_step - 1) into aScoreWindowwithlive_window = Some(LiveWindow { start, end, stop_at }). Whennext_step >= base + LIVE_RING_STEPS / 2, the controller automatically recompiles and slides the ring forward. - Transient
Audition: Compiles onto the same live ring (eithersolo: truewhen stopped or layered over one instrument when playing), synthesizingAUDITION_INSTRUMENT_IDif the project has no instruments. Auditions are never authored, recorded in takes, or written byKeep.
5. Flat ScoreWindow Compilation & Macro/Modulation Precedence
Flat Executable ScoreWindow (crates/core/src/score.rs)
Both offline song compilation (Project::compile_with_flags) and live sliding-ring compilation (Project::compile_live_window_with_audition) produce a single flat, zero-legacy ScoreWindow:
instruments: Vec<ScoreInstrument>— dense0..MAX_INSTRUMENTSarray where eachScoreInstrument { id, name, rack: RackPatch, compiled_zones: Vec<CompiledZoneGraph>, channel }carries pre-compiled Kahn topologically sortedCompiledZoneGraphprograms (1:1 withrack.zones, includingz-1feedback edge flags,lifetime_envs,sampler_slots, and SPOTcolumn_layout).events: Vec<ScoreEvent>&step_ranges: Vec<(u32, u32)>— all scheduled hits flattened and sorted by(step_slot, offset, inst_idx)for O(1) zero-allocation lookup viastep_events(abs_step). EachScoreEventcarries fractionaloffset ∈ [0.0, 0.9999], resolved MIDI note, velocity, gate, inline[ResolvedChordTone; MAX_CHORD_TONES], and(lock_start, lock_len)slice bounds intolocks: Vec<ParamLock>.mod_lanes: Vec<ModLane>— sparse per-step normalized (0.0..=1.0) curves enforcing the Value Rule: unmodulated parameters have no lane, so base patch parameters remain directly authoritative.mixer: Mixer— validated channel strips, inserts, sends, ducks,LiveFlags, pre-compiled customFiltertrigger grids (filter_env_triggers), compiled external filter groove bank snapshot (filter_grooves), andMixerAutomationlanes.required_instrument_ids&provenance: Vec<EventOrigin>— exact set of instruments that actually fire events (for sample readiness checks) and origin records linking every emitted event back to(song_step, lane, placement, part, pattern, instrument, pattern_time, local_exception).
Fast Sound-Only Patch Path (Project::patch_score_sound)
When an edit alters only BPM, Rack patches/modules/cables, mixer strips/effects/sends, or static Macro values without changing note timing or pattern structure, Project::patch_score_sound skips pattern evaluation entirely and calls ScoreWindow::with_sound_updates(bpm, instruments, mixer). It re-applies static Macros, recompiles every ScoreInstrument’s compiled_zones (so CompiledCable.amount reflects static Macro overrides), and re-synthesizes any ChannelSend entries required by existing automated MixerParamTarget::Send lanes so automated send throws survive fast sound updates intact.
Exact Macro & Modulation Precedence
Compilation (crates/core/src/material/compile.rs) and live UI visual projection (crates/app/src/view/live_params.rs) share the exact same 3-tier deterministic precedence order (independent of project.modulations ordering):
- Tier 1 — Static Project Macros (
apply_static_macros): Iteratesproject.macrosin ascendingindexorder (0..8), skipping any macro driven by aModulationTarget::Macro. Evaluatesbinding.evaluate(mac.value) = (min + (max - min) * x).clamp(0.0, 1.0)(explicitly supporting invertedmin > maxspans) and writes directly ontoScoreInstrument.rack(beforeinst.compile_zones()) orMixer.- Frame-based sampler guard: Static Macro bindings targeting frame-based
ModuleParamcontrols (SampleStart,SampleEnd,LoopStart,LoopEnd, matched viaInstrumentParam::is_frame_based()) cannot resolve againsttotal_frames = 0at compile time, so they emit a constantAutomationMode::HoldModLane(unless already overridden by automation) which the audio engine resolves against the loaded sample’s actualsample.frames.
- Frame-based sampler guard: Static Macro bindings targeting frame-based
- Tier 2 — Automated Macro Fan-Out (
ScoreBuilder::write_modulations): Processes allModulationTarget::Macro { index }modulations sorted by ascendingindex(0..8). For each macro binding whose target is automatable (UpdatePolicy != Structural/is_automatable()), fans out the mapped curve intomod_lanesormixer.automations(creating missingChannelSendslots when targetingParamAddress::Send). - Tier 3 — Direct
Modulations: Processes all non-MacroModulationTargets (Instrument,Effect,ChannelGain,ChannelPan,Send), unconditionally overriding any Macro fan-out targeting the same parameter slot viaupsert_mod_lane/upsert_mixer_automation.
Multiplicative ChannelGain Rule
A MacroBinding targeting ParamAddress::Channel { channel, param: ChannelParam::Gain } drives the channel’s fader trim directly (MixerParamTarget::Channel { channel, param: ChannelParam::Gain }, mapped through the +6 dB console power taper). By contrast, a direct ModulationTarget::ChannelGain { channel } compiles to the separate internal target MixerParamTarget::ChannelGainScale { channel }. In MixEngine, channel trim (gain), direct level shape (scale), and event-triggered sidechain ducking (duck) multiply independently (gain * scale * duck), so adjusting a fader trim never fights an authored volume envelope or sidechain pump.
Pure DSP Library, Modular Rack Engine, Studio Effects & Real-Time Audio Contract
This specification defines Cadence’s shared pure DSP core (crates/core/src/dsp/), the unified Eurorack Modular Rack instrument architecture (RackPatch, 11 orthogonal modules, CompiledZoneGraph, and ModularVoice), all 8 studio effects, nested bus routing with Plugin Delay Compensation (PDC), the unclipped 32-bit float signal chain, pan and fader headroom laws, and the lock-free real-time execution contract (crates/engine/src/).
Related specifications: Material & Timing · Decks & Interaction · Protocols & Persistence · Verification
1. cadence-core::dsp — Single Mathematical Source of Truth
All synthesis, filtering, waveshaping, bit-crushing/decimation, dynamics, spatial DSP, pan laws, fader tapers, and decibel math live in one pure, zero-allocation, zero-I/O library: crates/core/src/dsp/. Both cadence-engine (real-time and offline audio) and cadence-app::view (GPU visualizer curves) call the exact same functions, eliminating DSP-vs-UI drift and duplicate math by construction.
| Module | Real-Time Processors | Shared Analytical / UI & Math SPOTs |
|---|---|---|
math.rs | Smoother (1-pole exponential f64) | db_to_lin/db_to_lin_f64, lin_to_db/lin_to_db_f64 (DB_FLOOR_F32 = -120.0, LIN_FLOOR_F32 = 1e-6), log_to_norm, norm_to_log, midi_to_hz, sanitize_sample/f64/frame, flush_denormal_f32/f64 (1e-24), sanitize_sample_rate (1_000..=384_000 Hz), one_pole_coeff_ms/decay_ms, glide_coeff_ms |
gain.rs | apply_strip_gain, apply_fader_gain, apply_pan_balance | pan_mono_equal_power/f64, pan_stereo_balance/f64, norm_to_channel_gain, channel_gain_to_norm, nudge_channel_gain_db, format_db_value, format_gain_db |
noise.rs | NoiseGen (deterministic xorshift + Weyl seeding), PinkFilter (sample-rate-invariant Paul Kellet pink filter) | GOLDEN_RATIO_32, SECONDARY_WEYL_SALT_32 |
osc.rs | oscillator_sample, osc_b_fm, osc_b_fm_2x, step_vco_bank_fm_2x | poly_blep, poly_blamp, phase_wrap, ideal_waveform, unison_offsets, unison_detune_ratio, unison_gain_comp, fm_depth_from_amount, MAX_UNISON = 7 |
env.rs | AdsrState, HoldDecayEnv, ModularEnv (EnvMode::{Adsr, HoldDecay}, pre-delay + multi-burst), RhythmicEnv | eval_adsr_curve, eval_modular_env_curve |
biquad.rs | StereoBiquad, Eq, TptOnePoleLpf, TptOnePoleHpf, DcBlocker | BiquadCoeffs::{highpass, low_shelf, peaking, high_shelf}, BiquadCoeffs::magnitude_db, eq_response_db |
filter.rs | Svf, AcidLadder, RhythmicFilter | svf_transfer, acid_ladder_transfer, one_pole_lpf_transfer, filter_transfer, filter_magnitude, filter_magnitude_db, filter_mix_magnitude_db, acid_accent_amount, acid_filter_decay_ms, filter_velocity_mod |
saturate.rs | Drive (Tape/HardClip/Fold, 2× Halfband2x OS) | soft_clip_drive/f64, drive_shape_mode/f64, drive_shape_mode_asym/f64, asymmetric_drive_shape/f64, drive_transfer_sample, soft_guard/f64 |
lofi.rs | LoFiProcessor (stereo bit-depth quantizer + phase-accumulating clock decimator) | lofi_quantize/f64, lofi_transfer_sample (LOFI_MIN_BITS = 2.0, LOFI_MAX_BITS = 24.0, LOFI_BYPASS_BITS = 23.95, LOFI_MIN_RATE_HZ = 500.0, LOFI_MAX_RATE_HZ = 48_000.0) |
resonator.rs | ModalResonator (sample-rate-invariant stereo 32-mode complex damped phasor bank: String/Bar/Membrane/Plate) | resonator_mode_descriptors (RESONATOR_MODES = 32, RESONATOR_MIN_HZ = 20.0, RESONATOR_MAX_HZ = 12_000.0, RESONATOR_MIN_DECAY_MS = 15.0, RESONATOR_MAX_DECAY_MS = 8_000.0) |
sampler_voice.rs | SamplerVoice (4-point Catmull-Rom Hermite stereo sample voice with loop crossfades & pitch CV) | sample_hermite_stereo |
dynamics.rs | Compressor, Limiter (lookahead) | soft_knee_gr_db/f64, limiter_lookahead_frames, COMPRESSOR_KNEE_DB = 6.0, LIMITER_KNEE_DB = 2.0, LIMITER_LOOKAHEAD_SEC = 0.0015 |
chorus.rs | Chorus, QuadratureLfo | eval_quadrature |
delay.rs | Delay, DelayLine (int/linear/cubic) | Lazy Delay::new_unallocated / allocate |
reverb.rs | Reverb (8×8 Hadamard FDN + 4 diffusers) | reverb_rt60_envelope, reverb_hf_rt60_envelope |
resample.rs | Halfband2x (8-tap polyphase 2× oversampling decimator), resample_stereo | Zero-alloc 2× oversampling for FM & Drive; off-RT Catmull-Rom stereo sample-rate conversion for live audio capture |
2. Unified Eurorack Modular Rack Architecture (crates/core/src/rack/, crates/engine/src/modular_voice.rs)
Every InstrumentInstance owns one unified rack: RackPatch and routes stereo audio to an existing ChannelKind::Audio bus. Single-sound synths and samplers are 1-zone Racks; drum kits and multisamples are N-zone Racks with key/velocity splits and choke groups.
2.1 Rack → Zones → Modules + Patchbay Hierarchy & Parameters
- Rack (
RackPatch): Optionalkit_name,1..=MAX_ZONES(32)RackZones, curated Quick Panel pins (panel_pins: Vec<PanelPin>, up toMAX_PANEL_PINS = 16, pinning anyRack,Zone,Module, orCabletarget), and 5RackParams (allUpdatePolicy::Continuous):Gain(-24..+12 dB),Pan(-1..+1),Tune(-24..+24 st),Cutoff(30..20_000 Hz, log),Resonance(0..0.92). - Zone (
RackZone): Stable nonzeroid: u16,name(1..=32chars), key rangelow_midi..=high_midi,root_midi, velocity layerlow_vel..=high_vel,gain_db(-36..+12 dB),pan(-1..+1), optionalchoke_group(1..=MAX_CHOKE_GROUPS = 8, choking active voices in the same group on the same instrument before spawning new layers),voice: VoiceSettings(voice_mode,legato,glide_ms0..=2000 ms,pitch_tracking,phase_reset),1..=MAX_MODULES_PER_ZONE(24)RackModules (with exactly one mandatoryOutModule), and0..=MAX_CABLES_PER_ZONE(64)PatchCables.- 8
ZoneParams:Gain,Pan(Continuous);Glide,PitchTracking,PhaseReset,RootMidi(OnTrigger);VoiceMode,Legato(Structural— non-automatable, rejected byParamAddress::is_automatable()). - Standard Drum MIDI Map (
rack::drum_midi):36BD,37SD,38LT,39MT,40HT,41RS,42CH (choke 1),43CP,44CB/CR,45CY/RD,46OH (choke 1),47LC,48MC,49HC,50CL,51MA.
- 8
- 4 Neutral Bare Engine Templates (
RackTemplate— zero disk I/O):Synth(Init Synth:VCO 1 -> Filter -> VCA -> Out,Amp Env -> VCA.Cv,Filter Env -> Filter.Cv+ 10panel_pins),Sampler(Blank Sampler:Sampler -> Filter @ 18.5 kHz -> VCA -> Out,Amp Env -> VCA.Cv+ 9panel_pins),Kit(Blank Kit: 1 full-range[Sampler -> Out]zone), andModular(Blank Modular: minimal[Out]canvas).
2.2 All 11 Orthogonal Eurorack Modules (ModuleKind, 62 ModuleParams)
Every module reads summed stereo [f64; 2] signals on its input ports and writes stereo [f64; 2] to OutPort::Out (mono modules write [x, x]; Out is the zone terminal sink):
| # | ModuleKind | Patchbay Column | Accepted InPorts | Parameters & DSP Implementation (cadence-core::dsp) |
|---|---|---|---|---|
| 1 | Vco | 0 (SOURCES) | PitchCv, FmIn, PwCv | Waveform::{Sine, Triangle, Saw, Pulse} (bandlimited PolyBLEP/PolyBLAMP with exact Pulse DC comp), tune ±48 st, fine ±100 ct, pulse_width 0.05..0.95, phase 0..360°, level 0..1, vco_pitch_track (Chromatic/Fixed), fixed_hz 20..20k Hz, unison 1..=7 (MAX_UNISON = 7, unison_gain_comp = 1/sqrt(N), unison_detune 0..50 ct, unison_width 0..1 via pan_mono_equal_power); 2× oversampled signed-dt through-zero linear FM via FmIn |
| 2 | Sampler | 0 (SOURCES) | PitchCv, TrigIn | First-class modular stereo sample player: root_midi, coarse_tune ±48 st, fine ±100 ct, sample_start/sample_end/loop_start/loop_end (frame-based OnTrigger), loop_mode (Off/Forward/PingPong, Structural), loop_xfade 0..100 ms (Structural), one_shot (Structural), level; 4-point Catmull-Rom cubic Hermite playback (sample_hermite_stereo) with audio-rate PitchCv and external TrigIn retriggering |
| 3 | Noise | 0 (SOURCES) | (none) | NoiseColor::{White, Pink} (Paul Kellet 7-pole Pink), TPT highpass_hz 20..18k Hz (TptOnePoleHpf), lowpass_hz 20..20k Hz (TptOnePoleLpf), level; freely patchable pre- or post-filter |
| 4 | Env | 1 (MODULATORS) | TrigIn | ModularEnv composing AdsrState + HoldDecayEnv: env_mode (Adsr/HoldDecay), attack 0.1..10_000 ms, hold 0..500 ms, decay 1..20_000 ms, sustain 0..1, release 1..20_000 ms, trigger_mode (Gate/OneShot), pre-delay delay_ms 0..500 ms, multi-burst bursts 1..=8 & burst_spacing_ms 2..50 ms (native TR-909 clap/flam contours), Acid accent decay snap when modulating AcidLowPass, and 3.5 ms choke fade |
| 5 | Lfo | 1 (MODULATORS) | (none) | LfoShape::{Sine, Triangle, Saw, Square, SampleHold}, free lfo_rate 0.01..40 Hz or tempo-synced (lfo_sync) across 12 LFO_DIVISIONS (1/64..4/1), lfo_retrigger, lfo_bipolar ([-1, 1] vs [0, 1]) |
| 6 | Filter | 2 (PROCESSORS) | In, Cv | 2-pole ZDF Svf (LowPass, BandPass, HighPass), 1-pole 6 dB/oct TptOnePoleLpf (LowPass6), and 4-pole 24 dB/oct nonlinear ZDF AcidLadder (AcidLowPass, ACID_LADDER_K_SCALE = 3.85, ACID_BASS_COMP_SCALE = 0.55, pre-drive soft_clip_drive_f64): cutoff 20..20k Hz (log), resonance 0..0.95, drive 0..1, key_track 0..1, vel_amount 0..4 oct (Acid accent above ACID_ACCENT_THRESHOLD = 0.85, acid_filter_decay_ms, filter_velocity_mod normalized by ACID_FILTER_VEL_MAX = 4.0), mix 0..1, audio-rate Cv in octaves |
| 7 | Drive | 2 (PROCESSORS) | In, Cv | DriveMode::{Tape, HardClip, Fold} backed by drive_shape_mode_asym_f64 (2× oversampled for HardClip & Fold), drive 0..1, asymmetry -1..+1, tone_hz 600..18k Hz (TptOnePoleLpf), output_db -12..+6 dB, mix 0..1, DcBlocker, plus audio-rate Cv modulation |
| 8 | LoFi | 2 (PROCESSORS) | In | LoFiProcessor: continuous mid-tread odd-symmetric bit-depth quantizer bits 2..24 (transparently bypassed at >= 23.95), phase-accumulating zero-order hold clock decimator sample_rate_hz 500..48_000 Hz (bypassed when >= sr), linear dry/wet mix 0..1 |
| 9 | Resonator | 2 (PROCESSORS) | In, PitchCv, Cv | ModalResonator (up to MAX_RESONATORS_PER_ZONE = 4 heap-hosted stereo 32-mode banks per voice): resonator_mode (String/Bar/Membrane/Plate), vco_pitch_track (Chromatic/Fixed), tune ±48 st, fine ±100 ct, fixed_hz 20..12k Hz, structure 0..1, resonator_decay 15..8_000 ms (exact -60 dB RT60), brightness 0..1 (modulatable via Cv), position 0..1, mix 0..1; phase-continuous PitchCv + z-1 nonlinear feedback safe |
| 10 | Vca | 3 (VCA / OUT) | In, Cv | vca_gain 0..2, vca_bias 0..1. When Cv is patched, evaluates in * gain * (bias + cv_sum) — acting as an envelope VCA (Env -> Vca.Cv, bias = 0) or 4-quadrant audio-rate Ring Modulator (Vco -> Vca.Cv). Passes in * gain cleanly when Cv is unpatched |
| 11 | Out | 3 (VCA / OUT) | In, Cv | Singular required terminal zone module (has_output() == false): gain_db -36..+12 dB, pan -1..+1, M/S spread 0..1, optional Cv, DcBlocker, and per-voice soft_guard_f64 (C¹ transparent below ±0.95, strictly for voice anti-blowup) |
Universal Bounded Sample Decoding & SampleBank Keying (crates/core/src/sampler.rs, crates/core/src/rack/types.rs):
- Supports PCM/Float WAV, FL Ogg-in-RIFF WAV, FLAC, Ogg Vorbis, MP3, AIFF, and pure-Rust WavPack
.wvvia Symphonia + custom RIFF chunk parser, bounded byMAX_SAMPLE_FILE_BYTES = 128 MiB,MAX_DECODED_SAMPLES = 33_554_432floats,MAX_CACHE_BYTES = 256 MiB,MAX_LIBRARY_ENTRIES = 25_000,MAX_LIBRARY_SCAN_ITEMS = 100_000, with precomputedPEAK_BINS = 512(min, max)envelope bins. - RIFF
smpl&instchunks automatically populateSampleMetadata(root_midi,has_root,fine_cents,low_midi/high_midi,low_vel/high_vel,SampleLoopMode,loop_start,loop_end) viaSamplerModule::apply_metadata/apply_sample_defaults. - Single Sample SPOT:
RackPatch::sampler_modules()walks everySamplerModuleacross every zone;module_sample_key(inst_id, zone_id, module_id)packs(1 << 63) | ((inst_id & 0x7FFF_FFFF) << 32) | (zone_id << 16) | module_idfor collision-freeSampleBanklookup.
2.3 Ports, Bipolar Attenuverter Cables & CompiledZoneGraph DAG Compiler
Every PatchCable { id, from_module, from_port: OutPort::Out, to_module, to_port: InPort, amount } carries a first-class modulatable bipolar attenuverter depth (cable_amount_range in crates/core/src/rack/modules.rs):
| Target Port | Native Range | Unit | Default | Semantics |
|---|---|---|---|---|
In (Audio) | -2.0..=+2.0 | % | 1.0 | Stereo audio gain / phase inversion (multiple cables sum) |
PitchCv | -48.0..=+48.0 | st | 12.0 | Pitch modulation in semitones (Vco, Sampler, Resonator) |
FmIn | -1.0..=+1.0 | % | 0.35 | Audio-rate through-zero linear FM depth (Vco) |
PwCv | -0.45..=+0.45 | % | 0.20 | Pulse-width modulation (Vco) |
TrigIn | -2.0..=+2.0 | plain | 1.0 | Gate / trigger input (Env, Sampler; defaults to voice gate if unpatched) |
Cv on Filter | -6.0..=+6.0 | oct | 2.0 | Audio-rate cutoff modulation in octaves |
Cv on Vca | -2.0..=+2.0 | % | 1.0 | VCA / 4-quadrant Ring Modulator CV depth |
Cv on Drive / Out | -1.0..=+1.0 | % | 0.5 | Drive / Output CV modulation depth |
Cv on Resonator | -1.0..=+1.0 | % | 0.35 | Modal brightness / high-frequency damping modulation depth |
Deterministic DAG Compilation (compile_zone_graph in crates/core/src/rack/compile.rs):
- Computes Kahn topological execution order on the main thread using deterministic
(column, module_id)tie-breaking acrossPATCHBAY_COLUMNS = ["SOURCES", "MODULATORS", "PROCESSORS", "VCA / OUT"]. - Feedback safety (
z-11-sample delay): Cycles and self-loops never crash or deadlock; any back-edge satisfyingfrom_slot >= to_slotis flaggedfeedback: trueand readsprev_slots[from_slot](soft-bounded viaFEEDBACK_SOFT_KNEE = 4.0inModularVoice). - Emits flat, zero-allocation
CompiledZoneGraph(ops: Box<[CompiledOp]>, contiguousto_slot-groupedcables: Box<[CompiledCable]>, sortedmodule_slot_by_idandcable_index_by_idfor O(log N) lookup,out_slot, reverse-BFSlifetime_envs,sampler_slots, and SPOTcolumn_layout).
2.4 Real-Time Execution (ModularVoice & Unified Voice)
- Zero-alloc, stack-safe voice pool (
crates/engine/src/audio/voices.rs,crates/engine/src/modular_voice.rs): Each of theVOICES = 256slots owns a pre-allocated heap-boxedBox<ModularVoice>with fixed[ModuleState; MAX_MODULES_PER_ZONE],[ModuleParams; MAX_MODULES_PER_ZONE],[f32; MAX_CABLES_PER_ZONE], stereoslots/prev_slots, and inline per-voice P-lock tracking (MAX_VOICE_LOCKS = 32). - Per-sample
f64graph evaluation & Rack bus: RunsCompiledZoneGraphsample-by-sample withCONTROL_FRAMES = 16smooth parameter updates (UpdatePolicy::Continuous), then passes voice output through a dedicated Rack-bus LowPassSvf(transparently bypassed whencutoff >= 19.9 kHzandres <= 0.001),pan_stereo_balance_f64, and unclamped smootheddb_to_lin(rack.gain_db + zone.gain_db)headroom gain. - Voice allocation & audition: Supports polyphonic and per-
(track_id, zone_id)monophonic/legato retargeting with click-freeglide_coeff_msandModularEnv::adopt_progress_from, pre-spawn choke group fades (3.5 ms), P-lock vs continuousModLaneprecedence acrossRack/Zone/Module/Cabletargets, and zero-allocAudioRuntime::preview_rack(patch, midi, velocity).
3. All 8 Native Zero-Alloc Studio Effects
Each bus (Audio, Group, Return, Master) holds up to MAX_INSERTS = 4 inserts, up to MAX_EFFECT_DEVICES = 24 total across the mixer (crates/core/src/mixer.rs). Every effect has smoothed parameters (Smoother), NaN/denormal sanitization, and click-free bypass crossfading (1.5 ms).
| # | EffectKind | Parameters & Native Ranges | DSP Implementation (cadence-core::dsp) |
|---|---|---|---|
| 1 | Eq | hpf 20..600 Hz (log), low -12..+12 dB, mid -12..+12 dB, mid_hz 160..6000 Hz (log), mid_q 0.3..8.0 (log), high -12..+12 dB | 4 cascaded TDF-II StereoBiquads (RBJ 12 dB/oct HPF, Butterworth shelves S=1, peaking mid) with 4 ms coefficient smoothing; exact eq_response_db shared with UI |
| 2 | Filter | mode (LP/BP/HP/Acid LP/LP 6dB), cutoff 20..18k Hz (log), resonance 0..0.95, drive 0..1, env_pattern 0..127 (FILTER_ENV_PATTERN_COUNT = 128), env_pattern_id: Option<Id>, env_amount -4..+4 oct, env_decay 15..1500 ms (log), mix 0..1 | Stereo ZDF Svf + 4-pole AcidLadder + 1-pole TptOnePoleLpf (RhythmicFilter), pre-drive soft_clip_drive_f64, DcBlocker, complex parallel response filter_mix_magnitude_db, plus rhythmic RhythmicEnv driven by sparse-safe O(1) externalized multi-groove banks (presets/filter_grooves.json, 24 clean-room factory grooves, extensible up to 128 slots, 8/16/32 res, length 1..=64, missing IDs fall back to neutral()) or any compiled project Pattern (CompiledFilterPattern, including TimeScale 1/8 & 1/32 normalized Values) |
| 3 | Compressor | threshold -48..0 dB, ratio 1..20 (log), attack 0.5..100 ms (log), release 10..1000 ms (log), makeup -6..+24 dB, mix 0..1 | Stereo-linked feed-forward soft-knee (COMPRESSOR_KNEE_DB = 6.0 dB, soft_knee_gr_db_f64) smoothing gr_db after the gain computer (zero startup lag); exposes live gain_reduction_db & peak-held gr_hold_db |
| 4 | Limiter | ceiling -18.0..-0.1 dB, input_drive 0..24 dB, release 10..1000 ms (log), mix 0..1 | Stereo-linked lookahead brickwall (LIMITER_LOOKAHEAD_SEC = 1.5 ms = 72 frames @ 48 kHz, LIMITER_KNEE_DB = 2.0 dB), O(1) sliding-window peak deque, dB-domain GR smoothing, continuous lookahead advance across bypass for glitch-free PDC |
| 5 | Drive | drive_mode (Tape/HardClip/Fold), drive 0..1, asymmetry -1..+1, tone 600..18k Hz (log), output -12..+6 dB, mix 0..1 | Shared drive_shape_mode_asym_f64 with exact f(x, 0, a) == x and f(0, d, a) == 0 invariants (Tape: asymmetric 0..14× tube/tape bias; HardClip: 1..64.5× crisp C² tanh knee at 0.96 with optional diode curvature + asymmetric +/- clip rails; Fold: West-Coast sine wavefolder with symmetry offset); zero-alloc 2× oversampling (midpoint upsample + TptOnePoleLpf at 0.42·sr + 2-tap decimate) for HardClip & Fold; 3 ms mode crossfade, DcBlocker, tone_lpf |
| 6 | Chorus | rate 0.05..6.0 Hz (log), depth 0..1, width 0..1, mix 0..1 | Dual-voice stereo BBD-style QuadratureLfo (0°..90° spread), cubic Hermite reads from pre-allocated 64 ms DelayLine, 8.5 kHz TptOnePoleLpf warmth, true (1 - mix)·dry + mix·wet crossfade |
| 7 | Delay | delay_mode (PingPong/Stereo), time 0.5..32.0 steps (capped at MAX_DELAY_SECONDS = 12.0 s), feedback 0..0.88, mix 0..1 | Cubic Hermite DelayLine, 30 ms raised-cosine delay-time crossfade (zero Doppler chirp), 8.5 kHz feedback damping; PingPong (mono-seeded L→R→L) vs Stereo (independent L/R preserving panning) blended by 5 ms BIBO-stable ping_pong_blend smoother; lazy off-RT buffer allocation (Delay::new_unallocated) |
| 8 | Reverb | size 0..1, decay 0.2..12.0 s, damping 500..18k Hz (log), predelay 0..120 ms, width 0..1, mix 0..1 | Stereo 8×8 Hadamard FDN + 4 Schroeder allpass diffusers (ALLPASS_GAIN = 0.6), pairwise-coprime integer prime delay lengths quantized for active sample rate, smooth size crossfades, exact -60 dB RT60 envelopes (reverb_rt60_envelope, reverb_hf_rt60_envelope) |
4. Mixer Topology, Nested Group → Group DAG & Chained PDC
MixerEngine (crates/engine/src/mix_engine.rs) routes audio strictly inside fixed, bounded tables:
- Channel limits:
MAX_AUDIO_CHANNELS = 16,MAX_GROUPS = 4,MAX_RETURNS = 4(MAX_MIXER_CHANNELS = 24),MAX_SENDS = 4per Audio/Group channel,MAX_DUCKS = 16(recovery_ms: 10.0..=2000.0 ms, quadratic recovery1 - depth * (1 - x)^2triggered bysource_partevents),MAX_MIXER_AUTOMATIONS = 256. - DAG routing rules (
Mixer::validate):Audiooutputs toMasteror anyGroup.Groupoutputs toMasteror any otherGroup, with an explicit walk rejecting self-loops and multi-hop cycles (Group A → Group B → … → Group A).Returnoutputs strictly toMasterand may not hold outgoing sends.
- Causal topological execution & ancestor mute/solo: On every
adopt(),MixerEnginecomputes a zero-allocation Kahn topological order (group_order) for chained groups and resolves ancestor-awaresource_enabled: muting a parentGroupsilences all descendants; soloing a child Audio/Group keeps its ancestor chain open. - Parallel-path Plugin Delay Compensation (PDC): Sums
Limiter::latency_frames()on each Audio, Group, and Return branch and across chainedGroup → Grouphops, computing exact differentialpdc_delayframes applied via integerDelayLinereads (apply_pdc) before summing into parent Groups orMaster. When no non-Master Limiter exists, everypdc_delay == 0(zero latency overhead).
5. 32-Bit Float Signal Chain, Pan Laws & +6 dB Headroom
32-Bit Float Headroom & Clipping Semantics
- Zero hidden Master soft-clipping: All internal instruments, buses, sends, returns, and Master inserts run in unclipped 32-bit floating point with no hidden
tanhor soft-clipper behind Master. - Strict final boundary clamping: Samples are clamped to
[-1.0, 1.0]only at the hardware DAC sample conversion boundary (crates/engine/src/audio/runtime.rs) and the 16-bit PCM WAV export boundary (crates/engine/src/audio/render.rs, preceded by a5 mslinear fade-out at the end of rendered WAVs). hotvsclippedmetering (MeterState::observe):hotlatches on any channel (including Master) whenever|input| > 1.0or|output| > 1.0(> 0 dBFSinformational 32-bit float headroom — not audible clipping on internal buses).clippedlatches strictly when a non-finite (NaN/±Inf) sample appears anywhere OR Master post-insert post-fader output exceeds1.0(> 0 dBFSat the DAC/WAV boundary).
- Preview isolation: Sample/preset preview audio sums after Master mute and Master strip so muting Master never silences browser auditioning.
Dual Pan Laws (crates/core/src/dsp/gain.rs)
- Mono constant-power pan (
pan_mono_equal_power): $$\theta = (p + 1)\frac{\pi}{4}, \quad [L, R] = [\cos\theta, \sin\theta], \quad L^2 + R^2 = 1.0$$ Delivers-3.01 dB([0.7071, 0.7071]) at center (p = 0.0) and exact[1, 0]/[0, 1]at hard L/R. Used for mono voice sources (Vcounison copies, zone/Outmono panning). - Unity-normalized equal-power stereo balance (
pan_stereo_balance):p = 0.0→[1.0, 1.0](exact unity pass-through for centered stereo buses).p > 0.0→ $[\tan((1 - p)\pi/4), 1.0]$;p < 0.0→ $[1.0, \tan((1 + p)\pi/4)]$.- Strictly bounded in
[0.0, 1.0](never boosts an already full-scale stereo bus) while matching the exactL/Rratio ofpan_mono_equal_power(-3.50 dBatp = 0.25,-6.02 dBatp = 0.41,-7.66 dBatp = 0.50). Used for Rack-bus stereo pan and stereo mixer strips/buses (apply_strip_gain).
+6 dB Mixer Fader Headroom SPOT (dsp/gain.rs, params.rs)
- Linear gain range:
0.0..=MAX_CHANNEL_GAIN(2.0,MAX_CHANNEL_GAIN_DB = 6.0). - Console power taper (
norm_to_channel_gain/channel_gain_to_norm): $$g(n) = 2.0 \cdot n^{p}, \quad p = \frac{\ln 2}{\ln(4/3)} \approx 2.4094208$$ Maps0.0 → 0.0(-inf dB),CHANNEL_GAIN_UNITY_NORM = 0.75 → 1.0(0.0 dBexact unity detent), and1.0 → 2.0(+6.02 dB). - Unified nudging, formatting & parsing:
nudge_channel_gain_db(gain, delta_db): steps in dB across-60..=+6.0 dB, snapping< -60 dBto0.0(-inf), stepping up from0.0at-60 dB, and snapping|db| < 1e-4to exact1.0.format_db_value/format_gain_db: formats"-inf"belowLIN_FLOOR_F32and normalizes"-0.0"to"+0.0".parse_channel_gain: accepts"-inf"/"-inf dB","±N dB"(<= +6.021 dB, snapping0 dB → 1.0),"0%..200%", or linear"0.0..2.0".
6. Real-Time Safety Invariants & Lock-Free Execution (crates/engine/src/audio/)
Cadence enforces strict real-time safety on every audio callback and silent-clock frame:
| Invariant | Enforcement Mechanism | Exact Constants / Structures |
|---|---|---|
| Zero RT heap allocations | Verified directly under #[global_allocator] CheckedAllocator in crates/engine/src/mix_engine/tests.rs (including ModularVoice & Engine::next_frame) | All publications swap pre-allocated boxes via AtomicBoxSlot<ProjectPublication> (2 retirement slots dropped strictly on the control thread); Delay buffers pre-allocated off-RT in extra_delays |
| Zero RT locks & panics | No Mutex, RwLock, unbounded mpsc, .unwrap(), .expect(), or panic! on audio paths | Lock-free AtomicU64 / AtomicPtr / AtomicU32 / AtomicBool mailboxes with Acquire/Release ordering |
| Debug stack safety | Large engine structs heap-boxed; verified by cargo test -p cadence-engine --lib | Box<MixerEngine>, Box<[Voice]> (VOICES = 256, each owning Box<ModularVoice>), Box<[Option<PendingSubEvent>]>, Box<[HeldNotes]>, Arc<Shared> |
| Sub-step frame scheduler | Zero-alloc pending sub-step event queue firing at exact fractional sample frames | SUB_EVENT_QUEUE = 256 slots, each carrying up to MAX_INLINE_LOCKS = 16 inline ParamLocks (MAX_VOICE_LOCKS = 32 per active ModularVoice) |
| Lock-free control mailboxes | Bounded atomic slots bridging UI/MIDI/host to audio thread | MAILBOXES = 64 live note/MIDI slots, TRANSPORT_MAILBOXES = 16 transport intents (TRANSPORT_STEP_MASK = 40 bits), tear-free pack_step_position (48-bit step + 16-bit frac) |
| Control rate & click suppression | Fixed control block + click-free voice-steal fades | CONTROL_BLOCK = 64 frames (mixer/mod lanes), CONTROL_FRAMES = 16 (ModularVoice), STEAL_FADE_SLOTS = 8 (2 ms fadeout), METER_PUBLISH_STRIDE = 256 |
| Lock-free live audio input & recording | CPAL input callback writes strictly to bounded lock-free SPSC rings with zero disk I/O or locks on RT threads | Stereo monitor ring feeds post-master monitor (Off/Auto/On) with hardware sample-rate resampling; capture ring drains off-thread to 24-bit WAV with latency trim (-100..+100 ms) |
| Lock-free live audio tap ring | SPSC ring buffer written by audio callback only when tap_enabled == true, drained off-RT by AudioTapHandle (cadence ctl listen --live) | AUDIO_TAP_CAPACITY = 1 << 18 (262_144 stereo frames ≈ 5.46 s @ 48 kHz, heap-boxed) |
| Audio host & silent fallback | Multi-format CPAL stream (F32, F64, I32, I16, U16, 8_000..=384_000 Hz) with disconnect detection (is_failed()) & restart_device(), or paced --silent thread | SILENT_RATE = 48_000 Hz, SILENT_BLOCK = 256 frames, WAVE_SAMPLES = 256 scope samples |
Automation Protocols, Live --ctl Socket, Takes, Presets & ReBirth .rbs Import
This specification defines Cadence’s external interfaces and on-disk contracts: the unified JSONL host protocol (--script, --stdio, --ctl), the live GUI Unix control socket, key-script replay, crash-safe performance takes, external presets and --render-kit, and the clean-room ReBirth RB-338 .rbs importer.
Related specifications: Material & Timing · DSP & Audio Engine · Decks & Interaction · CLI & Scripting Guide
1. Unified JSONL Host Protocol (--script, --stdio, --ctl)
All three machine-control surfaces share one request envelope (HostRequest) and one dispatch function (execute_host_request) in src/host/protocol.rs:
- Line framing: Newline-delimited UTF-8 JSON; blank lines are ignored. Maximum line length is
MAX_REQUEST_BYTES = 65_536(64 KiB). Oversized lines return{"ok": false, "error": "JSONL request exceeds 64 KiB"}without dropping the connection. - Request envelope (
#[serde(deny_unknown_fields)]):
Exactly one operation field must be present per request:{ "id": "optional-client-token", "expected_revision": 12, "compact": true, "action": { "op": "set_tempo", "bpm": 132.0 } }action— a typedcadence_app::Action(#[serde(tag = "op", rename_all = "snake_case")]), includingget_state,edit,transaction(atomic up to16_384Edits),create_*(create_instrument/placed_parttaking unifiedSoundChoice::{template, preset, sampler, folder}),set_param(ParamAddress::{rack, zone, module, cable, channel, send, effect}),set_rack,rack_add_module/rack_remove_module/rack_rename_module,rack_connect_cable/rack_disconnect_cable/rack_set_cable_amount,rack_pin_control/rack_unpin_control,load_preset,set_macro/rename_macro/bind_macro/unbind_macro/clear_macro,zone_*,launch/release/toggle_lane/stage/finish_staging/advance,bounce(BounceTarget::{new_sampler, rack_zone}),save/load/export(plusimport_rbswhen built with--features rbs), andcommand.cmd— a Cadence Ex command string (dispatched identically toAction::Command { line }, pushing onto the interactiveuundo stack).meters: true— returns live playback status, channel meters (input_peak,input_peak_hold,output_peak,output_peak_hold,hot,clipped), and Compressor/Limitereffect_meters(device_id,gain_reduction_db,gr_hold_db).listen— structured audio capture (ListenRequest::BarsorListenRequest::Live; see §2).
- Optimistic concurrency (
expected_revision): If supplied andexpected_revision != app.revision(), the request is rejected without side effects (ok: false,"Revision conflict: expected X, current Y"). Entity IDs (Id = u64) are monotonically allocated and never recycled across undo/redo. - Full vs. compact responses:
compact: false(default): returns{ id, ok, revision, message, status, dirty, bpm, project, flags, selection, inspection, ready, sample_issues, required_sample_issues, audition, follow, live, transport?, export? }.compact: true: omitsproject/flags/selectionfor fast polling, returning{ id, ok, revision, playing, step, bpm, status, message, dirty, ready, channel_meters, effect_meters, inspection?, transport?, export? }.
- Execution modes:
--script FILE: Headless offline execution (audio: None). Successful requests remain applied if a later request fails; process exits non-zero when any request fails.--stdio: Live engine mode (hardware CPAL or--silent). A reader thread decouples stdin reads so the host ticksobserve_transporteveryIDLE_TICK = 16 mswhile idle, landing boundary changes and sliding the live ring without waiting for input.
2. Live GUI Unix Control Socket (--ctl & cadence ctl)
Launching the GUI with --ctl [<SOCK>] binds a local Unix domain control socket (src/host/ctl.rs) wired directly into the live winit event loop so external tools and AI co-producers can inspect, edit, and audition the live session interactively.
Socket Lifecycle, Security & Path Resolution
- Default socket &
SUN_LENshort-path fallback (SessionDir::ctl_socket_pathincrates/core/src/store.rs): Defaults to<session_dir>/ctl.sock. On Unix, if the path exceedsMAX_UNIX_SOCKET_PATH_BYTES = 96bytes (safely below macOS’s 104-bytesun_pathlimit), it hashes the session root with FNV-1a 64-bit to<temp_dir>/cadence-ctl-<hash16>.sock(falling back to/tmp/cadence-ctl-<hash16>.sock). - Owner-only permissions & liveness checks: Refuses to overwrite non-socket files; probes existing sockets with
UnixStream::connectto reject a second live server before unlinking any stale socket; binds with0o600mode bits. - Non-blocking GUI integration: Accepts connections on
cadence-ctl-acceptand enqueues parsed requests over a boundedCTL_QUEUE_CAPACITY = 32sync_channel(CLIENT_IO_TIMEOUT = 40 s), invokingset_wake(EventLoopProxy) so requests execute immediately even when the window is idle or occluded. DroppingCtlServerstops the listener and deletes both the socket and any auto-generatedear.wav. - Client discovery (
resolve_ctl_socket): Checks in priority order: (1)--sock PATH, (2)--session-dir DIR, (3)CADENCE_CTL_SOCKenvironment variable, (4) newest live socket under<platform_state_dir>/sessions/*/ctl.sock.
cadence ctl CLI Subcommands (src/main.rs)
| Subcommand | Request Dispatched | Notes |
|---|---|---|
cadence ctl state [--compact] | action: GetState | Full or lightweight telemetry snapshot |
cadence ctl meters | meters: true | Live channel peaks/holds/hot/clipped + Comp/Limiter GR |
cadence ctl cmd <LINE> [--expected-revision N] [--compact] | cmd: LINE | Runs any Ex command on the live GUI (undoable via u) |
cadence ctl action <JSON> [--expected-revision N] [--compact] | action: JSON | Runs any typed Action JSON object |
cadence ctl listen --bars A..B [--solo ...] [--sr HZ] [--out PATH] | listen: { mode: "bars", ... } | Offline deterministic render of 1-based half-open A..B or inclusive A..=B (up to MAX_LISTEN_BARS = 256, default 24_000 Hz, range 8_000..=192_000 Hz) from live in-memory state; --solo accepts channel/lane/instrument names or IDs temporarily without mutating GUI flags; returns per-bar & overall peak/RMS/clip/channel/effect metrics |
cadence ctl listen --live SECONDS [--sr HZ] [--out PATH] | listen: { mode: "live", ... } | Captures 0.25..=30.0 s of real-time speaker output from AudioRuntime’s lock-free SPSC stereo tap ring (AUDIO_TAP_CAPACITY = 262_144 frames) on a background cadence-live-listen thread (LiveListenJob, guarded by atomic live_tap_busy + RAII TapBusyGuard), resamples via dsp::resample_stereo, writes 16-bit WAV atomically, and returns { path, sample_rate, source_sample_rate, frames, duration_sec, peak_db, rms_db, clipped, full_scale_samples, dropped_frames } |
3. Headless Key-Script Replay (--key-script)
--key-script FILE (src/host/script.rs) replays deterministic keyboard sessions directly through cadence-app’s input router. Lines are JSON objects (blank lines and # comment lines are skipped):
{"label": "Enter Jam and advance 2 bars", "keys": "gj ", "advance": "2 bars", "expect": {"mode": "JAM", "playing": true, "/bpm": 136.0}}
keys— parsed bycadence_app::parse_key_sequence, supporting chord tokens (<c-s-j>,<c-s-p>,<m-enter>,<m-h>,<c-a>,<c-r>,<esc>,<enter>,<tab>,<s-tab>,<space>,<home>, etc.). Note that:opens the Fuzzy Action Palette (Mode::Palette) whose top▶ Run command:passthrough slot executes recognized Ex command lines onEnter.advance(optional) — duration string parsed bycadence_app::parse_duration(e.g.,"2 bars","4 beats","16 steps") to advance the headless live transport clock.expect(optional) — map of assertions checked afterkeysandadvance:- Plain keys match controller summary fields (
title,patterns,instruments,parts,lanes,placements,channels,sections,ducks,revision,dirty,ready,mode,draft_open,value_entry_open,step,playing,active,pending,lane_parts,workspace). - Keys starting with
/are evaluated as RFC 6901 JSON Pointers against the serializedProjectJSON.
- Plain keys match controller summary fields (
4. Crash-Safe Take Journal & Atomic Session Storage
Bounded Atomic Storage (crates/core/src/store.rs)
- Bounded reads (
store::read_bounded): Checksmetadata().len() <= max_bytesand caps reads viaFile::take(max_bytes + 1)before allocating memory. - Atomic writes (
store::write_atomic/write_atomic_bytes): Rejects payloads overmax_bytesbefore touching disk, creates a unique sibling temp file.name.<pid>.<counter>.tmp(create_new(true)), flushes +sync_all(), atomicallyrenames over destination, andfsyncs the parent directory on Unix. - Per-project
SessionDir(<platform_state_dir>/sessions/<stem>-<fnv1a64>/or--session-dir):lock(InstanceLock): exclusive PID lock rejecting concurrent live editors while cleaning stale locks left by dead PIDs.recovery.json(MAX_RECOVERY_BYTES = 16 MiB): periodic atomic autosave restored non-destructively via--recover(never overwrites the user’s project file on disk).takes/: armed session take journals (explicitly armed viatr/:take arm, default OFF, or opt-in viaUserConfig::auto_record_takes), pruned toDEFAULT_UNKEPT_TAKES = 20.
Crash-Safe .take.jsonl Format (crates/core/src/take.rs)
A take records the exact score of a performance (TAKE_VERSION = 1, MAX_TAKE_BYTES = 32 MiB) as newline-delimited JSON whenever take recording is armed (Action::ToggleTakeArmed / Action::SetTakeArmed / UserConfig::auto_record_takes; Action::DiscardTake discards an unsaved take; TakeJournal::is_capped() surfaces a live ● TAKE CAPPED warning badge if the in-memory cap is reached):
- Header (line 1):
TakeHeader { take: 1, title, start_step, active: Vec<Override>, project: Box<Project>, flags?, segment? }(wheretake: 1andprojectare validated strictly againstTAKE_VERSION = 1andProject::VERSION = 1). - Events & marks:
TakeEvent { at: u64, label, change: TakeChange }(Launch,Release,ReleaseAll,Flags,Edits,Replace,Segment) interleaved with periodic transportTakeMark { mark: u64 }heartbeats. - Seal line:
TakeEnd { end: u64 }followed bysync_data().
Off-thread streaming: open_disk_journal_sink spawns a dedicated cadence-take-journal background thread so live UI/audio loops never stall on disk I/O; in-memory tests substitute MemoryJournalSink. Unsealed files left by a hard crash remain valid up to their last flushed event or mark. Offline --take FILE --render OUT.wav --take-tail-bars N folds every event through the exact same PerformanceState::apply transition as live playback, producing bit-identical WAV renders.
5. External InstrumentPreset Schema (v1), PresetCatalog & --render-kit
Unified External InstrumentPreset (crates/core/src/presets.rs)
Zero instrument presets are compiled into the binary; only the 4 bare neutral engine templates (Init Synth, Blank Sampler, Blank Kit, Blank Modular via RackTemplate::{Synth, Sampler, Kit, Modular} and InstrumentPreset::bare_default) live in code. Every external preset .json (INSTRUMENT_PRESET_VERSION = 1, MAX_PRESET_BYTES = 512 KiB, #[serde(deny_unknown_fields)]) shares one unified RackPatch schema:
{
"version": 1,
"name": "TR-808",
"category": "Kit",
"patch": {
"kit_name": "TR-808",
"zones": [
{
"id": 1,
"name": "BD",
"low_midi": 36,
"high_midi": 36,
"root_midi": 36,
"modules": [ "...RackModule..." ],
"cables": [ "...PatchCable..." ]
}
],
"panel_pins": []
}
}
name:1..=80printable non-control characters; optionalcategory:1..=48characters (conventional categories"Synth","Sampler","Drums","Kit","Modular"backing the Preset Browser’s 6 category filter tabsAll/Synth/Sampler/Drums/Kit/Modular).PresetCatalog: Discovers.jsonpresets across configuredUserConfig::preset_dirs, CLI--preset-dir, and project-adjacent directories (MAX_PRESET_FILES = 2_048,MAX_PRESET_SCAN_ITEMS = 16_384), exposingby_category,find,find_by_category,is_bare_default_token, andnames_hint. Missing or empty roots degrade cleanly with zero errors.normalize_preset_keymaps common short aliases (808/tr808→tr-808,909/tr909→tr-909,edm/edmkit/kit→edm-kit,303/acid/tb303/tb-303→acid-303,lead→pulse-lead,pad→warm-pad,bass/sub→sub-bass,hat→closed-hat).
Provenance Factory Kit Builder (--render-kit — src/host/kit_render.rs)
cadence --render-kit source-kit.json \
--out-samples factory-samples/my-kit \
--out-preset presets/kits/my-kit.json \
[--kit-name "My Kit"] [--sample-rate 48000]
For each unmuted ChannelKind::Audio channel of the source project:
- Solos and renders the channel in 32-bit float (
render_schedule_f32) with 1:1 baked-vs-synth loudness parity, rejecting silent or clipped voices. - Trims leading silence at
ONSET_THRESHOLD = 1e-6, trims trailing silence atTAIL_THRESHOLD = -72 dBFS(0.00025118864) plus aTAIL_FADE_MS = 2.0 mshalf-cosine tail fade, and writes mono WAVs automatically when|L - R| < MONO_EPSILON = 1e-5. - Writes each 16-bit PCM WAV atomically via
cadence_core::sampler::write_wav_with_metadata, embedding both RIFFinst(7-byte MIDI unity note, fine tune, key & velocity range) and RIFFsmpl(unity note, pitch fraction, and optional loop points) chunks. - Maps canonical drum channel names (
BD,SD,CH/OH→ choke group1, etc.) torack::drum_midi(36..=51), anchors portable sample locators atfactory-samples/..., builds 1-basedRackZone::sample_padzones ([Sampler -> Out]), and writes the validatedv1RackInstrumentPresetJSON (category: "Kit").
6. Clean-Room ReBirth RB-338 .rbs Import Contract
crates/formats/src/rbs/ (cadence-formats, gated behind feature = "rbs", enabled by default in the root cadence binary) implements a clean-room MIT binary parser and converter invoked via --import-rbs FILE, --project FILE.rbs, :import-rbs, or FileHub.
- Bounded inputs:
MAX_RBS_BYTES = 16 MiB,TICKS_PER_BAR = 768,POS_PER_BAR = 32(32nd-note automation resolution),MAX_RBS_POS = 32_000(1000 bars).peek_rbs_headerreads title/version/BPM/mode metadata for File Hub previews without full decoding. - Supported binary formats:
- ReBirth 1.x (
MThd): Standard MIDI File with a 7-bit-packedTinYSysEx block → creates 3 instruments & 3 lanes (TB-303 A,TB-303 B,TR-808; omits absentTR-909). - ReBirth 2.0 (
CAT .... RB40, file versions4.0,4.1,4.2): IFF container → creates 4 instruments & 4 lanes (addingTR-909with flam subdivisions encoded asPatternKind::Mini).
- ReBirth 1.x (
- Target Modular Rack & Mixer Mapping:
TB-303 A/B→ canonical 6-module AcidRackPatch(Vco -> Filter(AcidLowPass) -> Vca -> Out,Amp Env -> Vca.Cv,Filter Env -> Filter.Cv) with curatedpanel_pins, officialsong.vintageshorter filter-envelope decay scaling, mono legato glide, 2-step slide-into-rest ties, and cross-bar/cross-segment Song Mode slide lookahead.TR-808/TR-909→ multi-zoneRackkits resolved from externalPresetCatalogwith Global Accent (ctrl 2) velocity calibration, BPM-accurate TR-909 flams (10..=42 ms/step_ms),PatternKind::Stackoverflow safety for dense>6-voice simultaneous hits, and TR-808 primary/alt voice switch timelines (LT/MT/HT/RS/CPvsLC/MC/HC/CL/MA; missing external presets degrade gracefully with non-fatalRbsImportSummary::notices).- Mixer & FX:
SynthsandDrumsGroup buses; Master Level (ctrl 0) automation viaChannelGain { channel: ChannelRef::Master }; v4.2 per-channel Enable/Mute (ctrls 5,11,17,23) composed with channel gain;EchoReturn usingDelayMode::Stereo(straight 16ths / eighth-note triplets4/3x) fed via post-fader, pre-strip-panChannelSend+ModulationTarget::Send;DistusingDriveMode::HardClipwith synced output trim; PCF → rhythmicFilterreferencingpresets/filter_grooves.json;Comp→Compressor(zero auto makeup gain). - Musical structure & automation: Declarative per-device control tables (
controls.rs), deduplicated shared patterns, derivedPart.transposefor transposed 303 motifs, full launchpadlane.parts, Global Shuffle viaPatternKind::Swing, event-driven sub-bar Song Mode placements preserving bar-locked/odd-length phase, automatic section detection, and jump-vs-sweep compressedValuesautomation curves (targeting(zone, module, param)and(zone, cable)cleanly while leavingproject.macrosempty so direct edits respond immediately).
Architectural Design Decisions
The engineering principles and architectural trade-offs that govern Cadence. Detailed wire formats, bounds, and DSP formulas live in Specifications.
1. Retained Material Graph as Saved Truth
- Musical definitions outlive clips: Persisted
Project(version = 1) documents store independent patterns, retained derivations, parts, placements, sections, unified Eurorack Modular Rack instruments, mixer topology, modulations, ducks, and macros — never flattened MIDI clips or baked audio. Changing one chord or motif propagates live to every derived layer unless explicitly forked or frozen. - Equal status for literal, derived, and
:minimaterial: All 22PatternKindvariants compose inside one bounded DAG (MAX_DEPTH = 32), share pure stateless evaluation (det_hashSplitMix64 + fractional sub-stepoffset ∈ [0.0, 1.0)), and edit through the same decks and Ex commands. Fork preserves dependency links; freeze captures a bounded literal snapshot;'(From here) scopes an edit to a bar boundary without breaking earlier sections. - Compiled scores are private execution artifacts:
ScoreWindowis an internal flat buffer optimized for O(1) zero-allocation real-time playback and offline rendering, never a persistence or compatibility format.
2. Zero-Legacy Pre-Release Discipline
- Clean replacement over shims: Cadence carries zero schema migration converters, backwards-compatibility aliases, or dead-code fallbacks. When a domain model, parameter curve, or UI contract is wrong, it is replaced cleanly and every caller, test, and showcase example is updated together.
- Strict deserialization: Domain structs enforce
#[serde(deny_unknown_fields)]so typos or stale fields fail loudly at load time instead of silently dropping musical data.
3. Pure cadence-core::dsp Single Point of Truth (SPOT)
- One math implementation for audio and visuals: Every filter transfer function (
Svf,AcidLadder,TptOnePoleLpf, complex parallel dry/wet mix), 4-band EQ response, multi-modeDrivewaveshaper,Halfband2x2× oversampling filter, sample-rate-invariantNoiseGen/PinkFilter/ModalResonator,LoFiProcessor,ModularEnv(Adsr/HoldDecay+ pre-delay + multi-burst), 7-voice PolyBLEP/FM oscillator math,SamplerVoice, soft-knee dynamics gain computer, RT60 tail curve, quadrature LFO, pan law, fader power taper,-60 dBdecay coefficient (decay_coeff_60db_ms), and dB formatter lives once incrates/core/src/dsp/with zero I/O and zero heap allocation. - Structural impossibility of drift: Both
cadence-engine(real-time DSP) andcadence-app::view(GPU curves and readouts) callcadence_core::dsp::*directly, andcrates/app/src/view/live_params.rsmirrors the exact 3-tier Macro/Modulation precedence ofcrates/core/src/material/compile.rs.
4. Unclipped 32-Bit Float Headroom & Console Gain Staging
- No hidden Master soft-clipping: Internal channels, groups, returns, and Master inserts run in uncolored 32-bit float with zero hidden
tanhor limiter behind Master. Clamping to[-1.0, 1.0]happens strictly at the final CPAL hardware DAC conversion and PCM WAV export boundaries. - Clear
hotvs.clippedmetering: Internal float buses exceeding0 dBFSlatch informationalhot(recoverable headroom via faders or a Master Limiter);clippedlatches strictly on non-finite samples anywhere or Master post-fader output> 1.0. - Independent gain factors &
+6 dBheadroom: Channel trim (0.0..=2.0,CHANNEL_GAIN_UNITY_NORM = 0.75console power taper), directModulationTarget::ChannelGain(ChannelGainScale), and event-triggered sidechainDuckenvelopes multiply independently (gain * scale * duck). Mono sources use constant-power panning (pan_mono_equal_power); stereo mixer buses use unity-normalized equal-power balance (pan_stereo_balance) so centered buses pass at exact[1.0, 1.0]unity.
5. Unified Eurorack Modular Rack & Compile-Time Mixer Invariance
- One orthogonal instrument architecture (
RackPatch): Instead of maintaining siloed, non-interoperable instrument engines, everyInstrumentInstanceowns one unified Eurorack ModularRack(Rack → Zones → Modules [Panel] + Patchbay) composed from 11 orthogonal modules (Vco,Sampler,Noise,Env,Lfo,Filter,Vca/RingMod,Drive,LoFi,Resonator,Out), bipolar attenuverter cables, and deterministicz-11-sample feedback compilation. A 1-zone subtractive or 2× through-zero FM synth, a plucked physical-modeling string/bar/plate instrument, a single-sample player, a hybrid analog+sample 32-zone drum kit with 8 choke groups, and a feedback-patched modular voice all run through one zero-allocModularVoiceengine and one orthogonal parameter space (InstrumentParam::{Rack, Zone, Module, Cable}). - Structural Rack & mixer invariance: Every Rack zone enforces
1..=24modules (MAX_RESONATORS_PER_ZONE = 4) with exactly one mandatoryOutmodule (AddRackModule/RemoveRackModuleboth protectOut), validated port compatibility, and atomic pruning of stalepanel_pins,modulations,parameter_links, andmacro.bindingson zone/module/cable removal. On the console side, aChannel’sChannelKind(Audio,Group,Return) and anEffectDevice’sEffectKindare immutable for the lifetime of their ID via typed mixer/effect edits (CreateChannel,UpdateChannelMeta,AddEffect,RemoveEffect,MoveEffect,UpdateEffect).
6. Pure Zero-IO Controller (cadence-app + HostIo)
- Strict crate separation:
cadence-appdepends solely onanyhow,cadence-core,cadence-formats(feature-gatedrbs),serde, andserde_json— no audio backend, no MIDI backend, no windowing, and no directstd::fs/std::envaccess. All host I/O flows throughHostIo(CoreHostIoon disk,MemoryHostIoin pure tests). - One controller, every surface: Interactive keyboard input, hardware MIDI,
--key-script,--script,--stdio, and live GUI--ctlUnix socket requests all converge ontoApp::apply(Action)and one unifiedHostRequestprotocol (src/host/protocol.rs).
7. Keyboard-First Native GPU Decks, Modeless Grammar & Hermetic Typography
- GPU presentation over
FrameView:cadence-appprojects immutable semanticFrameViewsnapshots;cadence-guirenders them on nativewgpu+glyphonthrough a single painter-orderedDisplayListwith balanced scissor clipping, selective phosphor bloom, sharedcable_graph.rsmulti-column Bezier rendering (powering both the Project Signal Graph and Eurorack Instrument Patchbay with ASCII"z-1"feedback badges), embedded cross-platform app icons (icon.rs), and zero hardcoded RGBA values outsidecrates/gui/src/theme.rs(Cadence Dark,Midnight Neon,Studio Light). - Hermetic 2-face embedded typography:
GpuRendererbuilds a self-containedFontSystembacked exclusively by bundledJetBrains MonoRegular (400) and Bold (700) with zero OS font scanning or proportional fallback, and disables programming ligatures (calt/liga/clig/dlig) so keyboard hints like-/=,!=,->, and</>always shape into literal monospace glyphs across platforms. - Modeless 4-tier keyboard grammar & screen-axis alignment:
h/j/k/l(andH/J/K/L) strictly navigate and switch tabs across every deck — zero accidental mutations.Alt+h/j/k/l(Alt+H/J/K/Lcoarse) directly sculpt and reorder items along their visual screen axis with coalesced single-gesture undo, paired with one-hand,/.(</>coarse) scalar adjustments andAlt+Backspacereset.- Six deck layout alignments keep every control list, Rack
Zonesstrip, BankPartsrow, Mixer vertical slot stack, Macros horizontal dial strip, andAudio | MIDIDevices inspector strictly aligned 1:1 with the visual axes. - Only genuine input modes remain:
Insert(ion Pattern Notes), modalJam(gj/Ctrl+Shift+j), exactValueInput(Enter), and live-validatedMiniEditor(EnteronMini).
- Discoverable modals over blind Ex typing:
- Fuzzy Action Palette (
:/Ctrl+Shift+p): Replaces blind GUI Ex mode with fuzzy search over actions, decks, layouts, 8 quick-add FX, themes, and dynamic project objects — while preserving a live top-slot▶ Run command:passthrough so power users,--key-script, andcadence ctl cmdwork without friction. - First-class sound & song dialogs: Unified 6-category Instrument Preset Browser (
P) (All/Synth/Sampler/Drums/Kit/Modular+ 4 bareRackTemplatedefaults) with live non-destructive preview from a fullProjectsnapshot (zero undo trace onEsc, single transaction onEnter), Song Properties (gP/Ctrl+Shift+i) spanning all 13NAMED_SCALES, dedicated live-validated Mini-Notation Editor,Samplersample assignment viaB/Samplerow (auto-insertingSampler -> Out.Inand applying RIFFsmpl/instmetadata), unifiedAudio | MIDIDevices deck (gd/Ctrl+d), and universal/search.
- Fuzzy Action Palette (
- Derived layout state & MIDI symmetry: Workspace, focus, and deck-gating queries compute purely from
Layoutwith zero duplicate shadow fields. Data-driven MIDI profiles (generic,standard_cc,minilab3_daw) map hardware encoders, pads, and OLED/RGB feedback onto the same session actions.
8. Single-Clock Live Performance, 24-Bit Recording & Crash-Safe Takes
- Performing over the arrangement: One monotonic transport clock (
Timeline) drives both song playback and live performance. Launching a part overrides only its lane (claiming any shared instrument) while every other lane continues playing the arrangement; releasing restores the arrangement and keeping writes the override back into it. - Quantized boundaries & human feel: Section jumps land at pass end so loop cycles stay exact; launches, releases, and live song edits land on configurable
Boundarysteps withlate_tolerance_stepscatching just-late presses;StagedChangebatches multiple moves onto one downbeat. - Live 24-bit audio recording into the material graph: Hardware audio input (
ta/tA/ti/:rec) streams lock-free through SPSC capture and monitor rings, converts cleanly across mismatched hardware sample rates, writes a portable 24-bit WAV, and commits aSamplerRack + Part + Placement atomically onto the undo stack. - Live flags outside undo: Lane and channel mute/solo (
LiveFlags) are saved as left, never enter undo history, and never bump song revisions. - Explicitly armed Takes as performance scores: Take recording defaults to OFF (
trtoggles arming live; Chrome displaysTAKE ARM/● REC TAKE (N)/● TAKE CAPPED;Auto-Record Takesin Settingsg,restores opt-in always-on capture) so routine playback never litters session folders. When armed, an off-thread.take.jsonljournal (TAKE_VERSION = 1) captures landed changes (never raw audio) alongside the startingv1project, survives hard crashes up to the last flushed event, supportsvVisual range marking andXconfirmation-guarded discard ingt, renders bit-identically offline (--take --render), and auto-forks definitions edited mid-take when kept into the arrangement.
9. Self-Contained Palette & 100% MIT External Assets
- Native studio completeness: One unified Eurorack Modular Rack (11 orthogonal modules with 7-voice unison, 2× through-zero FM, 4-pole
AcidLowPass, multi-burstModularEnv,LoFiProcessor, 32-mode physicalModalResonator, RIFFsmpl/instSamplermodule, and 32-zone/8-choke-group kits) plus 8 zero-allocation effects (Eq, rhythmicFilter,Compressor, lookahead PDCLimiter, 3-mode 2×-oversampledDrive,Chorus, dual-modeDelay, Hadamard FDNReverb) and nestedGroup → Groupbus routing deliver finished club/ambient mixes in one binary without external plugin dependencies. - Externalized data, portable projects: Zero instrument presets or filter grooves are compiled into the binary (only 4 bare neutral
RackTemplatedefaults live in code) —v1InstrumentPresets inpresets/(6kits including baked and live-synthTR-808/TR-909/EDM Kit,46single-voice drum presets,11synth presets), the 24-groove clean-room MIT factory bank inpresets/filter_grooves.json(extensible up to 128 slots via user banks, browsable live viaP, forkable into editable patterns viaf, and exportable back topresets/filter_grooves.json), and--render-kit-generated MITfactory-samples/load dynamically and degrade gracefully to neutral defaults when absent. Persisted projects reject absolute sample paths, ensuring every project and portable bundle opens reproducibly on any machine.
Verification Architecture & Measured Showcase Baseline
Cadence’s automated verification gates, test suites, and measured 48 kHz mastering baselines across all five showcase tracks. Repository contribution guidelines live in CONTRIBUTING.md.
Related specifications: Decks, Keymap & Interaction · Material & Timing · DSP & Audio Engine · Protocols & Persistence
1. Mandatory Automated Verification Gates
Every change must pass all applicable verification gates cleanly (and CI in .github/workflows/ci.yml enforces them on every PR across Linux and macOS):
| # | Gate Command | What It Verifies |
|---|---|---|
| 1 | cargo fmt --all -- --check | Uniform workspace formatting across all crates, tests, and examples |
| 2 | cargo clippy --workspace --all-targets -- -D warnings | Zero lint warnings across default features (audio, midi, gui, rbs) |
| 3 | cargo clippy --no-default-features --all-targets -- -D warnings | Zero lint warnings in minimal headless configuration |
| 4 | cargo test -p cadence-engine --lib | Debug-mode thread stack safety (heap-boxed MixerEngine, Engine, Shared, Box<ModularVoice> pool, and delay pools), CheckedAllocator zero-RT-allocation enforcement, and engine DSP invariants |
| 5 | cargo test --workspace | Full unit, integration, Modular Rack, modeless UX, audio recording, devices, .rbs import, pure MemoryHostIo, and headless Metal/Vulkan GPU test suite |
| 6 | cargo test --release --test audio_invariants | Release-mode determinism, offline-vs-live parity, pan/headroom laws, portability, and full signal hygiene across all 5 showcase tracks + the Fivefold Live take |
| 7 | Visual PNG inspection (on GUI edits) | Manual inspection of regenerated Metal/Vulkan GPU renders from crates/gui/tests/*_gpu.rs and tests/docs_screenshots_gpu.rs (all 17 1440×860 flagship screenshots backed by live 48 kHz engine telemetry, plus embedded app icon PNGs) |
2. Test Architecture by Layer
Pure Core, Modular Rack & DSP (crates/core, crates/formats)
- Pattern algebra &
:mini: Bounded shared-DAG validation (MAX_DEPTH = 32), cycle/type/period rejection, statelessdet_hashdeterminism, exact sub-step offsets across all 22PatternKinds, andReverse(Reverse(x)) == xinvolution. - Unified Eurorack Modular Rack (
crates/core/src/rack/):Projectv1 andInstrumentPresetv1 schema validation, all 11 orthogonal modules (Vco/Sampler/Noise/Env/Lfo/Filter/Vca/Drive/LoFi/Resonator/Out), singular mandatoryOutprotection,MAX_RESONATORS_PER_ZONE = 4validation, Kahn DAG topological compiler (CompiledZoneGraph) withz-11-sample feedback cycles, unifiedInstrumentParam/ParamAddressresolution, and atomic stale-reference/macro pruning. - Pure DSP (
crates/core/src/dsp/): Sample-rate invariance (44.1 / 48 / 96 / 192 kHz) acrossEq,Svf/AcidLadder/TptOnePoleLpf,NoiseGen&PinkFilter,Halfband2xoversampling (step_vco_bank_fm_2x& 2×Drive),ModularEnv(Adsr/HoldDecay+ pre-delay + multi-burst),decay_coeff_60db_msSPOT,LoFiProcessor,ModalResonator(String/Bar/Membrane/Plate),SamplerVoice,Compressor,Limiterlookahead PDC,Chorus,Delay(PingPong/Stereo& 32-step ceiling),Reverbprime-coprime RT60, dual pan laws, and+6 dBpower-taper roundtrips. - Persistence & codecs: Atomic writes,
store::read_boundedlimits, boundedread_dirscans,.take.jsonlcrash recovery (TAKE_VERSION = 1),PresetCataloggraceful degradation, RIFFinst/smplmetadata roundtrips, and clean-room ReBirth.rbsimport housed incrates/formatsbehindfeature = "rbs"(tests/rbs_import.rs).
Real-Time Audio Engine (crates/engine)
- Zero-RT-allocation proof:
crates/engine/src/mix_engine/tests.rsinstalls a#[global_allocator] CheckedAllocatorasserting 0 heap allocations duringMixerEngine::process,update_control_block,adopt,ModularVoiceexecution, andEngine::next_frame. - Routing, PDC, live input & metering: Heap-boxed
Box<ModularVoice>graph evaluation, nestedGroup → Groupcausal summing, ancestor-aware mute/solo, chained Limiter PDC alignment, 32-bit floathotvs. Masterclippedsemantics,256-slot sub-step frame scheduling, lock-freeAudioTapHandlestreaming, and lock-free SPSC audio input monitoring + 24-bit WAV recording (tests/audio_recording.rs).
Pure Controller, Modeless Input & Host Protocols (crates/app, tests/)
- Hermeticity & purity: All integration and GPU tests run hermetically against synthetic temp fixtures (
tests/common/mod.rs) andSampleLibrary::from_prefixed_rootswith zero reliance on host$HOMEconfigs or private./samples/.crates/appenforces zero directstd::fs/std::env/File::I/O (HostIo+MemoryHostIo). - Domain symmetry, Rack & modeless UX (
tests/):modular_rack.rs,rack_zones_bounce.rs,zone_params_and_routing.rs,external_presets.rs,dsp_eq_limiter_fm.rs,macros.rs,live_staging_midi_pan.rs,devices_audio_deck.rs,audio_recording.rs,modeless_input.rs,modal_authoring.rs,overlays_and_palette.rs,workflow_drafts.rs,file_hub_and_assets.rs,asset_readiness.rs,search_and_help.rs,signal_graph.rs,take_workflow.rs, andnavigation_confirms_and_hints.rsverify end-to-end parity across the 4-tier modeless grammar, 3-tab Eurorack Rack (Panel | Patchbay | Zones), unifiedAudio | MIDIDevices deck, live 24-bit recording, 6-category live Preset Browser (P), Filter Groove Browser/Fork/Save, 8 FX, 8 Macros, Signal Graph, Song Properties (gP, 13NAMED_SCALES), Mini Editor,ValueInput, Fuzzy Action Palette (:/Ctrl+Shift+p), and explicit Take arming (tr/v/X). - Host protocols & CLI:
tests/ctl_bridge.rsexercises the live Unix--ctlsocket (0o600,SUN_LENfallback,state/meters/cmd/action/listen --bars/listen --live,expected_revision, RAII tap busy-guard cleanup);tests/cli.rs,tests/material_sessions.rs,tests/format.rs, andtests/robustness.rscover--script,--stdio,--key-script,--check,--render,--stems,--render-kit,--import-rbs, and--recover.
Headless GPU Presentation (crates/gui/tests/, tests/docs_screenshots_gpu.rs)
- Real Metal/Vulkan
HeadlessGpusuites (arrange_graph_gpu.rs,float_metering_gpu.rs,font_help_gpu.rs,fx_visuals_gpu.rs,graph_and_assets_gpu.rs,live_staging_pan_gpu.rs,macros_gpu.rs,midi_settings_help_gpu.rs,modeless_direct_edit_gpu.rs,overlays_gpu.rs,rack_instrument_gpu.rs,rack_zones_gpu.rs, plus roottests/docs_screenshots_gpu.rs[all 171440×860flagship screenshots backed by live 48 kHzcadence-enginetelemetry across all 3 GPU themes]) render fullFrameViews, asserting hermetic 2-face embeddedJetBrains MonoRegular (400) + Bold (700) typography with coding ligatures disabled and zero.notdef/ tofu glyphs (including ASCII"z-1"feedback badges), embedded 256×256 app icon decoding (icon::tests), all 12ModuleVisualViewvisualizers, sharedcable_graph.rsPatchbay & Signal Graph rendering, 6 aligned deck layouts, balancedpush_clip/pop_clip, zero hardcoded RGBA outsidecrates/gui/src/theme.rs, and non-empty visual geometry.
Release Audio Invariants (tests/audio_invariants.rs)
no_example_project_or_take_contains_absolute_sample_paths&absolute_sample_paths_are_rejected_and_save_stays_portable— guarantees 100% repo-relative portability.same_host_render_is_sample_deterministic— repeated renders are bit-for-bit identical.offline_compile_and_live_ring_window_have_exact_parity— offline song compilation and sliding live-ring compilation match exactly.all_showcase_examples_and_fivefold_take_pass_signal_hygiene— finite statistics,|DC| < 0.005, RMS in[-32.0, -4.0] dBFS, peak in[-18.0, -0.05] dBFS,0full-scale clipped samples,0hot (> 0 dBFS) or clipped channels/groups/returns/Master across every bus, and clean tail decay (< -30 dBFSon explicit tails).equal_power_pan_law_preserves_stereo_power_across_synth_and_sampler,unity_master_and_limiter_ceiling_enforce_exact_dbfs_bounds, and multi-zone Rack velocity-split, gain, and choke-layer invariants.
3. Verified 48 kHz Mastering Baseline — Showcase Suite
All five showcase compositions render directly from Cadence’s native 32-bit float engine at 48 kHz with no external mastering or post-export normalization, using strictly 100% MIT repo-relative assets (factory-samples/, examples/*/samples/). All tests remain self-contained and never read or depend on any private local sample directories.
| Showcase | Length / Tempo / Key | True Peak | Integrated RMS | Tail Peak (last 0.5 s) | Clips / Hot Buses | Key Capabilities Verified |
|---|---|---|---|---|---|---|
| Afterglow 3.0 | 64 bars · 128 BPM · F minor (2:00) | -0.80 dBFS ([0.9120, 0.9120]) | -16.19 dBFS (Climax -12.70 dBFS, Drop 1 -13.27 dBFS, Breakdown -19.26 dBFS) | -64.73 dBFS | 0 clips · 0 hot/clipped (DC 0.000002) | Retained Harmony DAG, :mini, 9 Rack instruments/lanes (incl. FX Sweep riser/downlifter), 9-zone MIT EDM Kit Rack + ZoneParam P-locks, 6 Macros (M1–M6), 20 FX (incl. Kick Sculpt, Sweep Sculpt, Master Comp → Eq → Limiter @ -0.8 dBFS), 5 ducks |
| Iron Circuit | 48 bars · 132 BPM · A minor (1:27) | -0.80 dBFS ([0.9120, 0.9120]) | -13.67 dBFS (-13.62 / -13.72 dBFS, 0.10 dB L/R balance) | -59.18 dBFS | 0 clips · 0 hot/clipped (DC 0.000014) | Unified Modular Racks across every role (TR-808 16-zone & TR-909 11-zone Kits, Sampler Racks, AcidLowPass 303 & wavefolded Synth Racks), nested Percussion → Rhythm → Master DAG, all 8 FX & modes (Drive(HardClip/Fold/Tape), Delay(Stereo/PingPong), custom FilterEnv, 22 FX), all 8 Macros (M1–M8) |
| Glass Cathedral | 32 bars · 108 BPM · D Dorian (1:11) | -1.50 dBFS (< 0.001 dB L/R diff) | -14.62 dBFS (0.17 dB L/R balance) | -40.77 dBFS | 0 clips · 0 hot/clipped (DC 0.000004) | 100% synthesis, polymetric SeededValues(7) × Euclidean(5,11), TimeScale(3/2) Arp(Random), :mini chimes, 4 Macros (M1–M4), automated Send swells, 4-stage Master (Tape → Comp → Eq → Limiter @ -1.5 dBFS) |
| Fivefold Live (62-bar take & 60-bar song) | 60 bars / 62-bar take · 136 BPM · D minor (1:49) | -1.00 dBFS (take & song) | -15.32 dBFS take (-13.09 Crest) · -15.19 dBFS song | -240 dBFS (digital silence) | 0 clips · 0 hot/clipped (DC 0.000107) | Scripted live performance (compose.py + takes/set.take.jsonl, 17 live gestures incl. live harmony edit & bar-quantized :undo), AcidLowPass, 4 Macros (M1–M4), 18 FX (Comp → Tape → Limiter @ -1.0 dBFS), bit-identical offline take renders |
| Signal Garden | 10 bars (8 + 2 tail) · 136 BPM · D minor (0:18) | -1.82 dBFS | -15.50 dBFS | -240 dBFS (digital silence) | 0 clips · 0 hot/clipped (DC 0.000036) | Rebuilt identically from --empty via build.keys.jsonl (tests/material_sessions.rs), live fork vs. freeze, placement-local ending, seeded per-note pan, sidechain duck + gain contour, plus 5 companion workflow key scripts |
Note: Automated audio invariants verify determinism, headroom hygiene, DC bounds, pan/limiter accuracy, and tail completion; subjective musical balance and hardware audio/MIDI device acceptance are audited separately by ear.