Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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/L coarse/tabs), sculpt values and reorder items directly in place with Alt+h/j/k/l (Alt+H/J/K/L coarse) or one-hand ,/. (</>), enter exact values with Enter, and press : / Ctrl+Shift+p for 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 from Vco (7-voice unison + 2× through-zero FM), Sampler (automatic RIFF smpl/inst loops), 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), and Out, with bipolar attenuverter cables and sample-accurate z-1 feedback — 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 :mini notation) with fractional sub-step timing (offset ∈ [0.0, 1.0)).
  • 32-Bit Float Mixer & 8 Studio Effects: Native Eq, Filter (with extensible 128-slot rhythmic FilterEnv groove bank), Compressor, Limiter (with lookahead PDC), Drive, Chorus, Delay, and Reverb, nested Group → Group buses, automated Send levels, sidechain Duck envelopes, and +6 dB fader 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 unified Audio | MIDI Devices deck (gd / Ctrl+d).
  • Scriptable & Agent-Ready: Clean human-readable v1 JSON projects, presets, and JSONL takes, deterministic WAV + per-channel stem export (--render, --stems, --render-kit), clean-room ReBirth .rbs import (--import-rbs), and a live --ctl Unix 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 Project v1 graph, 22 PatternKind operations, :mini syntax, fractional sub-step timing, and live launch/keep semantics.
  • DSP & Audio Engine Spec — Pure cadence-core::dsp signal math, 11-module Rack runtime, 32-bit float mixer, PDC, and real-time audio invariants.
  • Protocols & Persistence Spec — JSON schemas, --script / --stdio JSONL actions, live --ctl Unix 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 | Zones with bipolar attenuverters, 2× through-zero FM, 32-mode physical Resonator, and z-1 feedback), per-note P-locks (:link), multi-zone :zone drum 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 :mini notation and all 22 composable PatternKind operations, then read CLI, Scripting & Live --ctl to 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 | Zones on Rack, Audio | MIDI on Devices, bars ±16, sections, Mixer pages)—never mutating audio.
  • Tier 3 · Direct 2D Manipulate & Reorder (Alt+h j k l fine · Alt+H J K L coarse): 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+Backspace reset): Nudge any focused scalar one-handed; press Enter on any scalar for exact Value Entry (ValueInput).
  • Focused Input Modes (only where needed): i enters Step Insert piano entry on Pattern Notes; gj / Ctrl+Shift+j toggles modal Jam Mode (1–0 sections, q–p lanes, z–, piano, Tab/Shift-Tab bank).

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 / KeyAction
h/j/k/l · H/J/K/L · w/bStrictly 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 / EscOpen / launch / exact Value Entry · Step Insert (Pattern Notes) · Jam Mode · unwind trail
: or Ctrl+Shift+pOpen 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 z41-key workspace presets: Compose, Perform, Sound Design, Mix
zz zp zx zoZoom 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

  1. Quick Tour: First 10 Minutes — Learn the modeless 4-tier keyboard grammar, Fuzzy Action Palette, Song Properties (gP), themes, transport (tr Take Arming & ta live audio recording), and build a living 3-part groove.
  2. Patterns, Algebra & Inline :mini — 2D polyphonic chord editing, Step Insert, Patterns/Parts/Placements/Lanes, shared vs. local/' “From here” editing, all 22 PatternKind operations, the value curve editor, and the live-validated Mini-Notation Editor.
  3. Modular Rack Instruments, Patchbay, Zones & Assets — Unified 11-module Eurorack Modular Rack (Panel | Patchbay | Zones, incl. Resonator), cubic-Bezier cables with bipolar attenuverters & z-1 feedback, 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.
  4. 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 dB hairline, HOT (32f) vs !CLIP), +6 dB console headroom, nested Group → Group routing, all 8 zero-alloc studio FX, and direct cable patching in gG.
  5. Project Macros & Modulation — 8 assignable Project Macros (M1–M8), exact compilation precedence, global :mod curves, and per-note :link P-locks across Rack/Zone/Module/Cable/FX/Send/Channel targets.
  6. 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,).
  7. Live Performance & Armed Takes — Evaluated Arrange views (vp/vo/vr) and event provenance, row-oriented Bank Launchpad, Jam Mode (gj / Ctrl+Shift+j), universal Alt layer, quantization boundaries, live staging, Alt+c/Alt+C Keep, and explicit Take Arming (tr / gt with v Visual range marking & X discard).
  8. CLI, Headless Rendering, Formats & Live --ctl — Offline validation, WAV/stems rendering, audio/MIDI session flags, clean-room ReBirth .rbs import (--import-rbs), factory kit rendering (--render-kit emitting v1 Rack 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-zone EDM Kit Rack, Bell Mini inline :mini, 6 automated Project Macros, and studio mastering.
  • Iron Circuit (examples/iron-circuit/project.json) — 48-bar Acid Electro flagship with TR-808 & TR-909 multi-zone Rack kits, Detroit chord Sampler Rack, AcidLowPass 303, Fold/HardClip Drive, rhythmic Filter PCF, nested Percussion → Rhythm groups, 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.jsonl performance script and deterministic .take.jsonl recording.
  • Signal Garden (examples/material-lab/project.json) — Compact 10-bar retained-material authoring lab accompanied by modular .keys.jsonl scripts.
  • Agent Session (examples/agent-session/session.jsonl) — Typed JSONL Request/Action scripting session for headless and --stdio co-production.

Architecture & Implementation Specs

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 : or Ctrl+Shift+p anywhere to open the Fuzzy Action Palette—search any deck, layout, workflow, FX, theme, section, pattern, or instrument by name (↑/↓/Tab select, Enter run, Esc close). 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 ? (or Ctrl+Shift+/) anywhere to open the tabbed, searchable Help reference (H/L, h/l, or Tab/Shift-Tab switch tabs across All, Navigate, Compose, Mini & Algebra, Sound & FX, Live & Jam, and Files & CLI; press / to filter live, Enter to lock the filter for j/k scrolling, and Esc to 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/k picks a lesson, Enter prefills its command into the Action Palette so you can inspect or run it).
  • Press gP (or Ctrl+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 normal u undo stack without memorizing :key or :bpm commands.
  • Press g, (or Ctrl+,) to configure Global Settings—focus GPU Theme with j/k, cycle live between Cadence Dark, Midnight Neon, and Studio Light with Alt+h/l or ,/., and press Ctrl+s to 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 / ModeKeysWhat It Does
1. Navigateh j k l (+ Arrows) · w / bStrictly 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 & TabsH J K LSwitch 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 ManipulateAlt+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 Inserti (on Pattern Notes) · Esc → NormalPiano-keyboard step entry (1–8 scale degrees, z–, 13-key chromatic notes, Shift accent, </> octave, . rest) preserving sibling voices on existing chords.
Jamgj 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.

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+u clears).
  • Press Enter (or Tab) to lock the filter and return to j/k list navigation.
  • Press Esc once to clear an active filter, and Esc again 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 PrefixDirect CtrlDestination
ga / gp / gb / gmCtrl+a / Ctrl+p / Ctrl+b / Ctrl+mArrange · Pattern · Bank Launchpad · Mixer
gi / gk / gt / gGCtrl+i / Ctrl+k / Ctrl+t / Ctrl+gInstrument Rack · Project Macros · Take Deck · Signal Graph
gd / goCtrl+d / Ctrl+oDevices (Audio | MIDI) · Toggle 32-bit float Output monitor
gj / gf / gP / g, / gS (B)Ctrl+Shift+j/f/i/,/bJam · 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)

KeysEffect
z1Compose preset (Arrange + Pattern)
z2Perform preset (Arrange + Bank Launchpad + Output)
z3Sound Design preset (Pattern + Instrument + Output)
z4Mix preset (Arrange + Mixer + Output)
zzZoom the focused deck full-screen (press zz again to restore)
zp · zx · zoPin/unpin working deck · Close focused deck · Only (close others)
zh zj zk zlMove focus directionally between visible decks
z= z- z0 (or Ctrl+=/-/0)Zoom Arrange or Pattern timeline horizontally / reset to 100%
Tab · Enter · EscCycle visible decks · open/launch/enter exact value · unwind trail (Backspace also steps back)

4. Transport, Loops, Recording & Timing (t prefix)

KeysCommandWhat It Does
Space—Play / pause transport
Home or ts:stopStop and rewind to bar 1
\:loopToggle the song/region loop on or off
tl:loop SECTIONLoop the section under the Arrange cursor
tx:loop clearClear remembered loop brackets and return to linear song playback
tf:followToggle viewport follow (auto-pauses when you scroll manually; tf resumes)
tc / tp / tg:cue / :playCue 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 toggleArm / disarm Take recording (default OFF; Chrome shows TAKE ARM / ● REC TAKE; enable Auto-Record Takes in g, for always-on capture)
tR:restartRestart the current loop from its start boundary
te:end loop|stop|continueCycle what happens at the end of the song
tq / tQ:quantize ...Cycle launch quantization boundary / pick a Cycle <PATTERN> boundary
tE:quantize edits now|launchToggle 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.

StepModal Form WorkflowEquivalent Ex Command (via : Palette)
1a. Five-step motifPress 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 harmonyPress 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 derivationInside 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.

StepModal Form WorkflowEquivalent Ex Command (via : Palette)
2a. Lead synth Rackn → 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 → soundn → b (Part), name LeadPart, pattern Moving, instrument Lead.:part LeadPart Moving Lead
2c. Create lanen → l (Lane), name LeadLane.:lane LeadLane
2d. Place on timelinen → o (Placement), part LeadPart, lane LeadLane, bar 1, length 8 bars, phase Song.:place LeadPart LeadLane 1 8 song
2e. Quick 1-step bass partn → 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 launchpadOpen gb (Bank Launchpad) to launch lane parts live.:lane LeadLane add LeadPart song

Step 3 · Watch Relationships Work Live

  1. Press Space to hear the 5-step motif shift across the 64-step harmony above your bass and 808 beat.
  2. Open Harmony via Ctrl+Shift+p → Open Pattern: Harmony (or press gp and follow gs from Moving).
  3. Move to step 33 (offset 32) with h/l or w/b, and nudge the harmony value directly with Alt+j/k or ,/. (or press Enter, type 4, and confirm). Every bar of Moving updates instantaneously while Motif stays untouched.
  4. Run :inspect Moving from the Action Palette to view its dependency tree and consumers.
  5. Save your song with Ctrl+s (or :w my-groove.json). Undo any step anytime with u (Ctrl+z) and redo with U (Ctrl+Shift+z / Ctrl+r).

Next: Learn all 22 retained PatternKind operations, scoped editing, and inline :mini notation 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

EntityRoleKey Properties
PatternLive musical definition—independent of sound or song position.One of 22 PatternKinds (literal notes, rhythms, value curves, inline :mini, Euclidean rhythms, or retained derivations).
PartJoins one Pattern to one Instrument.transpose (semitones), velocity_scale, and per-note Parameter Links / P-locks (:link PART PARAM VALUE_PAT).
PlacementSchedules 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.
LaneArrangement 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 to 0 + offset_steps at 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:

ScopeHow to InvokeWhat Changes
Shared definition (default)Edit normally inside gp (Pattern deck)Updates the pattern everywhere—all placements and downstream derivations update together.
Placement-local exceptionPress o on a Placement deck or run :local [ID]; clear a step with Backspace or :inheritOverrides individual steps for this placement only while staying linked to upstream sources on every other step.
Scoped “From here” forkPress ' (apostrophe) in Arrange or Pattern, then make one pattern editForks 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 forkPress 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.
FreezePress 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)

PatternKindModal nEx CommandDescription
Notesnn:pattern notes NAME TOK...Literal step/chord sequence (degrees, MIDI names like C4, chords 0,2,4 up to 6 tones, . rests).
Rhythmnr: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 MAXDeterministic hash-based value sequence reproducible across runs and platforms.
Mininm:mini [NAME [STEPS]] <CODE...>
:pattern mini NAME STEPS <CODE...>
Strudel/Tidal-inspired inline mini-notation with fractional sub-step timing.
Euclideanne:pattern euclid NAME PULSES STEPS [ROT]Bjorklund Euclidean rhythm E(pulses, steps, rotation).

B. Harmony & Pitch Derivations (5)

PatternKind:derive OpSyntaxDescription
AddDegreesadd:derive NAME add NOTES DEGREESShifts a note pattern’s scale degrees by a Degrees value pattern on its own independent clock.
Maskmask:derive NAME mask NOTES RHYTHMGates a note pattern so notes only sound where Rhythm triggers.
Transposetranspose:derive NAME transpose SOURCE SEMITONESChromatically transposes any note pattern by signed semitones.
NotesFromValuesfrom:derive NAME from DEGREES RHYTHM [OFFSET VEL GATE]Combines a Degrees curve and a Rhythm trigger stream into a live note pattern.
RangeFoldfold:derive NAME fold SOURCE LOW_MIDI HIGH_MIDIOctave-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 OpSyntaxDescription
TimeScalefast / 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).
Swingswing:derive NAME swing SOURCE AMOUNTSub-step 16th-note swing (0.0..=0.45, e.g. 20%), delaying odd 16th steps cleanly.
Ratchetratchet:derive NAME ratchet SOURCE COUNTSubdivides every active hit into count (1..=8) evenly spaced sub-step retriggers.
Shiftshift:derive NAME shift SOURCE STEPSRotates/shifts any pattern in time by signed 16th-steps.
Reversereverse:derive NAME reverse SOURCEMirrors any pattern backwards over its natural period.
Arparp: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 OpSyntaxDescription
Chancechance:derive NAME chance SOURCE PROB [SEED]Deterministic per-hit probability gate (0..1 or 0%..100%) using a pure seeded hash.
Everyevery:derive NAME every INTERVAL BASE ALTPlays BASE normally and switches to ALT every INTERVAL-th cycle (bar/phrase turnarounds).
Concatconcat:derive NAME concat P1 P2 ...Sequences multiple patterns end-to-end as a longer live form.
Stackstack:derive NAME stack P1 P2 ...Layers multiple patterns simultaneously, merging sub-step events in exact time order.
Shapeshape: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/l step · H/L (or PgUp/PgDn) jump 16 steps (1 bar) · 0/$/G first/last step · w/b jump active notes/hits · =/- quick zoom.
    • j/k select stacked chord voices vertically (sorted visually from lowest pitch 0 to highest N-1; the status bar shows Voice 2/4 · A♭4 · len 1.50 · vel 88%).
  • Direct Modeless Sculpting on Notes (or :local Placement scope):
    • Alt+j/k nudge pitch ±1 degree (Alt+J/K ±1 octave) · [/] (and #) flat/sharp accidental.
    • Alt+h/l gate length ±0.25 steps (Alt+H/L ±1.0, range 0.05..64.0).
    • ,/. velocity ±5% (</> ±15%).
    • c/C cycle StepCondition · o stack chord voice (up to 6 simultaneous voices) · m toggle step rest/active (preserving pitch/chord) · x delete focused voice · X clear step · Backspace (in Placement scope) re-inherit step from definition.
  • Direct Editing on Rhythm: Enter or x toggles the hit directly under the cursor.
  • Piano Step Entry (Step Insert via i on Notes; Esc → Normal):
    • 1–8 enters scale degrees; z s x d c v g b h n j m , plays and writes chromatic notes (Shift accents to 1.0 velocity); </> shifts octave; . writes a rest; Left/Right steps cursor.
    • When overwriting a voice inside an existing chord stack, Step Insert preserves all sibling chord voices cleanly!
  • Derive / Edit / Inspect: n opens the create menu, d opens the Derive form targeting the current pattern, r edits the current pattern definition/length/rename in-place (works on Notes, Mini, Euclidean, SeededValues, and all derived patterns), A toggles pattern audition, f forks, F freezes derived/generator patterns to literal, ; repeats the last single-step edit, and on derived patterns j/k highlights upstream source chips right in the SOURCES: bar while Enter / gs opens the selected source directly.
  • Clipboard ([N]y, p, P): Press y to yank the step under the cursor—or type a count like 4y to yank a 4-step span—then p to paste after/at cursor or P to paste before. Works seamlessly across Notes, Rhythm, and Values patterns.

Value Curve Editor (Degrees & Normalized)

  • Navigate: [count]h/l steps across time offsets · H/L jumps 1 bar · w/b jumps between authored breakpoints · 0/$/G first/last step.
  • Direct Sculpting: Alt+j/k and ,/. nudge value fine (±0.01 / ±1 deg) · Alt+J/K and </> coarse (±0.10 / ±7 deg) · Alt+h/l slide breakpoint in time ±1 step (Alt+H/L ±4 steps) · Enter opens unified live-validated Value Entry (0.5 or 50% for Normalized; signed integers for Degrees) · m toggles Hold ↔ Ramp · x deletes breakpoint · e inspects 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 Mini pattern in gp and press Enter (or run Edit Mini-Notation from the : / Ctrl+Shift+p Action Palette) to launch the dedicated MINI EDITOR modal.
  • 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+u clear · Enter commits when valid (single undo entry) · Esc cancels cleanly.
  • Create or script by name: Press n → m to create via modal form, r on gp to edit name/step length in-place, or run :mini LeadLine 16 c4 [e4 g4] ~ <a4 b4> via the Action Palette or cadence ctl cmd (defaults to 16 steps if omitted).

Complete Syntax Reference

SyntaxMeaningExample
c4, eb3, f#5, bb2Absolute MIDI note names (s or # sharp, b flat; octave defaults to 4)c4 eb4 g4 bb4
1, 3, -2, 5#, 3b, 0Scale 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,g4Simultaneous 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>
*NRepeat N times (1..=16) within the item’s spaneb5*2 · c4*4
/NSlow down (1..=16): item plays once every N cycles[c5 g5]/2
@NWeight / elongate (0.125..=32.0) relative to sibling slotsc4@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)
? / ?pDeterministic 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) — triggering TR-808 multi-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-1 feedback, 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 303 ladder 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 from Init Synth, Blank Sampler, Blank Kit, or Blank Modular, or load any external MIT v1 preset from presets/.

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 & R reload)
    • 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-inserting Sampler → Out.In if the zone has no Sampler module yet)
    • o: route output channel
    • M: 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/l or ,/.: fine adjust · Alt+H/L or </>: coarse adjust · Alt+Backspace: reset to default
    • Enter: open unified live-validated Value Entry (1200hz, -3dB, 50%, L35, +2.5 oct) — or open the Sample Browser / link picker on link rows
    • e: 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/l across Quick (your curated panel_pins performance faceplate—up to 16 pinned Rack, Zone, Module, or Cable controls) followed by every module in the active zone. Walk controls vertically with j/k (w/b jump groups), and reorder pins on Quick with Alt+j/k.
  • Live GPU Visualizers (12 Dedicated Painters): Quick shows PinnedOverview (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: a opens the Add Module picker (:mod add), x removes the focused module (the singular mandatory Out module is always protected), p pins or unpins the focused control on the Quick faceplate (:pin / :unpin), and Alt+h/l / ,/. / Enter sculpt 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::*:

#ModulePatchbay ColumnAccepted InPortsDSP Highlights & Key Parameters
1VcoSOURCESPitchCv, FmIn, PwCvBandlimited 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.
2SamplerSOURCESPitchCv, TrigInPure-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.
3NoiseSOURCES(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.
4EnvMODULATORSTrigInModularEnv 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.
5LfoMODULATORS(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.
6FilterPROCESSORSIn, Cv5 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.
7DrivePROCESSORSIn, CvStereo 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.
8LoFiPROCESSORSInContinuous 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.
9ResonatorPROCESSORSIn, PitchCv, CvSample-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.
10VcaVCA / OUTIn, CvGain (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).
11OutVCA / OUTIn, CvSingular 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%), and Drive/Out.Cv (±100%). Negative depths invert polarity for inverted filter sweeps, counter-phase audio cancellation, or negative FM feedback!
  • Cycle-safe z-1 1-sample feedback: Patch any downstream module back upstream (e.g., Fold Drive → VCO.fm -28% or Plate → 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 badged z-1.

Patchbay Keyboard Controls

KeyAction
h/j/k/lNavigate 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)
cPatch 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
xDisconnect the selected cable (or remove the focused module when no cable is selected; never Out)
aAdd a new module to the active zone
p / ePin 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!

  • 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 with Panel and Patchbay, so switching tabs inspects the selected zone’s modules and cables!)
  • j/k (w/b group 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+Backspace reset): adjust the focused zone/voice/rack control directly (Enter opens exact ValueInput or Sample Browser)
  • Alt+j/k: reorder the active Zone in the strip
  • a / d / x / r: open "Add Zone…" picker / duplicate zone / delete focused zone (at least 1 zone always remains) / rename zone
  • B / 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

CommandEffect
: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 delDuplicate or remove the focused zone
:zone select NAME|IDX · :zone next|prevSelect the active zone
:zone sample PATHLoad an audio file into the active zone’s Sampler module (auto-inserting Sampler → Out.In & applying RIFF smpl/inst bounds)
:zone preset NAME|PATHLoad a single-zone v1 Rack preset into the focused zone
:zone import DIRAuto-build a multi-zone Rack from a folder (using RIFF inst & filename MIDI hints)
:zone name NAME · :zone choke none|1..8Rename zone or assign choke group
:zone range LOW HIGH [ROOT] · :zone vel LOW HIGHSet MIDI key split (C2 or 36) and velocity layer (0%..100%)
:zone set FIELD VALUESet 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 tb in Arrange/Pattern to bounce the current selection to a new Sampler Rack, or press tb while 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 | Modular with h/l, H/L, or Tab/Shift-Tab, alongside all 4 neutral bare templates (Init Synth, Blank Sampler, Blank Kit, Blank Modular) plus in-browser Save Preset and R catalog reload.
  • Instant Live Preview on Scroll: Moving with j/k (or ↑/↓) swaps the live audio engine to each highlighted Rack non-destructively from a full Project snapshot (so zone modulations, P-locks, and macro bindings are preserved cleanly during preview).
  • Search, Audition, Commit or Restore: Press / to filter (Enter locks filter for j/k, Esc clears filter), A to audition, Space to play/pause while scrolling, Enter to commit the chosen preset as a single undoable transaction, or Esc to restore your exact original Rack with zero undo entries and unchanged dirty() 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-pad
  • presets/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-synthesized tr-808-*, tr-909-*, and edm-kit-* drum voices loadable into any single zone or standalone track
  • presets/kits/ (6) — multi-zone v1 Rack kits in both baked-sample (tr-808, tr-909, edm-kit, reproducibly rendered with 1:1 loudness parity from factory-sources/{tr-808,tr-909,edm-kit}/project.json via cadence --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.json or ~/.config/cadence/presets/filter_grooves.json

Sample Browser, File Hub & Portable Bundles

  • Sample Browser (B, gS, Ctrl+Shift+b, or Enter on Sample rows): Universal / live filter (Enter locks filter for j/k list navigation, Ctrl+u clears, Esc clears filter then closes), off-thread audition (A), assign (Enter, auto-inserting a Sampler → Out.In module if the active zone has none and importing RIFF smpl/inst root/loop metadata), reload/rescan (r/R).
  • File Hub (gf, Ctrl+Shift+f/o/s/e): 4-tab workspace (H/L, Tab/Shift-Tab, or 1–4 switch 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 with Ctrl+s writes immediately without opening the dialog. Loading an instrument preset, MIDI profile, or take from File Hub auto-closes File Hub cleanly. Press / to filter, F in any tab to open a native OS Finder/file dialog, or R on Import to refresh the preset catalog.
  • Portable Bundles (:bundle DIR): Writes DIR/project.json and copies every audio file referenced by any Sampler module across every Rack zone into DIR/samples/ with clean relative paths—ready to share or archive anywhere.
  • Diagnostics & Custom Paths: Run :assets to inspect sample readiness and missing files, :reload-samples / :reload-presets to refresh assets from disk, or open Settings (g, / Ctrl+,) to manage persistent sample_dirs and preset_dirs (a type path, F native folder picker, x delete, Ctrl+s save). You can also pass repeatable --sample-dir and --preset-dir flags 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 dB Hairline: Every strip meters -60..+6 dBFS with a crisp 0 dB hairline 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 crosses 0 dBFS (> 1.0), Cadence informs you with HOT (32f)—never silently distorting it. True digital clipping (!CLIP) fires strictly when Master post-fader exceeds 1.0 (0 dBFS) at the final DAC / 16-bit WAV boundary (or if any non-finite sample occurs anywhere). Clear latched peak/clip indicators with C (selected strip), tC (all strips), or :clips clear [all].
  • Top-Down Gain Reduction (GR) Micro-Meters: Any channel hosting an active Compressor (CMP) or Limiter (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 spans 0.0..=2.0 (+6.0 dB boost headroom above unity, with exact 0.0 dB unity 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 across L100..C..R100), while mono voices use -3.01 dB constant-power panning.
  • Three Independent Level Layers: Static channel trim (:param trim +3dB), automated ChannelGain modulation (a 0..1 multiplicative level envelope), and triggered sidechain Duck envelopes 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 ,/.!

KeysAction
h/l · H/L (PgUp/PgDn) · 0/$/GSelect channel strip · page strips · jump first / Master
j/kFocus 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/kPush Fader dB up/down vertically · or reorder focused Insert FX up/down
Alt+BackspaceReset focused Fader (0.0 dB), Pan (center), or Send to default
EnterOpen focused Insert FX deck · Output route picker · EditDuck · or exact ValueInput on scalars
oOpen 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 · bMute / solo channel (live flags—never pollute song undo history) · bypass focused Insert (b)
v · e · r · CMove Insert to another channel (v) · inspect/bind Macros & Modulations (e) · rename (r) · clear clip (C)
x / XRemove focused Insert/Send/Duck (x) · delete channel (X, confirm-guarded)
Channel / Effect Deck: j/k · w/b · Alt+h/l · ,/. · Alt+j/k · m · vWalk 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 Audio or Group channel can route into another Group or Master (validated acyclic at edit time). For example, Iron Circuit routes 808 Kit + 909 Kit → Percussion Group → Rhythm Group (alongside Fold Bass) → Master.
  • Sends & Automated Send Throws: Post-fader sends feed Return buses (Echo, Hall, Dub Tape). You can automate any send amount with ModulationTarget::Send for dub throws and build swells.
  • Triggered Sidechain Ducking: Any Part’s note triggers can duck any target channel (Audio, Group, Return, or Master) 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 / ArchitectureKey Parameters
eq4-stage zero-alloc studio EQ with live frequency response plothpf (Hz), low (dB), mid (dB), mid_hz (Hz), mid_q (Q), high (dB)
filterStereo 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 / compressorStereo-linked feed-forward soft-knee (6 dB) bus/master compressor + transfer curve & live GR meterthreshold (dB), ratio, attack (ms), release (ms), makeup (dB), mix
limiterStereo-linked lookahead (1.5 ms, full PDC latency compensation) brickwall peak limiter (2 dB soft knee)ceiling (dB), input_drive (dB), release (ms), mix
driveMulti-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
chorusDual-tap stereo modulated chorusrate (Hz), depth, width, mix
delayTempo-synced stereo delay (0.5..=32.0 16th-steps) in PingPong or Stereo modedelay_mode, time (steps), feedback, mix
reverbAlgorithmic stereo 8×8 Hadamard FDN hall/room reverbsize, 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) in presets/filter_grooves.json spanning Pulses, Grooves, Syncopation, Swells, 32nd Gates, and Polyrhythms (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.json or ~/.config/cadence/presets/filter_grooves.json to override or extend it; stepping with Alt+h/l or ,/. cycles strictly over loaded IDs, and missing IDs degrade gracefully to a neutral 1-step pulse without aliasing.
  • Filter Groove Browser (P or Enter on Pattern): 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 on Enter, zero-trace restore on Esc, and Save-to-Bank (presets/filter_grooves.json) with instant audio-engine reload.
  • Fork to Pattern (f): Press f (or Action Palette: Fork Filter Groove to Pattern) to extract any bank groove into an editable project Pattern (preserving exact step velocities, 8th/16th/32nd resolution, and Hold/Ramp attack contour) and bind env_pattern_id in one undoable step.
  • Bind Any Project Pattern: Inside the Filter deck, cycle Source or run :param source <PATTERN_NAME> to drive the filter envelope directly from any Notes, Rhythm, Euclidean, Mini, or normalized Values pattern in your project (:param source factory returns 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:

  1. SOURCES — root literal/mini/Euclidean/value patterns
  2. DERIVED — retained pattern-algebra derivations
  3. PARTS — material-to-instrument parts
  4. (Optional MACROS column when Project Macros are configured)
  5. INSTRUMENTS — Unified Modular Rack instruments (displaying RACK badges + zone/module counts like 16z/48m)
  6. 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

KeyAction
h/j/k/lMove across columns and nodes (0/gg top, G/End bottom of column)
EnterOpen the selected Pattern, Part, Macro, Instrument, Channel, or Effect deck
oRe-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)
eEdit an attached Send, Modulation, or Duck cable (opens a picker if multiple cables touch the node)
x / XUnlink one cable (picker if multiple) / unlink all removable cables on the selected node
zzZoom 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.PARAM or KIT.ZONE.MODULE.PARAM)
  • Any of the 8 Studio Effect parameters
  • Channel gain/pan and Send amounts

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 & KeysAction
h/l · 1–8 · 0/$/GSelect Macro slot M1–M8 across the horizontal dial strip
j/kMove 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 / XExact 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 · xReorder binding row · jump to target deck · invert min ↔ max · unbind row
Anywhere on gk: M / RArm 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:

  1. Static Macros (M1 → M8 ascending) — applied to bound targets, skipping any macro slot that has a ModulationTarget::Macro driving it.
  2. Automated Macro Fan-Out (M1 → M8 ascending) — fans each automated macro’s live value across every automatable target range.
  3. Direct Modulation — always overrides Macro fan-out on that specific target parameter.

Multiplicative ChannelGain Rule: Direct ModulationTarget::ChannelGain compiles 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.


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.

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 callback AUDIO CPU load and peak CPU marker, stream status (RUNNING, SILENT, OVERLOADED, FAILED), and XRUNS buffer 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 / SILENCE indicators, active routing mode, and estimated round-trip latency (ms).

Audio Configuration Rows (j/k navigate · w/b jump groups)

GroupRowValues & Behavior
AUDIO INTERFACEOutputSystem Default or any detected OS audio output device (Alt+h/l or ,/. cycle; Enter opens device picker; Alt+Backspace resets to System Default).
Sample RateAuto (Device) or discrete 44.1 / 48 / 88.2 / 96 / 176.4 / 192 kHz.
Buffer SizeAuto (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 OutReserved device selector for a future independent cue bus (Off by default).
AUDIO INPUT & RECORDINGInputNone (no OS microphone/input stream opened) or any detected hardware audio input. Changing input settings never interrupts active output playback.
Input ModeChannel routing before metering and capture: Stereo (1+2), Mono (Ch 1), or Mono (Ch 2).
Input MonitorSoftware 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 TrimManual 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 & RECOVERYAudio PanicImmediately silences all ringing voices, synths, and FX tails and clears any overload latch (Enter or :panic / :audio panic).
Restart AudioReopens the active hardware audio stream with your current device settings (Enter or :audio restart).
Rescan DevicesRe-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:

  1. Select & check your input in Devices · Audio (Ctrl+d / :audio): Pick your Input device and Input Mode (Stereo (1+2) / Mono (Ch 1) / Mono (Ch 2)), watch the live stereo input meters to set clean preamp gain without clipping, and adjust Latency Trim if needed. If your hardware input and output run at different sample rates, Cadence converts the stream automatically.
  2. Monitor safely (ti): Press ti from any deck (or run :rec monitor off|auto|on) to cycle live input monitoring (Off by default to prevent acoustic feedback).
  3. Record immediately (ta) or open the Record Audio dialog (tA):
    • ta starts/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), or Free (unquantized start/stop).
      • Length: Fixed bar count (1..=64 bars via :rec bars <1..=64> [NAME]) or manual stop.
      • Destination: A brand-new Sampler Rack (with Part + Placement on the arrangement) or directly into an existing multi-zone Rack slot (:rec zone ...).
  4. 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 (u undoes 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 · MIDIEx CommandAction
H/L:audio / :midiSwitch 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 learnOpen port/profile picker, toggle Pickup, or arm/re-learn selected mapping
a · v · r:midi rescanAdd mapping (a) · toggle invert (v) · rescan OS MIDI ports (r)
x / X:midi unlearn / :midi clearDelete focused user mapping (x) · clear all user mappings (X, confirm-guarded)
R:midi recArm/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, Patchbay cable attenuverter, or Zones), Effect, or Channel deck
  • Focused slot M1–M8 inside 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 Notes pattern 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 Ramp automation points into a Values modulation lane (lazily creating the pattern and Modulation if none exists) with 1.5-second gesture undo coalescing—so one knob sweep undoes cleanly with a single u.

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 MIDI profile.
  • 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 Macros M1–M8 when outside an object deck).
  • 3 Built-In Profiles (export/customize any profile with :midi profile-save my-ctrl.json and :midi profile-load my-ctrl.json):
    1. Generic MIDI (generic): Clean MIDI Learn canvas + MMC + StandardCcNote feedback.
    2. 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.
    3. 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 via ArturiaDaw SysEx.

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

GroupSettingsNotes
APPEARANCEGPU ThemeCadence Dark · Midnight Neon · Studio Light
WORKSPACEStartup Layout · Output Monitor · Contextual Key HintsDefault launch layout (z1–z4), visibility of the 32-bit float Output strip (go), and footer key-hint bar
TRANSPORTViewport Follow · Auto-Record TakesDefault follow mode (tf); opt-in automatic take arming on Space (default Off so everyday playback stays lean; tr toggles live)
NEW PROJECTDefault Tempo · Default Key · Default ScaleStarting 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 ToleranceProject-level launch boundary (c picks a Cycle pattern), immediate vs. quantized live edits (tE), and 0–4 step late-hit grace window
ASSET DIRECTORIESSample 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):

KeysViewPurpose
vpPlacementsBar-level placement blocks and named timeline sections (n → t add, r edit, X delete, Alt+hjkl / ,/. move & resize placements).
voEvaluated OverviewMulti-lane note overview evaluated directly from live patterns and derivations—zero extra material created.
vrLane RollFull-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 → LeadPart at 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/$/GSelect 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)
AAudition part pattern
a / rAdd Part to lane / edit launch phase & offset
x / XRelease lane override back to the arrangement / drop Part from lane
m / sToggle lane mute / solo (queued on the launch boundary while playing)
zzToggle full-screen Launchpad Matrix

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–9 to 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+x to release, Alt+c to keep, or any other key to close the layer and act immediately.
  • 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 (Shift accents to 1.0 velocity; </> shifts octave 0..8).
  • Tab / Shift-Tab: Page between 10-lane / 10-section banks when a project has more than 10 lanes or sections.
  • Space play/pause · \ toggle loop · Backspace cancel last queued launch/jump · Enter fire staged scene · : / Ctrl+Shift+p Action 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):

ChordAction
Alt+1..Alt+0Jump to Section 1–10
Alt+q..Alt+pOpen Lane 1–10 layer (1–9 launch, repeat key toggle)
Alt+m / Alt+sMute / solo focused lane (or selected channel in Mixer)
Alt+M / Alt+SUnmute all lanes / clear all lane solos
Alt+x / Alt+XRelease focused lane override / release all overrides
Alt+c / Alt+CCommit / Keep focused lane override (or Take selection) / Keep all active overrides
Alt+EnterStart 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?

  1. Press S (or Alt+Enter, or :stage) to enter Staging.
  2. Queue any combination of lane launches, releases, mutes, solos, and a section jump—nothing fires yet (u unstages the last gesture).
  3. Press S again (or Alt+Enter → Enter/S, or :stage fire) to fire every staged change atomically on one boundary (Esc or :stage discard cancels).

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+C or :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 on Auto-Record Takes (UserConfig::auto_record_takes = true) to auto-arm take recording whenever you press Space (see Chapter 6).

Press gt (Ctrl+t) to open the Take Deck below Arrange (or zz to zoom full-screen):

Keys in gtEx CommandAction
tr:take arm|disarm|toggleArm 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_BARKeep 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 discardDiscard the active unsaved take (confirmation-guarded via Mode::Confirm when events exist)
—:take load PATH.take.jsonlReload 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 .rbs songs, bake factory kits, and control a running GUI session live over --ctl in 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; overrides config.json for this session).
  • --buffer-size FRAMES: preferred live audio callback buffer size (32..=8192 frames; overrides config.json for this session).
  • --sample-dir DIR / --preset-dir DIR: repeatable extra search roots (--sample-roots-only restricts Sample Browser discovery to explicit --sample-dir roots).
  • --session-dir DIR: override the per-project session directory (instance lock, recovery.json, armed takes/, default ctl.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:

SubcommandDescription
cadence ctl state [--compact]Fetch live session state, transport position, revision, and (without --compact) full project JSON.
cadence ctl metersFetch 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.toml contract (crates/app/Cargo.toml): Depends strictly on anyhow, cadence-core, cadence-formats (feature-gated rbs), serde, and serde_json (plus hound and tempfile for dev tests). Direct std::fs, std::env, or File:: calls inside crates/app/src/ are forbidden and verified by integration tests.
  • HostIo abstraction (crates/app/src/host_io.rs): All path queries, bounded reads, bounded directory scans, atomic writes, UserConfig persistence, PresetCatalog / SampleLibrary discovery, filter groove loading, portable bundle export, sample decoding, and take-journal sinks route through Arc<dyn HostIo>.
    • CoreHostIo delegates to cadence-core::store in production binaries.
    • MemoryHostIo provides a 100% pure in-memory virtual filesystem and MemoryJournalSink for deterministic, disk-free testing.
  • Pure Outcome intents: Mutating operations (App::apply, App::handle_key, App::handle_midi) return an Outcome value 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 through crates/app/src/param_ops.rs composing cadence_core::rack::* and cadence_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-step live_query_time.

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) and CurveVertex geometry (anti-aliased waveforms, filter/EQ frequency curves, Bezier Signal Graph & Patchbay cables, filled ADSR/Hold-Decay/reverb envelopes) emit into one Vec<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 Deck Patchbay tab (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) with pop_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 from assets/icons/cadence.svg, attaching winit::window::Icon (+ Windows taskbar icon) on window creation and setting macOS NSApplication::setApplicationIconImage on startup so unbundled terminal runs show the Cadence Dock/Cmd-Tab icon.
  • 3-stage wgpu + glyphon renderer (Rgba16Float HDR target):
    1. Main + Selective Emissive MRT pass: sdf_quad.wgsl + scope.wgsl write both main color and selective emissive channels (playhead, active notes, focused/active deck borders, scopes, clip indicators).
    2. Half-resolution separable Gaussian bloom: bloom.wgsl applies a 2-pass phosphor bloom scaled by theme.glow.bloom_strength.
    3. Additive composite + hermetic HiDPI typography: glyphon composites razor-sharp text via a hermetic FontSystem (create_embedded_font_system) backed exclusively by the 2 embedded JetBrains Mono faces—Regular (weight 400) and Bold (weight 700)—with zero OS font scanning or proportional fallback, programming ligatures disabled (calt/liga/clig/dlig via no_ligatures_features(), ensuring hints like -/=, !=, ->, and </> always shape as literal separate monospace glyphs), and a generation-swept TextBufferCache (TEXT_CACHE_EVICT_AGE = 120, TEXT_CACHE_TRIM_INTERVAL = 60, TEXT_CACHE_SOFT_CAP = 2048).

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, and FontTokens.
  • Deck framing (draw_deck_frame): Focused decks display the crisp cyan focus border (theme.accent.focus); Mode::Insert signals step-entry mode in amber (theme.accent.edit); Mode::Jam displays 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), and Studio 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:

ModeTriggerRole
NormalDefaultModeless workspace: pure spatial navigation (hjkl/HJKL), direct 2D manipulation & reorder (Alt+hjkl/HJKL), one-hand scalar adjust (,/. </>), and canonical action verbs.
Inserti on editable Pattern NotesPiano step entry (zsxdcvgbhnjm, + Shift accents, 1–8 scale degrees, </> octave, . rest, Left/Right step cursor).
Jamgj / Ctrl+Shift+jModal floating live-performance keyboard (top-row lanes, number-row sections, bottom-row chromatic piano, Tab/Shift-Tab bank).
ValueInputEnter on any scalar controlExact number/unit/text entry with live validation and formatted preview.
MiniEditorEnter on a Mini patternLive-validated Mini-Notation code editor with Cycle 1 note preview.
Overlays & BrowsersCtrl+Shift+<key>, :, /, ?, n, P, B, g/t/z/vFuzzy 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:

TierKeysInvariantUndo / Repeat
1. Navigateh 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 / TabsH 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 & ReorderAlt+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)

Deckg PrefixDirect Ctrl
ArrangegaCtrl+a
PatterngpCtrl+p
BankgbCtrl+b
MixergmCtrl+m
Instrument RackgiCtrl+i
MacrosgkCtrl+k
TakegtCtrl+t
Signal GraphgGCtrl+g
Devices (Audio | MIDI)gd (preserves active tab; :audio / :midi jump directly)Ctrl+d
Output Monitor (toggle)goCtrl+o

All Modals & Overlays (Ctrl+Shift+<key>, always Shift)

Modal / OverlayDirect / g PrefixCtrl+Shift Chord
Action Palette:Ctrl+Shift+p (works in Normal & Jam)
Jam (modal floating overlay)gjCtrl+Shift+j (toggles Jam ON and OFF even inside Jam)
File HubgfCtrl+Shift+f
File Hub: Opengf (tab 1)Ctrl+Shift+o
File Hub: Save As / Bundlegf (tab 2)Ctrl+Shift+s
File Hub: Export Audiogf (tab 4)Ctrl+Shift+e
Song Properties / InfogPCtrl+Shift+i
Settingsg,Ctrl+Shift+, (plus Ctrl+, alias)
Sample BrowserB / gSCtrl+Shift+b
Create New Object MenunCtrl+Shift+n
Help?Ctrl+Shift+/ (i.e. Ctrl+?)

Core CUA & Window Shortcuts

ChordScopeBehavior
Ctrl+sNormal (also Settings / Devices / Take)Save immediately (opens File Hub Save tab only if untitled)
Ctrl+z / Ctrl+Shift+z (+ Ctrl+r)NormalUndo / Redo (alongside u / U)
Ctrl+cAny modeCancel overlay/input back to Normal (restoring live-preview browsers); in Normal opens Quit confirm
Ctrl+wNormalWindow / Deck prefix (Mode::Window, alias of z)
Ctrl+= / Ctrl+- / Ctrl+0Normal / InsertHorizontal zoom in / out / reset (only when Arrange or Pattern focused)
Ctrl+uText inputs / SearchClear active input buffer

Alt — Top-Row Live Performance + Home-Row Direct Manipulation

ChordScopeBehavior
Alt+1..0Any mode (non-repeat)Section jump 1–10 in current bank (or stage jump)
Alt+q..pAny mode (non-repeat)Open lane layer for bank lanes 1–10
Alt+m / Alt+MAny mode (non-repeat)Mute focused lane (or Mixer channel) / Unmute all lanes
Alt+s / Alt+SAny mode (non-repeat)Solo focused lane (or non-Master Mixer channel) / Clear all solos
Alt+x / Alt+XAny mode (non-repeat)Release focused lane / Release all lanes
Alt+c / Alt+CAny mode (non-repeat)Commit / Keep focused override (or Take selection on Take deck) / Keep all overrides
Alt+EnterAny mode (non-repeat)Toggle / fire Staging (Mode::Stage)
Alt+BackspaceNon-text decks (non-repeat)Reset focused parameter / fader / pan / send / macro / cable / setting to default
Alt+h/j/k/l & Alt+H/J/K/LNon-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

KeyBehavior
gGo 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
tTransport 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
zWindow 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 / HomePlay / Pause · Stop & rewind
u / UPop staged change or Undo / Redo
S / M / RStage 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 / BackTabCycle focus across open decks forward / backward
0 / $ / G / EndStart / end of the deck’s active focused list or timeline (never leaks to hidden cursors)
PgUp / PgDnPage along the deck’s primary scrollable axis
EscCancel MIDI Learn → clear count → discard staging → clear Take marks → back() (stop audition / deselect cable / unzoom / pop trail)
BackspaceCancel pending timeline jump else back()

3E. Canonical Action Verbs

KeyIntentScope
EnterPrimary action: open / drill-down on links & containers · launch on Bank Parts · toggle on booleans & Rhythm · open exact ValueInput on scalarsEvery deck
aContextual 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)
AUniversal Audition / PreviewPattern, Part, Placement, Bank Parts, Rack (all 3 tabs), PresetBrowser, SampleBrowser, Pickers
xRemove / unlink / release focused child itemArrange (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)
XDelete 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)
rRename / edit metadataInstrument, Module, Quick Pin, Zone, Channel, Effect, Pattern (incl. literal length/mode), Part, Lane, Section, Duck, Macro slot, Devices (r rescans audio/MIDI ports)
dDerive / duplicate (non-destructive)Pattern (Draft::derive), Zones (duplicate zone), Arrange (duplicate placement), Mixer/Channel/Graph (Add Duck)
eEdit / inspect Modulation & Macro linksAny 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
mMute / Bypass / Mode toggleLane 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)
sSoloLane Solo (Arrange, Bank), Channel Solo (Mixer, Channel)
y / p / PClipboard (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
vView / Visual / Move FXArrange views prefix (vp/vo/vr), Bank Parts ↔ Material, Take visual range, Move Effect (Detail::Channel/Effect/Mixer Insert)
fFork (or Add Effect on Mixer/Channel)Pattern fork, Placement fork, Filter groove fork
oOpen detail / local occurrence / route output / stack chordMixer → Detail::Channel; Placement/Inspect → local occurrence; Rack/Graph → route output; Pattern Notes → stack chord voice
iStep Insert (Pattern Notes only)Enters piano-keyboard Mode::Insert
CClear 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): Wide decks (Arrange, Output, Take, Graph, Midi [Devices], Macros) stack horizontally; Tall decks (Bank, Mixer) dock along the right column; Block decks (Pattern and 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> or Enter records a Navigation snapshot on back (up to 32 entries) so Esc unwinds 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:

  1. Uniform control lists (crates/gui/src/decks/object.rs, crates/app/src/controls.rs): j/k walks rows and w/b jumps groups on every control list regardless of 1-column or 2-column visual flow; bare h/l never mutates.
  2. Rack Zones horizontal Zone strip (crates/gui/src/decks/instrument/zones.rs): Renders a scrollable horizontal Zone pill strip at the top of Zones (matching Panel’s module strip) so h/l selects zones left-to-right, j/k walks Zone/Voice/Rack controls below, and Alt+j/k reorders zones.
  3. Bank Parts row-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.
  4. Mixer vertical channel-detail stack (crates/gui/src/decks/mixer.rs): Renders the selected channel’s FX, SND, OUT, and DUCK slots as a vertical stacked list below the strips so j/k slot navigation and Alt+j/k Insert reorder match the visual axis 1:1 (omitting unfocusable OUT → Master on Return and Master channels).
  5. Macros 1D horizontal dial strip + scrollable Bindings (crates/gui/src/decks/macros.rs): Keeps M1–M8 in a single horizontal strip across all pane widths and scrolls the vertical Bindings table around the focused row.
  6. Devices (Audio | MIDI) navigable inspector rows (crates/gui/src/decks/midi.rs): Renders Audio tab rows (AUDIO INTERFACE, AUDIO INPUT & RECORDING, ENGINE & RECOVERY — 11 typed AudioDeckRows) and MIDI tab rows (DEVICE & PROFILE — 5 typed MidiDeckRows: IN, OUT, Profile, Pads, Pickup — directly above MAPPINGS) as standard vertical inspector rows with H/L switching tabs, keeping global t, i, and Backspace unshadowed.

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):

#DeckJumpDeckViewRole & Key Capabilities
1Arrangega / Ctrl+aArrangePlacements (vp), Evaluated Overview (vo), Evaluated Piano Roll (vr), live override rows, pending/staged badges, sections (H/L, w/b), Event Provenance (Enter)
2Bankgb / Ctrl+bBankRow-oriented Launchpad (Parts) & searchable Material pattern/section library (v toggles)
3Patterngp / Ctrl+pPattern2D 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)
4Mixergm / Ctrl+mMixer32-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
5Macrosgk / Ctrl+kMacrosAll 8 Project Macros (M1..M8) in 1 horizontal strip + scrollable Bindings, live automated sweeps, native-unit spans, inverted badges, MIDI CC badges
6Devices (Audio | MIDI)gd / Ctrl+dMidiTwo-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
7GraphgG / Ctrl+gGraphInteractive 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)
8Takegt / Ctrl+tTakeExplicitly 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
9Instrumentgi / Ctrl+iInstrumentUnified 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
10Effect / ObjectEnterEffect / ObjectDedicated 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
11Outputgo / Ctrl+oOutputNon-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/l bar ±1 (Placements) or step ±1 (Overview/Roll) · j/k lane ±1 · H/L prev/next section · w/b section (Placements) or note event (Overview/Roll) · 0/$/G start/end · PgUp/PgDn lanes ±6 or visible bar page · =/- quick zoom.
    • Direct Manipulation (Placements): Alt+h/l move start ±4 steps (Alt+H/L ±16) · Alt+j/k move placement across lanes · ,/. shrink/extend length ±4 steps (</> ±16).
    • Verbs: Enter open Detail::Placement (or Place workflow on empty bar; ArrangementInspect on Overview/Roll) · v views (vp/vo/vr) · x release override else delete placement · X delete section (or lane) · r edit section (or rename lane) · d duplicate placement · m/s lane mute/solo · [/] loop start/end · y/p/P yank/paste.
  • Pattern (gp / Ctrl+p — Notes, Rhythm, Values, Derived, Mini):
    • Shared: h/l step ±1 · H/L & PgUp/PgDn bar ±16 · 0/$/G first/last step · =/- quick zoom · A audition · d derive · r edit metadata/length/rename · f fork · X delete pattern (confirm) · y/p/P yank/paste · ; repeat last edit.
    • Notes: j/k chord voice ↓/↑ · w/b next/prev active note · Alt+j/k pitch ±1 deg (Alt+J/K ±1 oct) · Alt+h/l gate ±0.25 steps (Alt+H/L ±1.0) · ,/. velocity ±5% (</> ±15%) · [/] (and #) flat/sharp accidental · c/C cycle StepCondition · o stack chord voice · m toggle step rest/active · x delete voice · X clear step · i Step Insert · Backspace (in Placement scope) re-inherit step from definition.
    • Values: w/b next/prev breakpoint · Alt+j/k & ,/. value fine (±0.01 / ±1 deg) · Alt+J/K & </> coarse (±0.10 / ±7 deg) · Alt+h/l slide breakpoint ±1 step (Alt+H/L ±4) · Enter exact ValueInput · m toggle Hold ↔ Ramp · x delete breakpoint · e inspect/jump downstream Modulation/Link consumers.
    • Rhythm: w/b next/prev hit · Enter / x toggle hit directly.
    • Derived / Mini / Generators: j/k source chip (Derived) · Enter / gs open selected source (Derived) or Mode::MiniEditor (Mini) · F freeze to literal pattern.
  • Modular Rack (gi / Ctrl+i — Panel, Patchbay, Zones):
    • Shared: H/L switch tab (Panel | Patchbay | Zones, or :page panel|patchbay|zones) · A audition · P Preset Browser (incl. Save Preset & R reload) · B Sample Browser (auto-inserts Sampler -> Out.In via ensure_zone_sampler_module when absent and applies RIFF smpl/inst metadata) · o route output channel · r rename instrument (or focused module/pin/zone) · X delete instrument (confirm).
    • Panel: h/l Module pill (Quick + every module) · j/k vertical control (w/b group) · Alt+h/l & ,/. fine (Alt+H/L & </> coarse) · Alt+Backspace reset · Enter exact ValueInput (or open Sampler/Link) · Alt+j/k reorder pin (Quick pill) · a add module · x remove module (never Out) · p pin/unpin · e edit/bind Macro & Modulation links. Displays all 12 pre-sampled GPU ModuleVisualView visualizers (PinnedOverview, Vco, Sampler, Noise, Env, Lfo, Filter, Vca, Drive, LoFi, Resonator, Out).
    • Patchbay: 4-column cable_graph.rs (SOURCES → MODULATORS → PROCESSORS → VCA / OUT) · h/l column · j/k module card · w/b ([/]) cycle attached cables · Alt+h/l & ,/. fine cable amount (Alt+H/L & </> coarse) · Alt+Backspace reset · Enter jump to module Panel or cable exact ValueInput · a add module · c connect cable · C select/edit cable amount · x disconnect cable (else remove module) · p pin cable · e edit/bind Macro & Modulation links.
    • Zones: h/l horizontal Zone pill · j/k vertical Zone/Voice/Rack control (w/b group) · Alt+h/l & ,/. fine (Alt+H/L & </> coarse) · Alt+Backspace reset · Enter exact ValueInput / Sample Browser · Alt+j/k reorder active Zone · a "Add Zone…" picker · d duplicate zone · x delete zone · r rename zone · e edit/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 ....
  • Mixer (gm / Ctrl+m) & Object Details (Channel, Effect, Part, Placement):
    • Mixer: h/l channel strip (H/L & PgUp/PgDn page; 0/$/G first/Master) · j/k vertical slot (Fader → Pan → Insert → Send → Output → Duck) · Alt+h/l & ,/. fine (Alt+H/L & </> coarse; step sizes aligned with Detail::Channel) · Alt+j/k push Fader dB or reorder Insert · Alt+Backspace reset · Enter open Insert / bus picker / EditDuck / exact ValueInput · o open Detail::Channel · a add picker (c Channel / f Effect / w Send / d Duck) · r rename · m/s mute/solo (b bypass Insert) · v move Insert · e links · x remove child · X delete channel (confirm) · C clear clip.
    • Object Details: j/k vertical control (w/b group; bare h/l strictly no-op) · 0/$/G first/last · PgUp/PgDn ±6 · Alt+h/l & ,/. fine (Alt+H/L & </> coarse) · Alt+Backspace reset · Alt+j/k reorder Insert (Channel/Effect) · Enter drill-down link or exact ValueInput · e edit/bind links · r rename/edit · x/X remove/delete · deck-specific verbs (Channel: m/s/v/b/C; Effect: m/v, Filter P/f; Part: A/a; Placement: A/r/f/o).
  • 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 slot M1–M8 · j/k Dial header ↔ scrollable Bindings · Dial: Alt+h/l & ,/. ±2% (Alt+H/L & </> ±10%), Alt+Backspace 0%, Enter ValueInput, a bind picker, r rename, e driving Mod, x/X unbind all / clear slot · Binding: Alt+h/l & ,/. min, Alt+H/L & </> max, Alt+j/k reorder, Enter jump target, v invert, x unbind row.
    • Bank: v toggle Parts ↔ Material. Parts: j/k lane · h/l part in lane · 0/$/G first/last lane · Enter launch (Shift+Enter immediate at now) · A audition · a add Part · r edit phase/offset · x release lane · X drop Part · m/s mute/solo. Material: j/k pattern (PgUp/PgDn, 0/$/G) · Enter/l open Pattern · h focus left deck · A audition · d derive · f fork · r rename/edit · X delete pattern (confirm).
    • Signal Graph: h/l non-empty column · j/k node row (0/gg top, G/End bottom) · Enter jump to deck · o route output · e edit cable · x/X unlink cable / unlink all · a add connection (or s/m/d quick-add).
    • Take: h/l bar (0/$/G start/end) · v visual range · Enter / Alt+c keep range · x clear marks · X discard take (confirm) · Ctrl+s save take.
    • Devices (Audio | MIDI): H/L switch Audio ↔ MIDI tab · j/k vertical rows (w/b group jump; bare h/l no-op) · Alt+h/l & ,/. cycle values (Alt+Backspace reset) · Enter picker / run action / MIDI Learn · r rescan audio or MIDI ports · Ctrl+s save config. On MIDI: a add mapping · v toggle invert · x/X delete mapping / clear all user mappings (confirm).
  • Settings (g, / Ctrl+,), Song Properties (gP / Ctrl+Shift+i), Modals & Browsers:
    • Settings & Song Properties: j/k row · w/b group · bare h/l no-op · Alt+h/l & ,/. fine (Alt+H/L & </> coarse) · Alt+Backspace reset · Enter exact ValueInput / title edit · a add dir (g,) · x remove dir (g,) · F OS folder dialog (g,) · Ctrl+s save (g,) · c cycle boundary picker.
    • Browsers, File Hub & Help: h/l, H/L, Tab/BackTab switch horizontal tabs/categories (FileHub Export rows adjust values with Alt+h/l and ,/., keeping H/L/Tab/1–4 on tabs) · j/k list · / search · A audition · Space play/pause · Enter open/commit · Esc clear search → cancel/restore.

4E. Workspace Presets & Window Keys (z / Ctrl+w)

KeyAction / Layout Preset
z1Compose: Pinned Arrange + working Pattern
z2Perform: Pinned Arrange + Bank (Parts) + Output
z3Sound Design: Pinned Pattern + Output + working Instrument (fallback Bank)
z4Mix: Pinned Arrange + Output + working Mixer
zz / zp / zx / zoToggle full-screen zoom / pin focused deck / close deck / keep only focused deck
zh/zj/zk/zl, zwDirectional deck focus movement / cycle focus (Tab)
z= / z- / z0Zoom Arrange/Pattern timeline in / out / reset (also Ctrl+= / Ctrl+- / Ctrl+0)

4F. Modal Overlays (OverlayView)

  1. 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.
  2. PresetBrowser (P on 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 full Project snapshot (j/k preview, / search, A audition, Space transport, Enter single-transaction commit, Esc zero-trace restore).
  3. GrooveBrowser (P on Filter Effect): Live filter groove browser across the 128-slot FilterEnv bank (24 MIT factory grooves + user grooves) with preview on scroll, Save-to-Bank, and Fork-to-Pattern (f).
  4. SongProperties (gP / Ctrl+Shift+i): Modal editor for Title, Tempo (BPM), Key Root, Scale (all 13 NAMED_SCALES), Length (Bars), End Rule, and Live Timing on the u undo stack.
  5. MiniEditor (Enter on Mini): Dedicated live-validated Mini-Notation editor (cadence_core::mini::parse_mini) with real-time Cycle 1 event count and resolved note preview.
  6. ValueInput (Enter on scalar controls): Unified exact scalar entry modal with live parse validation and formatted preview across Pattern Values, all ParamAddress controls, Rack zone structural fields, Macro dials, Placement offsets, and Song Properties.
  7. FileHub (gf, Ctrl+Shift+f/o/s/e): 4-tab Open/Recent (with .rbs import preview when feature = "rbs" is enabled), Save & Bundle, Import (auto-closes on preset/profile load), and Export (WAV/Stems), universal / search, H/L/Tab/1–4 tabs, and F native OS dialogs.
  8. Browser (B / gS / Sample rows): Universal / sample browser with async off-thread preview decoding, live auditioning, and automatic Sampler -> Out.In module insertion + RIFF smpl/inst metadata application on the active Rack zone.
  9. 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).
  10. Settings (g, / Ctrl+, / :settings): Persisted UserConfig editor: theme, startup preset, output monitor, follow, Auto-Record Takes, default BPM/key, project Live Timing, and auto-refreshing sample_dirs / preset_dirs.
  11. Help (? / Ctrl+Shift+/): 7-tab wrapped, universal / searchable reference (All, Navigate, Compose, Mini & Algebra, Sound & FX, Live & Jam, Files & CLI; H/L/Tab switch tabs).
  12. Confirm: Unsaved-dirty & destructive protection guarding Quit, New, Open, ImportRbs, DeleteChannel, ClearMidiMappings, and DiscardTake.
  13. Tutorial, Picker, EventInspection, Inspect/Assets, and PrefixMenu legends (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 · Audio tab via Ctrl+d then H/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):
    • ta toggles quick recording immediately; tA opens the Record Audio workflow 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 a Sampler Rack 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 automatable ParamAddress, including Rack, Zone, Module, and Cable attenuverters), 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_pins first, then continuous active-zone module controls, then RackParams, then discrete pins), ProjectMacro { slot: 0..8 }, LaneGain, MasterGain, Transport (10 MidiTransportActions + universal MMC), LaunchSection, LaunchLanePart, MuteLane, SoloLane.
  • 1-Key MIDI Learn (M): Resolves the focused target automatically (Macro slot → Midi row → object-deck automatable parameter → Mixer channel gain/pan/send → Bank launch part → active Rack’s first pinned control, first Filter cutoff, or Rack Cutoff). Pressing x/Backspace while armed unlearns; Esc cancels. Learned mappings persist globally in UserConfig::midi_mappings.
  • Live Note & CC Recording (R): Enters notes in step-entry mode when stopped; while playing, overdubs quantized polyphonic chords and lazily creates/updates Values(Normalized, Ramp) automation curves for any moved MIDI CC or Project Macro (1500 ms gesture undo coalescing).
  • Bi-Directional Feedback (FeedbackProtocol::{None, StandardCcNote, ArturiaDaw}): App::sync_midi_feedback emits pure semantic MidiFeedback events (InitDawMode, 2-line OLED Display with value bar, RGB pad LEDs across MidiPadMode::{Notes, Sections, Mutes}, TransportLedKind LEDs, and CC echo) translated to hardware bytes by cadence-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 }, and Cable { zone: u16, cable: u16 }.
  • ParamAddress: Rack, Zone, Module, Cable, Channel, Send, and Effect (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> (and c<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 curated panel_pins first, then unique module parameters (disambiguating multiple Envs 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

ConstantValueSourceMeaning
VERSION1material/types.rsExact authoring schema version (zero legacy converters)
STEPS_PER_BAR16music.rsFixed 16th-note grid per 4/4 bar
MAX_BARS2048material/types.rsMaximum arrangement length (MAX_TIMELINE_STEPS = 32_768 steps)
MAX_PATTERNS2048material/types.rsMaximum pattern nodes in the project DAG
MAX_LITERAL_STEPS1024material/types.rsMaximum stored steps for Notes, Rhythm, Mini, Euclidean, Freeze
MAX_DEPTH32material/types.rsMaximum root-to-leaf DAG depth (enforced per path, memoized by (Id, depth))
MAX_INSTRUMENTS16material/types.rsMaximum instrument instances
MAX_LANES16material/types.rsMaximum arrangement lanes
MAX_PARTS1024material/types.rsMaximum part bindings
MAX_PLACEMENTS4096material/types.rsMaximum total placements across all lanes
MAX_LINKS16material/types.rsMaximum per-note ParameterLinks (P-locks) per Part
MAX_GLOBAL_MODULATIONS256material/types.rsMaximum global Modulation relationships
MAX_SECTIONS256material/types.rsMaximum named arrangement Sections
MAX_TRANSACTION_EDITS16_384material/types.rsMaximum Edit operations per atomic transaction
MAX_DERIVED_OFFSET1_048_576material/types.rsMaximum |offset_steps| on Placement or LanePart
MAX_CHORD_TONES5music.rsExtra stacked voices per Step (up to 6 simultaneous notes)
MIN_DEGREE / MAX_DEGREE-127 / 128music.rsScale degree bounds covering full MIDI 0..=127 in any scale
MAX_ZONES / MAX_CHOKE_GROUPS32 / 8rack/types.rsKey/velocity zones and choke groups per RackPatch
MAX_MODULES_PER_ZONE / MAX_CABLES_PER_ZONE24 / 64rack/types.rsEurorack modules and patch cables per RackZone
MAX_PANEL_PINS16rack/types.rsCurated Quick Panel performance pins (PanelPin) per RackPatch
MAX_PROJECT_MACROS8macros.rsProject Macros M1..M8 (index in 0..8)
MAX_MACRO_BINDINGS16macros.rsParameter bindings per Project Macro (MAX_MACRO_NAME_LEN = 32)
MAX_LANE_PARTS / MAX_PARTS_ON_LANES32 / 256material/set.rsLaunchable parts per lane and total across all lanes
MAX_BOUNDARY_BARS / MAX_LATE_TOLERANCE64 / 4material/set.rsMaximum Boundary::Bars span and late-tolerance steps
LIVE_RING_BARS / LIVE_RING_STEPS64 / 1024material/live.rsSliding live compilation window length
MAX_PROJECT_BYTES16 MiBcadence-appBounded 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::Hold only).
  • PatternType::Values(ValueUnit::Normalized) — continuous or stepped control values (0.0..=1.0, ValueMode::Hold or ValueMode::Ramp).

All 22 PatternKind Variants

Leaf & Literal Generators (6)

VariantFields & BoundsOutput TypeNatural Period
Notessteps: Vec<Step> (1..=1024)Notessteps.len() * lcm(step.condition.every)
Rhythmsteps: Vec<bool> (1..=1024)Rhythmsteps.len()
Valuesunit, period (1..=MAX_BARS*16), mode (Hold/Ramp), sorted unique points (1..=period)Values(unit)period
SeededValuesunit, period (1..=MAX_BARS*16), seed: u64, min <= maxValues(unit)period (SplitMix64 hash, Hold)
Minicode: String, steps: u16 (1..=1024)Notessteps * mini_cycle_multiplier(ast)
Euclideanpulses: u16, steps: u16, rotation: i16 (0 <= pulses <= steps <= 1024)Rhythmsteps (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)

VariantInput TypesParameters & BoundsOutput Type & PeriodSemantics
AddDegreesNotes, Values(Degrees)—Notes, lcm(p_n, p_v)Shifts each active step & chord tone by rounded degree value sampled at time + offset
MaskNotes, Rhythm | Notes—Notes, lcm(p_n, p_r)Passes source note events only on steps where mask is active
TransposeNotessemitones: -96..=96Notes, pChromatically transposes root & chord tones, remapped via midi_to_degree
NotesFromValuesValues(Degrees), Rhythm | Notesdegree_offset: -63..=63, velocity, gateNotes, lcm(p_v, p_r)Generates notes on every rhythm sub-step offset with degree = round(val) + degree_offset + 1
TimeScaleNotes | Rhythmnum: 1..=16, den: 1..=16Same, 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
SwingNotesamount: 0.0..=0.45Notes, lcm(p, 2)Delays odd 16th steps by amount, carrying offset + amount >= 1.0 cleanly into the next even step
RatchetNotescount: 1..=8Notes, pSubdivides each hit into count evenly-spaced retriggers (5% per-hit velocity taper floored at 0.5×, gate / count)
ShiftAnysteps: i32Same, pRotates pattern in time (source(time - steps))
ReverseAny—Same, pExact period involution (Reverse(Reverse(x)) == x); mirrors sub-step offset > 0 to 1.0 - offset
ChanceNotes | Rhythmprobability: 0.0..=1.0, seed: u32Same, pDeterministic per-hit gate using det_hash(seed, id, time, i) < probability
EveryTwo same-type sourcesinterval: 2..=64Same, lcm(p_base * interval, p_alt)Evaluates alt on every interval-th cycle of base (cycle mod interval == interval - 1)
ArpNotesmode: ArpMode, rate: 1..=4Notes, pCollects all pitches held/sounding at time (lookback up to min(p, 65) steps), steps Up/Down/UpDown/Random at rate sub-steps/step
RangeFoldNoteslow_midi <= high_midi <= 127, span >= 11Notes, pOctave-folds all pitches & chord tones into [low_midi, high_midi]
Concat1..=16 same-type sourcesparts: Vec<Id>Same, sum(p_i)Plays parts[0], parts[1], … end-to-end
Stack1..=16 same-type Notes | Rhythmparts: Vec<Id>Same, lcm(p_i)Layers sources simultaneously (merged sub-step events sorted by offset, or logical OR for Rhythm)
ShapeNotes, Values(Norm), opt. Values(Norm)velocity, gate: Option<Id>Notes, lcmMultiplies 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 octave 4) 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] or c4,e4,g4 (up to MAX_CHORD_TONES + 1 = 6 notes, validated at parse time).
  • Cycle alternations: <c4 e4 g4 b4> selects one branch per cycle cycle.rem_euclid(len).
  • Chainable modifiers: *N repeat (1..=16), /N slow (1..=16), @W relative weight (0.125..=32.0), (k,n) / (k,n,r) Euclidean (0 <= k <= n <= 64), ? (0.5) / ?p (0.0..=1.0) deterministic chance via det_hash, ! accent (velocity = 0.98, default 0.80; gate = 0.85 * dur, clamped 0.08..=64.0).
  • Cycle period: mini_cycle_multiplier computes the exact LCM of all nested /N slow factors and <...> alternation lengths so PatternKind::Mini integrates cleanly with Every, Concat, Reverse, and Boundary::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 }: Every Notes evaluation at integer 16th-note step yields 0, 1, or many events sorted ascending by fractional offset ∈ [0.0, 1.0).
  • Value interpolation (eval_value_points): ValueMode::Hold latches the prior breakpoint; ValueMode::Ramp linearly interpolates across wrapped period boundaries at arbitrary fractional f64 step time. Project::value_mode propagates Ramp cleanly through Shift, Reverse, Every, and Concat.

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):

  1. Copy-on-write atomicity: Up to MAX_TRANSACTION_EDITS (16_384) edits execute against a cloned candidate Project. Any failure discards the candidate completely; the live document is untouched.
  2. Monotonic stable IDs: Entity IDs (Id = u64) are allocated monotonically by Document and never recycled across undo/redo.
  3. Unified modular Rack instrument mutations:
    • Edit::CreateInstrument { instrument } — creates a new Rack instrument (fails if ID already exists).
    • Edit::UpdateInstrumentMeta { id, name, channel } — renames or re-routes an instrument without touching its RackPatch.
    • Edit::UpdateRackPatch { id, rack } — replaces an instrument’s validated RackPatch (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, and Edit::UnpinPanelControl.
    • Zone & graph structural invariants (RackPatch::validate, RackZone::validate): Every Rack holds 1..=32 zones with unique nonzero id: u16; every zone holds 1..=24 modules with exactly one mandatory Out module (RemoveRackModule and AddRackModule both protect the singular Out module) and 0..=64 patch cables with validated OutPort::Out → accepted InPort compatibility, unique (from_module, from_port, to_module, to_port) edges, and finite attenuverter amounts within cable_amount_range(target_kind, to_port).
  4. Automatic stale Rack reference pruning: Whenever UpdateRackPatch, RemoveRackZone, RemoveRackModule, or DisconnectCable removes zones, modules, or cables (with RemoveRackModule also severing all attached cables), mutate immediately runs prune_stale_instrument_refs to prune dead panel_pins, project.modulations, and part.parameter_links targeting that instrument. At transaction commit, any edit touching instruments, channels, or Master also runs Project::prune_macro_bindings() before final validate().
  5. Compile-time typed channel & effect edits (Edit mixer 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 touching ChannelKind, strip, or inserts.
    • 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 preserving id, name, bypassed, kind, and Macro bindings.
    • Edit::UpdateEffect { device, name, bypassed, kind } — updates device metadata/bypass/patch while enforcing std::mem::discriminant(&existing.kind) == std::mem::discriminant(&incoming) when kind is Some.
    • Channel strip gain / pan updates route through Edit::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.
  6. Placement, overlap & asset portability invariants:
    • Placements on the same Lane may not overlap ([start_step, start_step + length_steps)).
    • Placements sharing the same InstrumentInstance across different lanes may not overlap; simultaneous parts require separate instrument instances.
    • Placement-local Exception steps must have unique relative offsets < length_steps and must be unconditional (StepCondition::ALWAYS).
    • Sample paths on every SamplerModule across every zone (walked via one SPOT iterator RackPatch::sampler_modules() across validation, asset discovery, SampleBank loading, and Save As / Bundle relativization) must never be absolute filesystem paths — only project-relative paths or catalog labels are accepted.

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): Maps raw = song + (transport - from). If region = Some((start, len)) with len > 0 and raw >= start, wraps into start + (raw - start) % len. Otherwise, once raw >= song_length: EndRule::Loop wraps raw % song_length, while EndRule::Stop and EndRule::Continue return None.
  • song_step_unbounded(transport): Evaluates without wrapping or stopping at song_length, used when Keep extends 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 when EndRule::Stop is active with no loop region and no earlier scheduled remap.
  • remap, cancel_after, prune_before: O(log n) binary search via partition_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 VariantStep QuantumNotes
NowNone (immediate)Lands on next_step
Beat4Next quarter-note downbeat
Bar16Default launch boundary (LiveTiming::default())
Bars { count }count * 16count ∈ 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’s InstrumentInstance from any other active override. PhaseMode::Song follows the timeline’s song step; PhaseMode::Restart counts from step - anchor.
  • Ordering invariants: Queued Change::Song and Change::Flags never overtake one another (at = at.max(last)). A new Launch/Release replaces any pending launch/release on the same lane; a new Timeline remap replaces any pending remap.
  • Staging (StagedChange): Collects Launch, Release, Mute, Solo, and JumpSection gestures without landing them until fired atomically on a single boundary (or discarded).
  • Sliding live ring: Performance::compile compiles [base, base + LIVE_RING_STEPS) (64 bars = 1024 steps, aligned to the bar of next_step - 1) into a ScoreWindow with live_window = Some(LiveWindow { start, end, stop_at }). When next_step >= base + LIVE_RING_STEPS / 2, the controller automatically recompiles and slides the ring forward.
  • Transient Audition: Compiles onto the same live ring (either solo: true when stopped or layered over one instrument when playing), synthesizing AUDITION_INSTRUMENT_ID if the project has no instruments. Auditions are never authored, recorded in takes, or written by Keep.

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> — dense 0..MAX_INSTRUMENTS array where each ScoreInstrument { id, name, rack: RackPatch, compiled_zones: Vec<CompiledZoneGraph>, channel } carries pre-compiled Kahn topologically sorted CompiledZoneGraph programs (1:1 with rack.zones, including z-1 feedback edge flags, lifetime_envs, sampler_slots, and SPOT column_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 via step_events(abs_step). Each ScoreEvent carries fractional offset ∈ [0.0, 0.9999], resolved MIDI note, velocity, gate, inline [ResolvedChordTone; MAX_CHORD_TONES], and (lock_start, lock_len) slice bounds into locks: 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 custom Filter trigger grids (filter_env_triggers), compiled external filter groove bank snapshot (filter_grooves), and MixerAutomation lanes.
  • 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):

  1. Tier 1 — Static Project Macros (apply_static_macros): Iterates project.macros in ascending index order (0..8), skipping any macro driven by a ModulationTarget::Macro. Evaluates binding.evaluate(mac.value) = (min + (max - min) * x).clamp(0.0, 1.0) (explicitly supporting inverted min > max spans) and writes directly onto ScoreInstrument.rack (before inst.compile_zones()) or Mixer.
    • Frame-based sampler guard: Static Macro bindings targeting frame-based ModuleParam controls (SampleStart, SampleEnd, LoopStart, LoopEnd, matched via InstrumentParam::is_frame_based()) cannot resolve against total_frames = 0 at compile time, so they emit a constant AutomationMode::Hold ModLane (unless already overridden by automation) which the audio engine resolves against the loaded sample’s actual sample.frames.
  2. Tier 2 — Automated Macro Fan-Out (ScoreBuilder::write_modulations): Processes all ModulationTarget::Macro { index } modulations sorted by ascending index (0..8). For each macro binding whose target is automatable (UpdatePolicy != Structural / is_automatable()), fans out the mapped curve into mod_lanes or mixer.automations (creating missing ChannelSend slots when targeting ParamAddress::Send).
  3. Tier 3 — Direct Modulations: Processes all non-Macro ModulationTargets (Instrument, Effect, ChannelGain, ChannelPan, Send), unconditionally overriding any Macro fan-out targeting the same parameter slot via upsert_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.

ModuleReal-Time ProcessorsShared Analytical / UI & Math SPOTs
math.rsSmoother (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.rsapply_strip_gain, apply_fader_gain, apply_pan_balancepan_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.rsNoiseGen (deterministic xorshift + Weyl seeding), PinkFilter (sample-rate-invariant Paul Kellet pink filter)GOLDEN_RATIO_32, SECONDARY_WEYL_SALT_32
osc.rsoscillator_sample, osc_b_fm, osc_b_fm_2x, step_vco_bank_fm_2xpoly_blep, poly_blamp, phase_wrap, ideal_waveform, unison_offsets, unison_detune_ratio, unison_gain_comp, fm_depth_from_amount, MAX_UNISON = 7
env.rsAdsrState, HoldDecayEnv, ModularEnv (EnvMode::{Adsr, HoldDecay}, pre-delay + multi-burst), RhythmicEnveval_adsr_curve, eval_modular_env_curve
biquad.rsStereoBiquad, Eq, TptOnePoleLpf, TptOnePoleHpf, DcBlockerBiquadCoeffs::{highpass, low_shelf, peaking, high_shelf}, BiquadCoeffs::magnitude_db, eq_response_db
filter.rsSvf, AcidLadder, RhythmicFiltersvf_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.rsDrive (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.rsLoFiProcessor (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.rsModalResonator (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.rsSamplerVoice (4-point Catmull-Rom Hermite stereo sample voice with loop crossfades & pitch CV)sample_hermite_stereo
dynamics.rsCompressor, 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.rsChorus, QuadratureLfoeval_quadrature
delay.rsDelay, DelayLine (int/linear/cubic)Lazy Delay::new_unallocated / allocate
reverb.rsReverb (8×8 Hadamard FDN + 4 diffusers)reverb_rt60_envelope, reverb_hf_rt60_envelope
resample.rsHalfband2x (8-tap polyphase 2× oversampling decimator), resample_stereoZero-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): Optional kit_name, 1..=MAX_ZONES (32) RackZones, curated Quick Panel pins (panel_pins: Vec<PanelPin>, up to MAX_PANEL_PINS = 16, pinning any Rack, Zone, Module, or Cable target), and 5 RackParams (all UpdatePolicy::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 nonzero id: u16, name (1..=32 chars), key range low_midi..=high_midi, root_midi, velocity layer low_vel..=high_vel, gain_db (-36..+12 dB), pan (-1..+1), optional choke_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_ms 0..=2000 ms, pitch_tracking, phase_reset), 1..=MAX_MODULES_PER_ZONE (24) RackModules (with exactly one mandatory OutModule), and 0..=MAX_CABLES_PER_ZONE (64) PatchCables.
    • 8 ZoneParams: Gain, Pan (Continuous); Glide, PitchTracking, PhaseReset, RootMidi (OnTrigger); VoiceMode, Legato (Structural — non-automatable, rejected by ParamAddress::is_automatable()).
    • Standard Drum MIDI Map (rack::drum_midi): 36 BD, 37 SD, 38 LT, 39 MT, 40 HT, 41 RS, 42 CH (choke 1), 43 CP, 44 CB/CR, 45 CY/RD, 46 OH (choke 1), 47 LC, 48 MC, 49 HC, 50 CL, 51 MA.
  • 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 + 10 panel_pins), Sampler (Blank Sampler: Sampler -> Filter @ 18.5 kHz -> VCA -> Out, Amp Env -> VCA.Cv + 9 panel_pins), Kit (Blank Kit: 1 full-range [Sampler -> Out] zone), and Modular (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):

#ModuleKindPatchbay ColumnAccepted InPortsParameters & DSP Implementation (cadence-core::dsp)
1Vco0 (SOURCES)PitchCv, FmIn, PwCvWaveform::{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
2Sampler0 (SOURCES)PitchCv, TrigInFirst-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
3Noise0 (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
4Env1 (MODULATORS)TrigInModularEnv 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
5Lfo1 (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])
6Filter2 (PROCESSORS)In, Cv2-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
7Drive2 (PROCESSORS)In, CvDriveMode::{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
8LoFi2 (PROCESSORS)InLoFiProcessor: 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
9Resonator2 (PROCESSORS)In, PitchCv, CvModalResonator (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
10Vca3 (VCA / OUT)In, Cvvca_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
11Out3 (VCA / OUT)In, CvSingular 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 .wv via Symphonia + custom RIFF chunk parser, bounded by MAX_SAMPLE_FILE_BYTES = 128 MiB, MAX_DECODED_SAMPLES = 33_554_432 floats, MAX_CACHE_BYTES = 256 MiB, MAX_LIBRARY_ENTRIES = 25_000, MAX_LIBRARY_SCAN_ITEMS = 100_000, with precomputed PEAK_BINS = 512 (min, max) envelope bins.
  • RIFF smpl & inst chunks automatically populate SampleMetadata (root_midi, has_root, fine_cents, low_midi/high_midi, low_vel/high_vel, SampleLoopMode, loop_start, loop_end) via SamplerModule::apply_metadata / apply_sample_defaults.
  • Single Sample SPOT: RackPatch::sampler_modules() walks every SamplerModule across every zone; module_sample_key(inst_id, zone_id, module_id) packs (1 << 63) | ((inst_id & 0x7FFF_FFFF) << 32) | (zone_id << 16) | module_id for collision-free SampleBank lookup.

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 PortNative RangeUnitDefaultSemantics
In (Audio)-2.0..=+2.0%1.0Stereo audio gain / phase inversion (multiple cables sum)
PitchCv-48.0..=+48.0st12.0Pitch modulation in semitones (Vco, Sampler, Resonator)
FmIn-1.0..=+1.0%0.35Audio-rate through-zero linear FM depth (Vco)
PwCv-0.45..=+0.45%0.20Pulse-width modulation (Vco)
TrigIn-2.0..=+2.0plain1.0Gate / trigger input (Env, Sampler; defaults to voice gate if unpatched)
Cv on Filter-6.0..=+6.0oct2.0Audio-rate cutoff modulation in octaves
Cv on Vca-2.0..=+2.0%1.0VCA / 4-quadrant Ring Modulator CV depth
Cv on Drive / Out-1.0..=+1.0%0.5Drive / Output CV modulation depth
Cv on Resonator-1.0..=+1.0%0.35Modal 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 across PATCHBAY_COLUMNS = ["SOURCES", "MODULATORS", "PROCESSORS", "VCA / OUT"].
  • Feedback safety (z-1 1-sample delay): Cycles and self-loops never crash or deadlock; any back-edge satisfying from_slot >= to_slot is flagged feedback: true and reads prev_slots[from_slot] (soft-bounded via FEEDBACK_SOFT_KNEE = 4.0 in ModularVoice).
  • Emits flat, zero-allocation CompiledZoneGraph (ops: Box<[CompiledOp]>, contiguous to_slot-grouped cables: Box<[CompiledCable]>, sorted module_slot_by_id and cable_index_by_id for O(log N) lookup, out_slot, reverse-BFS lifetime_envs, sampler_slots, and SPOT column_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 the VOICES = 256 slots owns a pre-allocated heap-boxed Box<ModularVoice> with fixed [ModuleState; MAX_MODULES_PER_ZONE], [ModuleParams; MAX_MODULES_PER_ZONE], [f32; MAX_CABLES_PER_ZONE], stereo slots/prev_slots, and inline per-voice P-lock tracking (MAX_VOICE_LOCKS = 32).
  • Per-sample f64 graph evaluation & Rack bus: Runs CompiledZoneGraph sample-by-sample with CONTROL_FRAMES = 16 smooth parameter updates (UpdatePolicy::Continuous), then passes voice output through a dedicated Rack-bus LowPass Svf (transparently bypassed when cutoff >= 19.9 kHz and res <= 0.001), pan_stereo_balance_f64, and unclamped smoothed db_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-free glide_coeff_ms and ModularEnv::adopt_progress_from, pre-spawn choke group fades (3.5 ms), P-lock vs continuous ModLane precedence across Rack/Zone/Module/Cable targets, and zero-alloc AudioRuntime::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).

#EffectKindParameters & Native RangesDSP Implementation (cadence-core::dsp)
1Eqhpf 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 dB4 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
2Filtermode (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..1Stereo 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)
3Compressorthreshold -48..0 dB, ratio 1..20 (log), attack 0.5..100 ms (log), release 10..1000 ms (log), makeup -6..+24 dB, mix 0..1Stereo-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
4Limiterceiling -18.0..-0.1 dB, input_drive 0..24 dB, release 10..1000 ms (log), mix 0..1Stereo-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
5Drivedrive_mode (Tape/HardClip/Fold), drive 0..1, asymmetry -1..+1, tone 600..18k Hz (log), output -12..+6 dB, mix 0..1Shared 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
6Chorusrate 0.05..6.0 Hz (log), depth 0..1, width 0..1, mix 0..1Dual-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
7Delaydelay_mode (PingPong/Stereo), time 0.5..32.0 steps (capped at MAX_DELAY_SECONDS = 12.0 s), feedback 0..0.88, mix 0..1Cubic 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)
8Reverbsize 0..1, decay 0.2..12.0 s, damping 500..18k Hz (log), predelay 0..120 ms, width 0..1, mix 0..1Stereo 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 = 4 per Audio/Group channel, MAX_DUCKS = 16 (recovery_ms: 10.0..=2000.0 ms, quadratic recovery 1 - depth * (1 - x)^2 triggered by source_part events), MAX_MIXER_AUTOMATIONS = 256.
  • DAG routing rules (Mixer::validate):
    • Audio outputs to Master or any Group.
    • Group outputs to Master or any other Group, with an explicit walk rejecting self-loops and multi-hop cycles (Group A → Group B → … → Group A).
    • Return outputs strictly to Master and may not hold outgoing sends.
  • Causal topological execution & ancestor mute/solo: On every adopt(), MixerEngine computes a zero-allocation Kahn topological order (group_order) for chained groups and resolves ancestor-aware source_enabled: muting a parent Group silences 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 chained Group → Group hops, computing exact differential pdc_delay frames applied via integer DelayLine reads (apply_pdc) before summing into parent Groups or Master. When no non-Master Limiter exists, every pdc_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 tanh or 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 a 5 ms linear fade-out at the end of rendered WAVs).
  • hot vs clipped metering (MeterState::observe):
    • hot latches on any channel (including Master) whenever |input| > 1.0 or |output| > 1.0 (> 0 dBFS informational 32-bit float headroom — not audible clipping on internal buses).
    • clipped latches strictly when a non-finite (NaN/±Inf) sample appears anywhere OR Master post-insert post-fader output exceeds 1.0 (> 0 dBFS at 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)

  1. 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 (Vco unison copies, zone/Out mono panning).
  2. 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 exact L/R ratio of pan_mono_equal_power (-3.50 dB at p = 0.25, -6.02 dB at p = 0.41, -7.66 dB at p = 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$$ Maps 0.0 → 0.0 (-inf dB), CHANNEL_GAIN_UNITY_NORM = 0.75 → 1.0 (0.0 dB exact unity detent), and 1.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 dB to 0.0 (-inf), stepping up from 0.0 at -60 dB, and snapping |db| < 1e-4 to exact 1.0.
    • format_db_value / format_gain_db: formats "-inf" below LIN_FLOOR_F32 and normalizes "-0.0" to "+0.0".
    • parse_channel_gain: accepts "-inf" / "-inf dB", "±N dB" (<= +6.021 dB, snapping 0 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:

InvariantEnforcement MechanismExact Constants / Structures
Zero RT heap allocationsVerified 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 & panicsNo Mutex, RwLock, unbounded mpsc, .unwrap(), .expect(), or panic! on audio pathsLock-free AtomicU64 / AtomicPtr / AtomicU32 / AtomicBool mailboxes with Acquire/Release ordering
Debug stack safetyLarge engine structs heap-boxed; verified by cargo test -p cadence-engine --libBox<MixerEngine>, Box<[Voice]> (VOICES = 256, each owning Box<ModularVoice>), Box<[Option<PendingSubEvent>]>, Box<[HeldNotes]>, Arc<Shared>
Sub-step frame schedulerZero-alloc pending sub-step event queue firing at exact fractional sample framesSUB_EVENT_QUEUE = 256 slots, each carrying up to MAX_INLINE_LOCKS = 16 inline ParamLocks (MAX_VOICE_LOCKS = 32 per active ModularVoice)
Lock-free control mailboxesBounded atomic slots bridging UI/MIDI/host to audio threadMAILBOXES = 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 suppressionFixed control block + click-free voice-steal fadesCONTROL_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 & recordingCPAL input callback writes strictly to bounded lock-free SPSC rings with zero disk I/O or locks on RT threadsStereo 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 ringSPSC 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 fallbackMulti-format CPAL stream (F32, F64, I32, I16, U16, 8_000..=384_000 Hz) with disconnect detection (is_failed()) & restart_device(), or paced --silent threadSILENT_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)]):
    {
      "id": "optional-client-token",
      "expected_revision": 12,
      "compact": true,
      "action": { "op": "set_tempo", "bpm": 132.0 }
    }
    
    Exactly one operation field must be present per request:
    • action — a typed cadence_app::Action (#[serde(tag = "op", rename_all = "snake_case")]), including get_state, edit, transaction (atomic up to 16_384 Edits), create_* (create_instrument / placed_part taking unified SoundChoice::{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 (plus import_rbs when built with --features rbs), and command.
    • cmd — a Cadence Ex command string (dispatched identically to Action::Command { line }, pushing onto the interactive u undo stack).
    • meters: true — returns live playback status, channel meters (input_peak, input_peak_hold, output_peak, output_peak_hold, hot, clipped), and Compressor/Limiter effect_meters (device_id, gain_reduction_db, gr_hold_db).
    • listen — structured audio capture (ListenRequest::Bars or ListenRequest::Live; see §2).
  • Optimistic concurrency (expected_revision): If supplied and expected_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: omits project/flags/selection for 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 ticks observe_transport every IDLE_TICK = 16 ms while 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_LEN short-path fallback (SessionDir::ctl_socket_path in crates/core/src/store.rs): Defaults to <session_dir>/ctl.sock. On Unix, if the path exceeds MAX_UNIX_SOCKET_PATH_BYTES = 96 bytes (safely below macOS’s 104-byte sun_path limit), 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::connect to reject a second live server before unlinking any stale socket; binds with 0o600 mode bits.
  • Non-blocking GUI integration: Accepts connections on cadence-ctl-accept and enqueues parsed requests over a bounded CTL_QUEUE_CAPACITY = 32 sync_channel (CLIENT_IO_TIMEOUT = 40 s), invoking set_wake (EventLoopProxy) so requests execute immediately even when the window is idle or occluded. Dropping CtlServer stops the listener and deletes both the socket and any auto-generated ear.wav.
  • Client discovery (resolve_ctl_socket): Checks in priority order: (1) --sock PATH, (2) --session-dir DIR, (3) CADENCE_CTL_SOCK environment variable, (4) newest live socket under <platform_state_dir>/sessions/*/ctl.sock.

cadence ctl CLI Subcommands (src/main.rs)

SubcommandRequest DispatchedNotes
cadence ctl state [--compact]action: GetStateFull or lightweight telemetry snapshot
cadence ctl metersmeters: trueLive channel peaks/holds/hot/clipped + Comp/Limiter GR
cadence ctl cmd <LINE> [--expected-revision N] [--compact]cmd: LINERuns any Ex command on the live GUI (undoable via u)
cadence ctl action <JSON> [--expected-revision N] [--compact]action: JSONRuns 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 by cadence_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 on Enter.
  • advance (optional) — duration string parsed by cadence_app::parse_duration (e.g., "2 bars", "4 beats", "16 steps") to advance the headless live transport clock.
  • expect (optional) — map of assertions checked after keys and advance:
    • 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 serialized Project JSON.

4. Crash-Safe Take Journal & Atomic Session Storage

Bounded Atomic Storage (crates/core/src/store.rs)

  • Bounded reads (store::read_bounded): Checks metadata().len() <= max_bytes and caps reads via File::take(max_bytes + 1) before allocating memory.
  • Atomic writes (store::write_atomic / write_atomic_bytes): Rejects payloads over max_bytes before touching disk, creates a unique sibling temp file .name.<pid>.<counter>.tmp (create_new(true)), flushes + sync_all(), atomically renames over destination, and fsyncs 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 via tr / :take arm, default OFF, or opt-in via UserConfig::auto_record_takes), pruned to DEFAULT_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):

  1. Header (line 1): TakeHeader { take: 1, title, start_step, active: Vec<Override>, project: Box<Project>, flags?, segment? } (where take: 1 and project are validated strictly against TAKE_VERSION = 1 and Project::VERSION = 1).
  2. Events & marks: TakeEvent { at: u64, label, change: TakeChange } (Launch, Release, ReleaseAll, Flags, Edits, Replace, Segment) interleaved with periodic transport TakeMark { mark: u64 } heartbeats.
  3. Seal line: TakeEnd { end: u64 } followed by sync_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..=80 printable non-control characters; optional category: 1..=48 characters (conventional categories "Synth", "Sampler", "Drums", "Kit", "Modular" backing the Preset Browser’s 6 category filter tabs All / Synth / Sampler / Drums / Kit / Modular).
  • PresetCatalog: Discovers .json presets across configured UserConfig::preset_dirs, CLI --preset-dir, and project-adjacent directories (MAX_PRESET_FILES = 2_048, MAX_PRESET_SCAN_ITEMS = 16_384), exposing by_category, find, find_by_category, is_bare_default_token, and names_hint. Missing or empty roots degrade cleanly with zero errors. normalize_preset_key maps 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:

  1. 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.
  2. Trims leading silence at ONSET_THRESHOLD = 1e-6, trims trailing silence at TAIL_THRESHOLD = -72 dBFS (0.00025118864) plus a TAIL_FADE_MS = 2.0 ms half-cosine tail fade, and writes mono WAVs automatically when |L - R| < MONO_EPSILON = 1e-5.
  3. Writes each 16-bit PCM WAV atomically via cadence_core::sampler::write_wav_with_metadata, embedding both RIFF inst (7-byte MIDI unity note, fine tune, key & velocity range) and RIFF smpl (unity note, pitch fraction, and optional loop points) chunks.
  4. Maps canonical drum channel names (BD, SD, CH/OH → choke group 1, etc.) to rack::drum_midi (36..=51), anchors portable sample locators at factory-samples/..., builds 1-based RackZone::sample_pad zones ([Sampler -> Out]), and writes the validated v1 Rack InstrumentPreset JSON (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_header reads 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-packed TinY SysEx block → creates 3 instruments & 3 lanes (TB-303 A, TB-303 B, TR-808; omits absent TR-909).
    • ReBirth 2.0 (CAT .... RB40, file versions 4.0, 4.1, 4.2): IFF container → creates 4 instruments & 4 lanes (adding TR-909 with flam subdivisions encoded as PatternKind::Mini).
  • Target Modular Rack & Mixer Mapping:
    • TB-303 A/B → canonical 6-module Acid RackPatch (Vco -> Filter(AcidLowPass) -> Vca -> Out, Amp Env -> Vca.Cv, Filter Env -> Filter.Cv) with curated panel_pins, official song.vintage shorter 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-zone Rack kits resolved from external PresetCatalog with Global Accent (ctrl 2) velocity calibration, BPM-accurate TR-909 flams (10..=42 ms / step_ms), PatternKind::Stack overflow safety for dense >6-voice simultaneous hits, and TR-808 primary/alt voice switch timelines (LT/MT/HT/RS/CP vs LC/MC/HC/CL/MA; missing external presets degrade gracefully with non-fatal RbsImportSummary::notices).
    • Mixer & FX: Synths and Drums Group buses; Master Level (ctrl 0) automation via ChannelGain { channel: ChannelRef::Master }; v4.2 per-channel Enable/Mute (ctrls 5,11,17,23) composed with channel gain; Echo Return using DelayMode::Stereo (straight 16ths / eighth-note triplets 4/3x) fed via post-fader, pre-strip-pan ChannelSend + ModulationTarget::Send; Dist using DriveMode::HardClip with synced output trim; PCF → rhythmic Filter referencing presets/filter_grooves.json; Comp → Compressor (zero auto makeup gain).
    • Musical structure & automation: Declarative per-device control tables (controls.rs), deduplicated shared patterns, derived Part.transpose for transposed 303 motifs, full launchpad lane.parts, Global Shuffle via PatternKind::Swing, event-driven sub-bar Song Mode placements preserving bar-locked/odd-length phase, automatic section detection, and jump-vs-sweep compressed Values automation curves (targeting (zone, module, param) and (zone, cable) cleanly while leaving project.macros empty 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 :mini material: All 22 PatternKind variants compose inside one bounded DAG (MAX_DEPTH = 32), share pure stateless evaluation (det_hash SplitMix64 + fractional sub-step offset ∈ [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: ScoreWindow is 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-mode Drive waveshaper, Halfband2x 2× oversampling filter, sample-rate-invariant NoiseGen/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 dB decay coefficient (decay_coeff_60db_ms), and dB formatter lives once in crates/core/src/dsp/ with zero I/O and zero heap allocation.
  • Structural impossibility of drift: Both cadence-engine (real-time DSP) and cadence-app::view (GPU curves and readouts) call cadence_core::dsp::* directly, and crates/app/src/view/live_params.rs mirrors the exact 3-tier Macro/Modulation precedence of crates/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 tanh or limiter behind Master. Clamping to [-1.0, 1.0] happens strictly at the final CPAL hardware DAC conversion and PCM WAV export boundaries.
  • Clear hot vs. clipped metering: Internal float buses exceeding 0 dBFS latch informational hot (recoverable headroom via faders or a Master Limiter); clipped latches strictly on non-finite samples anywhere or Master post-fader output > 1.0.
  • Independent gain factors & +6 dB headroom: Channel trim (0.0..=2.0, CHANNEL_GAIN_UNITY_NORM = 0.75 console power taper), direct ModulationTarget::ChannelGain (ChannelGainScale), and event-triggered sidechain Duck envelopes 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, every InstrumentInstance owns one unified Eurorack Modular Rack (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 deterministic z-1 1-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-alloc ModularVoice engine and one orthogonal parameter space (InstrumentParam::{Rack, Zone, Module, Cable}).
  • Structural Rack & mixer invariance: Every Rack zone enforces 1..=24 modules (MAX_RESONATORS_PER_ZONE = 4) with exactly one mandatory Out module (AddRackModule/RemoveRackModule both protect Out), validated port compatibility, and atomic pruning of stale panel_pins, modulations, parameter_links, and macro.bindings on zone/module/cable removal. On the console side, a Channel’s ChannelKind (Audio, Group, Return) and an EffectDevice’s EffectKind are 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-app depends solely on anyhow, cadence-core, cadence-formats (feature-gated rbs), serde, and serde_json — no audio backend, no MIDI backend, no windowing, and no direct std::fs/std::env access. All host I/O flows through HostIo (CoreHostIo on disk, MemoryHostIo in pure tests).
  • One controller, every surface: Interactive keyboard input, hardware MIDI, --key-script, --script, --stdio, and live GUI --ctl Unix socket requests all converge onto App::apply(Action) and one unified HostRequest protocol (src/host/protocol.rs).

7. Keyboard-First Native GPU Decks, Modeless Grammar & Hermetic Typography

  • GPU presentation over FrameView: cadence-app projects immutable semantic FrameView snapshots; cadence-gui renders them on native wgpu + glyphon through a single painter-ordered DisplayList with balanced scissor clipping, selective phosphor bloom, shared cable_graph.rs multi-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 outside crates/gui/src/theme.rs (Cadence Dark, Midnight Neon, Studio Light).
  • Hermetic 2-face embedded typography: GpuRenderer builds a self-contained FontSystem backed exclusively by bundled JetBrains Mono Regular (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 (and H/J/K/L) strictly navigate and switch tabs across every deck — zero accidental mutations.
    • Alt+h/j/k/l (Alt+H/J/K/L coarse) directly sculpt and reorder items along their visual screen axis with coalesced single-gesture undo, paired with one-hand ,/. (</> coarse) scalar adjustments and Alt+Backspace reset.
    • Six deck layout alignments keep every control list, Rack Zones strip, Bank Parts row, Mixer vertical slot stack, Macros horizontal dial strip, and Audio | MIDI Devices inspector strictly aligned 1:1 with the visual axes.
    • Only genuine input modes remain: Insert (i on Pattern Notes), modal Jam (gj / Ctrl+Shift+j), exact ValueInput (Enter), and live-validated MiniEditor (Enter on Mini).
  • 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, and cadence ctl cmd work without friction.
    • First-class sound & song dialogs: Unified 6-category Instrument Preset Browser (P) (All / Synth / Sampler / Drums / Kit / Modular + 4 bare RackTemplate defaults) with live non-destructive preview from a full Project snapshot (zero undo trace on Esc, single transaction on Enter), Song Properties (gP / Ctrl+Shift+i) spanning all 13 NAMED_SCALES, dedicated live-validated Mini-Notation Editor, Sampler sample assignment via B / Sample row (auto-inserting Sampler -> Out.In and applying RIFF smpl/inst metadata), unified Audio | MIDI Devices deck (gd / Ctrl+d), and universal / search.
  • Derived layout state & MIDI symmetry: Workspace, focus, and deck-gating queries compute purely from Layout with 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 Boundary steps with late_tolerance_steps catching just-late presses; StagedChange batches 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 a Sampler Rack + 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 (tr toggles arming live; Chrome displays TAKE ARM / ● REC TAKE (N) / ● TAKE CAPPED; Auto-Record Takes in Settings g, restores opt-in always-on capture) so routine playback never litters session folders. When armed, an off-thread .take.jsonl journal (TAKE_VERSION = 1) captures landed changes (never raw audio) alongside the starting v1 project, survives hard crashes up to the last flushed event, supports v Visual range marking and X confirmation-guarded discard in gt, 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-burst ModularEnv, LoFiProcessor, 32-mode physical ModalResonator, RIFF smpl/inst Sampler module, and 32-zone/8-choke-group kits) plus 8 zero-allocation effects (Eq, rhythmic Filter, Compressor, lookahead PDC Limiter, 3-mode 2×-oversampled Drive, Chorus, dual-mode Delay, Hadamard FDN Reverb) and nested Group → Group bus 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 RackTemplate defaults live in code) — v1 InstrumentPresets in presets/ (6 kits including baked and live-synth TR-808/TR-909/EDM Kit, 46 single-voice drum presets, 11 synth presets), the 24-groove clean-room MIT factory bank in presets/filter_grooves.json (extensible up to 128 slots via user banks, browsable live via P, forkable into editable patterns via f, and exportable back to presets/filter_grooves.json), and --render-kit-generated MIT factory-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 CommandWhat It Verifies
1cargo fmt --all -- --checkUniform workspace formatting across all crates, tests, and examples
2cargo clippy --workspace --all-targets -- -D warningsZero lint warnings across default features (audio, midi, gui, rbs)
3cargo clippy --no-default-features --all-targets -- -D warningsZero lint warnings in minimal headless configuration
4cargo test -p cadence-engine --libDebug-mode thread stack safety (heap-boxed MixerEngine, Engine, Shared, Box<ModularVoice> pool, and delay pools), CheckedAllocator zero-RT-allocation enforcement, and engine DSP invariants
5cargo test --workspaceFull unit, integration, Modular Rack, modeless UX, audio recording, devices, .rbs import, pure MemoryHostIo, and headless Metal/Vulkan GPU test suite
6cargo test --release --test audio_invariantsRelease-mode determinism, offline-vs-live parity, pan/headroom laws, portability, and full signal hygiene across all 5 showcase tracks + the Fivefold Live take
7Visual 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, stateless det_hash determinism, exact sub-step offsets across all 22 PatternKinds, and Reverse(Reverse(x)) == x involution.
  • Unified Eurorack Modular Rack (crates/core/src/rack/): Project v1 and InstrumentPreset v1 schema validation, all 11 orthogonal modules (Vco/Sampler/Noise/Env/Lfo/Filter/Vca/Drive/LoFi/Resonator/Out), singular mandatory Out protection, MAX_RESONATORS_PER_ZONE = 4 validation, Kahn DAG topological compiler (CompiledZoneGraph) with z-1 1-sample feedback cycles, unified InstrumentParam / ParamAddress resolution, and atomic stale-reference/macro pruning.
  • Pure DSP (crates/core/src/dsp/): Sample-rate invariance (44.1 / 48 / 96 / 192 kHz) across Eq, Svf/AcidLadder/TptOnePoleLpf, NoiseGen & PinkFilter, Halfband2x oversampling (step_vco_bank_fm_2x & 2× Drive), ModularEnv (Adsr/HoldDecay + pre-delay + multi-burst), decay_coeff_60db_ms SPOT, LoFiProcessor, ModalResonator (String/Bar/Membrane/Plate), SamplerVoice, Compressor, Limiter lookahead PDC, Chorus, Delay (PingPong/Stereo & 32-step ceiling), Reverb prime-coprime RT60, dual pan laws, and +6 dB power-taper roundtrips.
  • Persistence & codecs: Atomic writes, store::read_bounded limits, bounded read_dir scans, .take.jsonl crash recovery (TAKE_VERSION = 1), PresetCatalog graceful degradation, RIFF inst/smpl metadata roundtrips, and clean-room ReBirth .rbs import housed in crates/formats behind feature = "rbs" (tests/rbs_import.rs).

Real-Time Audio Engine (crates/engine)

  • Zero-RT-allocation proof: crates/engine/src/mix_engine/tests.rs installs a #[global_allocator] CheckedAllocator asserting 0 heap allocations during MixerEngine::process, update_control_block, adopt, ModularVoice execution, and Engine::next_frame.
  • Routing, PDC, live input & metering: Heap-boxed Box<ModularVoice> graph evaluation, nested Group → Group causal summing, ancestor-aware mute/solo, chained Limiter PDC alignment, 32-bit float hot vs. Master clipped semantics, 256-slot sub-step frame scheduling, lock-free AudioTapHandle streaming, 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) and SampleLibrary::from_prefixed_roots with zero reliance on host $HOME configs or private ./samples/. crates/app enforces zero direct std::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, and navigation_confirms_and_hints.rs verify end-to-end parity across the 4-tier modeless grammar, 3-tab Eurorack Rack (Panel | Patchbay | Zones), unified Audio | MIDI Devices 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, 13 NAMED_SCALES), Mini Editor, ValueInput, Fuzzy Action Palette (: / Ctrl+Shift+p), and explicit Take arming (tr/v/X).
  • Host protocols & CLI: tests/ctl_bridge.rs exercises the live Unix --ctl socket (0o600, SUN_LEN fallback, 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, and tests/robustness.rs cover --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 HeadlessGpu suites (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 root tests/docs_screenshots_gpu.rs [all 17 1440×860 flagship screenshots backed by live 48 kHz cadence-engine telemetry across all 3 GPU themes]) render full FrameViews, asserting hermetic 2-face embedded JetBrains Mono Regular (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 12 ModuleVisualView visualizers, shared cable_graph.rs Patchbay & Signal Graph rendering, 6 aligned deck layouts, balanced push_clip/pop_clip, zero hardcoded RGBA outside crates/gui/src/theme.rs, and non-empty visual geometry.

Release Audio Invariants (tests/audio_invariants.rs)

  1. no_example_project_or_take_contains_absolute_sample_paths & absolute_sample_paths_are_rejected_and_save_stays_portable — guarantees 100% repo-relative portability.
  2. same_host_render_is_sample_deterministic — repeated renders are bit-for-bit identical.
  3. offline_compile_and_live_ring_window_have_exact_parity — offline song compilation and sliding live-ring compilation match exactly.
  4. 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, 0 full-scale clipped samples, 0 hot (> 0 dBFS) or clipped channels/groups/returns/Master across every bus, and clean tail decay (< -30 dBFS on explicit tails).
  5. 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.

ShowcaseLength / Tempo / KeyTrue PeakIntegrated RMSTail Peak (last 0.5 s)Clips / Hot BusesKey Capabilities Verified
Afterglow 3.064 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 dBFS0 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 Circuit48 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 dBFS0 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 Cathedral32 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 dBFS0 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 Garden10 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.