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

Arrangement Space: Nodes, Sheets & Context

This specification defines Cadence’s arrangement-space material model: addressable nodes, lanes that own their instrument, sections whose sheets override the song beneath them, unified parameter addressing, and musical context resolved by conductor time or by voice. See Material & Timing for schema bounds, meter mapping, transaction invariants, and executable score compilation.

Related specifications: Material & Timing · Decks & Interaction · DSP & Audio Engine · Protocols & Persistence · Design Decisions


1. Principles

Cadence is a score you can play: music kept as linked material, edited at an explicit scope, and performed by overriding the arrangement and deciding afterwards what to keep.

Four principles govern the model:

  1. Identity is universal and names are optional. Every musical node is addressable by stable Id from the moment it exists. A name is an optional label for finding material again, not a prerequisite for referencing it.
  2. Things point at things. No glue object exists solely to join two others. A lane owns its instrument, a placement points at a node, and a transform points at its main and side inputs.
  3. One rule decides what plays and one decides its context. What plays is decided by sheets stacked over the arrangement. Context is inherited either by conductor time or by voice.
  4. Whatever can be set can be driven, and every operation is available on every surface. Sound parameters, score parameters, and project macros share one ParamAddress space. Keys, the Action Palette, and typed JSON actions over the control socket expose the same operations.

2. The Model at a Glance

Picture the arrangement as a plane with sheets stacked above it and one shared material graph below it.

An interactive version of this figure can be turned, scrubbed, and traced.

  • The plane is what you hear. Time runs across it and voices run down it.
  • Above the plane are sheets that decide what plays: the song’s placements at the base, section items and instance overrides over spans of it, and live overrides on top.
  • Below the plane is one shared DAG of musical nodes: sources, variations, and transforms chained on them.

Four Nouns

NounWhat it is
NodeAnything musical: a source (notes, rhythm, a value curve), a variation, or a transform of other nodes. A node is a pure function from time to musical output with no timeline position of its own.
LaneA voice line: owns its instrument (instrument: Id), voice context slots, launchable node slots, and song-sheet placements.
SectionA named length of time with items, conductor context, and pinned parameter values, defined once and placed on the song as one or more disjoint SectionInstances.
PlacementA span of time on a lane pointing at a Notes node, with phase clock, conductor context mode, voice overrides, and optional step exceptions. It is where the graph surfaces on the plane.

Two Rules

  1. Content is decided by sheet. On one lane, the highest sheet that covers a step wins (Live overrides beat section instances; later section instances beat earlier ones across pickup/tail overlaps, with each instance’s Instance overrides over its Section items; everything sits over the Song sheet). Where higher sheets say nothing, lower sheets show through.
  2. Context is decided two ways. Key, harmony, tempo, feel, and time signature come from the conductor, by time. Transpose, dynamics, and optional local feel overrides come from the voice (the lane and its placement).

3. Nodes

3.1 Identity, Names & Pointer Lifecycle

  • Every Node carries a stable Id (u64) from creation and an optional name: Option<String>. Sharing or unsharing a node is purely a change in incoming pointers.
  • Any consumer may point at any type-compatible node, including a node inside another lane’s chain. Views display each node’s live incoming pointer count (Project::pointer_counts).
  • Pointers are counted across placements (on Song, Section, and Instance sheets), lane launch slots (Lane.launch), other nodes (Apply::{main, side} and Variation::base), conductor harmony (Song, Section, and Instance), global modulations (Modulation.node), rhythmic filter envelopes (FilterPatch.env_node_id), and cycle launch boundaries (Boundary::Cycle { node }).
  • Lifecycle and visibility follow pointer count and name:
    • 0 pointers: Unnamed nodes with zero incoming pointers are garbage-collected automatically to a fixed point at transaction commit (Project::gc_unnamed_nodes). Named nodes with zero pointers stay in the Bank marked unused until deleted or reused.
    • 1 pointer, unnamed (Project::is_inline_node): Renders inline inside its single consumer (the placement’s chain or parent transform) and stays out of the Bank and top-level Composition Graph columns while remaining directly addressable by Id.
    • 2 or more pointers, or named: Appears as a first-class card in the Bank and Composition Graph with its live pointer count. A node cannot be deleted while anything points at it.

Nodes live in one flat table (Project.nodes: Vec<Node>), so every node update is a flat upsert by Id.

3.2 Output Types

Every node has a statically checked NodeType and positive natural period (u64):

  • NodeType::Notes
  • NodeType::Rhythm
  • NodeType::Values(ValueUnit::Degrees)
  • NodeType::Values(ValueUnit::Normalized)

3.3 Sources & Transforms (NodeBody, TransformOp)

Sources are Notes, Rhythm, Values, SeededValues, and Euclidean.

A transform (NodeBody::Apply) takes one main: Id input and zero or more side: Vec<Id> inputs. Following main (and Variation::base) from a placement down to its root source defines its chain (Project::chain).

TransformOpMain inputSide inputsParameters
FollowNotesValues(Degrees)—
MaskNotesRhythm | Notes—
TransposeNotes—semitones (-96..=96)
VelocityNotes—scale (0.0..=2.0)
ShapeNotesValues(Normalized) (vel), opt. Values(Normalized) (gate)—
ControlNotesValues(Normalized)target (control name)
NotesFromValuesValues(Degrees)Rhythm | Notesdegree_offset, velocity, gate
TimeScaleany—num, den (1..=16)
SwingNotes—amount (0.0..=0.45)
RatchetNotes—count (1..=8)
Shiftany—steps (-64..=64)
Reverseany——
ChanceNotes | Rhythm—probability (0.0..=1.0), seed
Everyany1 same-type alternativeinterval (2..=64)
ArpNotes—mode (Up/Down/UpDown/Random), rate (1..=4)
RangeFoldNotes—low_midi, high_midi (span >= 11, 0..=127)
Concatany0..=15 same-type inputs (max 16 total)—
StackNotes | Rhythm0..=15 same-type inputs (max 16 total)—
  • Velocity multiplies note and chord-tone velocity by a constant inside the chain, so shared chains share the scaling.
  • Control attaches a named per-note control lock from its normalized side curve sampled at the note’s exact time + offset. At compile time, resolve_control_for_rack (crates/core/src/params.rs) resolves target deterministically against the lane instrument’s RackPatch in strict 4-tier precedence order:
    1. Matching curated panel_pins label on the Rack (case-insensitive, automatable only).
    2. Rack-level parameter name (gain, pan, tune, cutoff, resonance) or explicit unpinned cable ID (cN / cableN, flagging Ambiguous if multiple zones share that cable ID).
    3. Unique matching automatable ModuleParam across all zones and modules (Ambiguous if more than one matches).
    4. Explicit qualified path: ModuleName.param, ZoneName.cN / zN.cN, ZoneName.param / zN.param, rack.param / bus.param, or zN.ModuleName.param (automatable only; ambiguous matches report Ambiguous). A compiled chain holds at most MAX_LINKS = 16 unique resolved targets (with downstream controls overriding duplicate resolved targets). Project::check_control_warnings() surfaces structured ControlWarning diagnostics (ControlWarningKind::{Unresolved, Ambiguous, DuplicateTarget, ExceedsMaxLinks}) in the UI and --check; unresolved or ambiguous names are otherwise ignored safely at compile time.

Bypass (TransformOp::can_bypass). A transform may set bypassed: true whenever bypassing preserves its output type and static period. That covers every transform except NotesFromValues, TimeScale, Every, Concat, and Stack. Bypassed Follow and Swing stages do not opt out of inherited harmony or feel.

3.4 Variations & Placement Exceptions

A node may vary another (NodeBody::Variation { base, changes }) by storing only the steps where it differs, using the same StepChange payload as Placement.exceptions:

#![allow(unused)]
fn main() {
struct StepChange { step: u32, events: Vec<NoteEvent> } // empty `events` means an explicit rest
}
  • In NodeBody::Variation, step indexes within the base node’s natural period (0..base_period) and replaces everything the base plays on that step on every pass (supporting per-event pass conditions). Untouched steps continue to evaluate base, so edits to the base reach every untouched step.
  • In Placement.exceptions, step indexes within the placement’s own span (0..length_steps), applying only to that one occurrence (and requiring unconditional StepCondition::ALWAYS events).
  • Vary creates a NodeBody::Variation { base, changes: Vec::new() } following its base. Detach (Action::DetachNode) materializes an independent copy (flattening a literal variation to Notes, cloning a literal via Edit::ForkNode, or freezing a derived node via Edit::FreezeNode) that no longer follows the base.
  • When editing notes on a placement whose node is shared or varied, the interface requires an explicit edit scope: definition (edit the underlying node), variation (record a StepChange on a Variation), or local exception (record a StepChange on Placement.exceptions).

3.5 Note Events

Pitch is either a scale degree or a fixed MIDI note:

#![allow(unused)]
fn main() {
enum Pitch { Degree { degree: i16, accidental: i8 }, Midi(u8) }
}

A Degree pitch is relative to the active key and follows key, harmony, transposition, and range folding. A Midi(u8) pitch is an absolute note (such as a drum kit pad) that ignores key, harmony, transpose, and range folding everywhere it is placed.

A step slot can hold multiple sparse events (NoteEvent):

FieldRange / DefaultMeaning
step0..length_stepsInteger 16th-note slot index inside Notes.
offset[0.0, 1.0), default 0.0Fractional sub-step position inside the 16th. One slot may hold multiple events at different offsets.
pitchPitchScale degree (-127..=128, accidental -6..=6) or fixed MIDI (0..=127).
velocity0.0..=1.0, default 0.8Normalized hit velocity.
gate0.05..=64.0, default 0.75Gate duration in 16th-note steps.
condition1 <= turn <= every <= 16, default 1:1Pass condition (StepCondition { turn, every }).
probability0.0..=1.0, default 1.0Deterministic hit chance via det_hash(0, node_id, time, idx).
retrigger1..=8, default 1Evenly spaced sub-span repeats inside the event’s slot interval.
chord0..=5 ChordTonesExtra stacked voices (up to 6 simultaneous notes per event), each with its own pitch, velocity, and gate.

Sub-step subdivisions, pass alternations, probability, retriggers, accents, and chords are authored directly on NoteEvent inside NodeBody::Notes (via step/sub-step editing, live MIDI recording, or typed JSON actions) with no separate notation node type.

3.6 Schema (crates/core/src/material/types.rs, music.rs)

#![allow(unused)]
fn main() {
struct Node { id: Id, name: Option<String>, body: NodeBody }

enum NodeBody {
    Notes { length_steps: u32, events: Vec<NoteEvent> },
    Rhythm { steps: Vec<bool> },
    Values { unit: ValueUnit, period: u32, mode: ValueMode, points: Vec<ValuePoint> },
    SeededValues { unit: ValueUnit, period: u32, seed: u64, min: f32, max: f32 },
    Euclidean { pulses: u16, steps: u16, rotation: i16 },
    Apply { op: TransformOp, bypassed: bool, main: Id, side: Vec<Id> },
    Variation { base: Id, changes: Vec<StepChange> },
}

struct NoteEvent {
    step: u32, offset: f32, pitch: Pitch, velocity: f32, gate: f32,
    condition: StepCondition, probability: f32, retrigger: u8, chord: Vec<ChordTone>,
}
}

4. Lanes & Instruments

#![allow(unused)]
fn main() {
struct Lane {
    id: Id,
    name: String,
    instrument: Id,
    voice: VoiceSlots,
    launch: Vec<Launchable>,
    placements: Vec<Placement>,
}

struct Launchable { node: Id, phase: PhaseMode, offset_steps: i32 }
}
  • A lane owns its instrument (lane.instrument). Placements never name an instrument.
  • Several lanes may share one instrument. The instrument receives every event from every lane naming it, ordered by step, sub-step offset, and lane order, and applies its own Rack voice rules (key/velocity zones, polyphony/mono, and choke groups).
  • A lane is one non-overlapping line per sheet. Within the song sheet (lane.placements), within any one Section.items, and within any one SectionInstance.overrides, items on the same lane do not overlap. Layering is a second lane targeting the same instrument.
  • Deterministic tie-breaking. Events arriving at the same step and sub-step offset reach an instrument in Project.lanes order; a monophonic zone plays the last of them.
  • Sidechain ducks are triggered by lanes (Duck.source_lane).

Compiled ScoreEvents carry lane_id: Option<Id>, and EventOrigin provenance records (song_step, lane, placement, node, instrument, pattern_time, local_exception).


5. Sections & Sheets

5.1 Schema (crates/core/src/material/types.rs)

#![allow(unused)]
fn main() {
struct Section {
    id: Id,
    name: String,
    length_steps: u32,
    conductor: ConductorSlots,
    values: Vec<(ParamAddress, f32)>,
    items: Vec<Item>,
}

struct SectionInstance {
    id: Id,
    section: Id,
    start_step: u32,
    conductor: ConductorSlots,
    values: Vec<(ParamAddress, f32)>,
    overrides: Vec<Item>,
}

enum Item {
    Play { lane: Id, placement: Placement },
    Silence { id: Id, lane: Id, start_step: i32, length_steps: u32 },
}

struct Placement {
    id: Id,
    node: Id,
    start_step: i32,               // >= 0 on Song (`Lane.placements`); signed in sections/instances
    length_steps: u32,
    phase: PhaseMode,              // Song | Section | Restart (Song placements reject Section)
    offset_steps: i32,
    context: ContextMode,          // Follow | Own | Instance(Id)
    voice: VoiceSlots,             // transpose, dynamics, optional local feel
    exceptions: Vec<StepChange>,   // keyed by placement-relative step (0..length_steps)
}
}
  • Song placements live on Lane.placements (start_step >= 0). Section items and instance overrides live in Section.items and SectionInstance.overrides using Item::{Play, Silence}. PhaseMode (Song | Section | Restart) is shared by placements and launch slots.
  • A section is defined once and placed as disjoint SectionInstances. Nominal spans [start_step, start_step + length_steps) never overlap and fit within Project::arrangement_steps(). Sections and instances carry strictly Conductor context and pinned section values across all lanes; sections do not nest.
  • Pickups and tails extend past nominal section boundaries. An item inside a section or instance may carry a negative start_step (pickup) or run past section.length_steps (tail). Spans outside [0, arrangement_steps) clip cleanly at sheet resolution time.
  • Instance overrides localize changes. SectionInstance.{conductor, values, overrides} override the section for that single instance (such as modulating a final chorus up a step, pinning a parameter value, or replacing/silencing a lane). When creating an instance override from a section item with start_step < 0, the override spans the item’s full relative range so the pickup does not leak through from the Section sheet underneath.
  • Item::Silence is content. It occludes lower sheets on its lane so a section or instance override can close a lane running underneath (including when keeping a muted lane over a section).

5.2 Sheet Stack

From lowest to highest:

SheetHolds
SongEach lane’s own placements (Lane.placements)
SectionEach section instance’s Section.items, offset by instance.start_step
InstanceEach section instance’s SectionInstance.overrides, offset by instance.start_step
LiveActive live overrides (PerformanceState.active) (§7)

5.3 Sheet Resolution (Project::sheets in crates/core/src/material/sheets.rs)

For any lane at a song step:

  1. If the Live sheet has an active override on that lane, the live override plays.
  2. Beneath Live, Project::sheets() resolves authored sheets in strict descending precedence:
    • Section instances ordered by descending instance.start_step, with each instance’s Instance overrides layered ahead of its Section items.
    • The Song sheet (Lane.placements) at the bottom.
  3. Within one instance, Instance overrides beat Section items. Across adjacent instances, a later instance’s item (such as an incoming section’s negative pickup) always beats an earlier instance’s overhanging tail or override.
  4. Both Item::Play and Item::Silence occlude lower layers; any lane a section or instance does not mention lets lower sheets show straight through. All visible stretches clip to [0, arrangement_steps).

5.4 Pattern Time (PhaseMode)

PhaseModeClock
Songsong_step + offset_steps. Material keeps its place against the song clock.
Section(song_step - instance.start_step) + offset_steps (valid on section/instance items and live launch slots; Song placements reject Section). Periodic nodes wrap via Euclidean modulo so negative pickups align cleanly into beat 1 of the section.
Restart(song_step - item_abs_start) + offset_steps (or transport_step - anchor + offset_steps on live launches). Counts from the block’s own start.

A jump or loop to a section begins at instance.start_step. A negative pickup sounds only when playback arrives through the steps preceding that origin.


6. Context

6.1 Conductor & Voice Slots

Context splits into Conductor (shared across the band: Song → Section → Instance) and Voice (owned by one lane or placement: Lane → Placement):

#![allow(unused)]
fn main() {
struct ConductorSlots {
    key: Option<Key>,
    harmony: Option<Id>,
    tempo: Option<f64>,
    feel: Option<f32>,
    time_signature: Option<TimeSignature>,
}

struct VoiceSlots {
    transpose: Option<i16>,
    dynamics: Option<f32>,
    feel: Option<f32>,
}
}

Song-level conductor defaults live directly on Project (root_midi, scale, harmony, bpm, feel, time_signature).

SlotKindSet onCombination ruleWhere it applies
key (Key { root_midi, scale })ConductorSong, section, instanceNearest winsDegree-to-MIDI resolution and pitch-dependent transforms
harmony (Values(Degrees) node)ConductorSong, section, instanceNearest winsAdded where degree notes enter a chain
tempo (f64, 20..=300 BPM)ConductorSong, section, instanceNearest wins (by song time only)Step clock, ScoreWindow.step_bpm, and tempo-synced DSP
time_signature (TimeSignature)ConductorSong, section, instanceNearest wins (by song time only)BarMap bar/beat boundaries, compound /8 grouping, launch quantization
feel (f32, 0.0..=0.45)Conductor (+ Voice override)Song, section, instance; optionally overridden on lane or placementNearest wins (placement → lane → conductor)After the chain, delaying odd 16ths on the song grid
transpose (i16, -96..=96)VoiceLane, placementAdds (lane + placement)After the chain (degree pitches only)
dynamics (f32, 0.0..=2.0)VoiceLane, placementMultiplies (lane × placement)After the chain (clamped 0.0..=1.0)

6.2 Resolution Rules

  • Conductor resolution (Song → Section → Instance): key, harmony, and feel resolve from the placement’s ConductorAnchor (Project::conductor_owner). tempo and time_signature resolve strictly by song time (Project::tempo_at, Project::time_signature_at), because one clock and bar map govern the entire ensemble.
  • Harmony application: Shifts degree-pitched notes where they enter a chain (Notes, Variation step changes, NotesFromValues, and Placement.exceptions) so downstream transforms (RangeFold, Arp) see harmonised notes. Song harmony reads at song_step. Section/instance harmony reads at (song_step as i64 - instance.start_step as i64).max(0) — negative pickup offsets clamp cleanly to step 0 (reading bar 1’s chord without wrapping or underflowing).
  • Key application: Read when degrees resolve to MIDI and by chromatic transforms (Transpose, RangeFold, Arp).
  • Voice application: transpose adds and dynamics multiplies after the node chain. feel resolves placement.voice.feel → lane.voice.feel (including dynamic overrides) → conductor feel and delays odd 16th steps on the song grid, carrying offset + feel >= 1.0 cleanly onto the following step (Project::sounding_events).
  • Absolute notes (Pitch::Midi): Ignore key, harmony, transpose, and range folding.
  • Explicit beats inherited (Project::inheritance): A chain containing a non-bypassed TransformOp::Follow opts out of inherited harmony; a chain containing a non-bypassed TransformOp::Swing opts out of inherited feel (both conductor and voice). transpose and dynamics always combine with chain transforms.

6.3 Context Modes & ConductorAnchor

#![allow(unused)]
fn main() {
enum ContextMode { Follow, Own, Instance(Id) }
enum ConductorAnchor { Song, Instance(InstanceAt) }
}

Project::conductor_owner(song_step, context, owner) maps ContextMode to a ConductorAnchor governing key, harmony, and feel:

  • Follow (default on the Song sheet): Resolves the conductor at each event’s own song_step. A placement spanning a verse into a chorus shifts key, harmony, and feel at the section boundary.
  • Own (default inside Section.items and SectionInstance.overrides): Anchors to the section instance owning the item across its entire span — including negative pickups (with harmony clamped to step 0) and overhanging tails.
  • Instance(Id): Anchors a placement (typically on the Song sheet) to a specific SectionInstance. If that instance or its section is removed (Edit::RemoveInstance / Edit::RemoveSection), reset_instance_context_refs resets referencing placements to ContextMode::Follow.

Tempo and time signature are never anchored per placement, because two clocks cannot run simultaneously.

Two ways to write a pickup:

ApproachWhere it livesWhen the section is placed again
Section item with negative start_step (ContextMode::Own)Inside Section.itemsMoves and repeats with every instance
Song placement anchored via ContextMode::Instance(id)Inside Lane.placementsStays where written on the song

7. The Live Sheet

  • Launch places a Launchable on the live sheet (Override { lane, entry, anchor }) for one lane; Release removes it. Both land on a quantized Boundary (Now, Beat, Bar, Bars, or Cycle { node }), honoring BarMap meters and late_tolerance_steps.
  • Staging (StagedChange) queues multiple launches, releases, lane mutes/solos, and section jumps to land atomically on one boundary.
  • Live context: A launched item reads Conductor context by song time (ContextMode::Follow) and Voice context from its own lane (lane.instrument, lane.voice).
  • Keep writes what was heard back into the arrangement: splitting the kept span at section boundaries, writing pieces inside section instances as SectionInstance.overrides (or Item::Silence when keeping a muted lane over a section), and writing pieces outside sections onto Lane.placements. Because Instance overrides sit above Section items, kept material remains audible on replay.

Parameters share the same live layer:

  • Any valid ParamAddress (§8) may carry a normalized live value (Change::LiveValue, stored in PerformanceState.live_values) overriding its written or driven value immediately without waiting for a boundary.
  • Interacting with a driven control (keys, value field, or mapped MIDI knob) writes a live value; explicit :set / Edit::SetParam commands write the authored constant.
  • Release clears the live value back to its driven or written state; Keep commits the live value to the authored constant (or inserts a breakpoint at the current step if driven by a curve).
  • LiveFlags (mute and solo) persist alongside the project document but remain outside undo history and the authored song revision.

8. One Address Space (ParamAddress)

8.1 All 12 ParamAddress Variants (crates/core/src/params.rs)

VariantClassReaches
Rack { instrument, param: RackParam }SoundRack bus (Gain, Pan, Tune, Cutoff, Resonance)
Zone { instrument, zone, param: ZoneParam }Sound / StructuralZone gain, pan, glide, pitch tracking, phase reset, root MIDI (VoiceMode, Legato are Structural)
Module { instrument, zone, module, param: ModuleParam }Sound / StructuralAny of the 62 Eurorack module parameters (LoopMode, LoopXfade, OneShot are Structural)
Cable { instrument, zone, cable }SoundBipolar patch cable attenuverter amount
Channel { channel, param: ChannelParam }SoundChannel/Master Gain or Pan
Send { channel, target }SoundAudio/Group send amount to a Return bus
Effect { device, param: EffectParam }SoundAny insert effect parameter across all 8 EffectKinds
Node { node, param: NodeParam }ScoreAll 12 automatable transform params (Transpose, Velocity, SwingAmount, RatchetCount, ShiftSteps, ChanceProb, ArpRate, RangeLow, RangeHigh, DegreeOffset, NotesVel, NotesGate)
Lane { lane, slot: VoiceSlotParam }ScoreLane voice slots (Transpose, Dynamics, Feel)
Song { slot: ConductorSlotParam }ScoreSong conductor Tempo and Feel
Section { section, slot: ConductorSlotParam }ScoreSection conductor Tempo and Feel
Macro { index }Sound or ScoreProject Macro M1..M8 (0..8); Project::address_class classifies as Score if any binding targets a Score address, Sound otherwise

A direct Modulation targeting ParamAddress::Channel { channel, param: ChannelParam::Gain } compiles to multiplicative MixerParamTarget::ChannelGainScale, scaling the fader trim and ducks independently (gain * scale * duck) rather than overwriting the fader.

8.2 Address Classes (AddressClass)

ClassExamplesDriven over timeEffect of a change
SoundAutomatable Rack/Zone/Module/Cable, Channel, Send, Effect, sound-only MacrosYesHeard immediately via the sound-only update path
ScoreNodeParam, VoiceSlotParam, ConductorSlotParam, score-bound MacrosYesAlters evaluated events or tempo map; recompiles and lands on the edit boundary
StructuralZoneParam::{VoiceMode, Legato}, ModuleParam::{LoopMode, LoopXfade, OneShot}, and structural node fields (TimeScale ratio, Every interval, Euclidean steps, Concat/Stack inputs)NoAlters voice topology, node period, or node type; edit-only

Keeping structural node parameters static guarantees every node’s (NodeType, period) signature is statically determined.

8.3 Unified Resolution Precedence

Any automatable ParamAddress can be supplied by a written constant, a macro binding, a covering section/instance pinned value, a direct Modulation curve on the song clock, MIDI learn, or a live value.

Project::resolve_param_at (crates/core/src/material/eval.rs), ScoreBuilder::write_sound_automation, and crates/app/src/view/live_params.rs enforce one exact precedence order:

  1. Live value (PerformanceState.live_values)
  2. Direct modulation (Project::driver(address), normalized Values node on the song clock)
  3. Section value (SectionInstance.values over Section.values, resolved by covering song step)
  4. Macro fan-out (MacroBinding.evaluate in ascending macro index order; highest macro index wins on collision)
  5. Written constant (Project::read_param_native)

Because every time-varying parameter is a pure function of (song_step, live_values), evaluation remains stateless and renders are bit-identical.


9. Operations

Every authoring and performance move reduces to this core vocabulary, exposed uniformly across keyboard bindings, the Action Palette, and typed JSON actions:

OperationWhat it does
PlacePut a pointer to a Notes node on a lane for a span (Song, Section, or Instance sheet)
Launch, release, stageManage live-sheet overrides and stage multi-lane gestures for one boundary
KeepCommit the live sheet and live values into the authored arrangement
Group, ungroupTurn a span of song placements into a reusable Section, or dissolve one
SilencePlace Item::Silence on a section or instance sheet to cover lower sheets on that lane
Wrap, unwrapInsert or remove a TransformOp stage in a placement’s chain
Bypass, reorderToggle Apply.bypassed without removing a stage, or move stages within a chain
SetWrite a parameter or context slot via ParamAddress
PointRedirect what a placement, transform input, harmony slot, modulation, or filter envelope points at
NameAssign or clear a node’s optional name
Vary, detachCreate a Variation following a base node, or materialize an independent copy
FreezeEvaluate a node range into literal Notes, Rhythm, or Values
ExtractPull a literal Rhythm or Values(Degrees) contour out of a Notes node
Own, follow, anchorChoose a placement’s ContextMode (Own, Follow, or Instance(id))

10. Compilation & Engine Contract

  • Stateless memoized evaluation: Evaluation is pure recursion over the node DAG. Per-query EvalMemo (crates/core/src/material/eval.rs) memoizes node_values, notes, and rhythm_offsets on (node_id, time, ctx.song_step) (plus static signatures on node_id), preventing exponential work on diamond DAGs while keeping driven score parameters exact and renders bit-identical.
  • Single-point sheet & context compilation: Project::compile_with_live and Project::compile_live_steps_with_audition both resolve content via Project::sheets() (§5.3) and events/context via Project::sounding_events() (§6.2).
  • Multi-lane instrument delivery: An instrument receives events from every lane naming it, ordered by (step_slot, offset, inst_idx, lane_order).
  • Sound-only vs score dispatch: Project::address_class routes Sound changes through the fast sound-only patch path (Project::sound_patch_compatible + Project::patch_score_sound) without re-evaluating nodes, while Score changes (including score-bound macros and dynamic tempo changes) recompile the score window and land on the edit boundary.
  • Take journal parity: Live values (TakeChange::LiveValue), launches, releases, flags, timeline remaps, and edits record in the take journal (crates/core/src/take.rs), folding through the same PerformanceState::apply transition during live playback and offline replay.
  • Per-step tempo map: ScoreWindow.step_bpm carries effective per-step BPM aligned 1:1 with step_ranges (empty when uniform bpm). Engine (bpm_for_step) updates active_bpm and atomic active_bpm_bits at every step boundary, driving StepScheduler, offline render::step_range_seconds, and tempo-synced DSP (Delay, Lfo, RhythmicFilter).
  • Workspace bounds: MAX_NODES = 4096, MAX_LANES = 32, MAX_INSTRUMENTS = 16, MAX_PLACEMENTS = 4096, MAX_SECTIONS = 256, MAX_SECTION_INSTANCES = 1024. The audio engine depends only on MAX_INSTRUMENTS, never on lane count.
  • Schema version: Project::VERSION = 2 with #[serde(deny_unknown_fields)] and zero legacy converters.

11. Workspace Surfaces

The arrangement-space model surfaces across the workspace’s core decks:

  • Lane deck (LANE): Shows the lane’s instrument, voice context slots, and CHAIN rows (source first through each transform stage). Transforms are wrapped, bypassed, reordered (J/K in Edit mode), unwrapped, and nudged inline alongside a live evaluated preview.
  • Pattern deck (PATTERN): Shows literal steps/sub-steps, source chips, and transform headers with focused parameter nudging and explicit edit-scope indicators (definition, variation, or local placement exception).
  • Bank deck (BANK): Lists named and shared (>= 2 pointers) nodes with live pointer counts, marking 0-pointer named nodes as unused while keeping unnamed single-consumer nodes inline inside their consumer. Also provides the paged section strip (1..0) and lane launchpad.
  • Arrange deck (ARRANGE): Draws section sheets (§) and instance overrides (‡) over the song sheet, folds lanes sharing an instrument into a single row when folded, displays mixed-meter BarMap bars, and pages section banks cleanly.
  • Placement deck (PLACEMENT): Displays a live evaluated preview alongside timing, phase, voice slots, exceptions, and ContextMode (Own, Follow, or anchored Instance).
  • Graph deck (GRAPH): Provides both the Signal Graph (audio routing) and Composition Graph (v): SOURCES, STAGE transform columns, LANES (counting song, section, and instance items), and INSTRUMENTS, collapsing unnamed single-consumer nodes inline while distinguishing Main, Side, Control, Placed, and Sound edges and lighting sounding nodes live.

12. Worked Examples

12.1 Sixteen Bars

A song in D minor at 124 BPM (4/4) with swing 18%. The Verse covers bars 1 to 8 and sets no overrides. The Chorus covers bars 9 to 16 and sets F major, 128 BPM, its own harmony, and a straight feel (0%). The Arp lane carries voice dynamics 80%, and the Kick lane carries a local voice feel override of 18%.

LaneSongVerseChorusLive
Kick (local feel: swing 18%)Beat, bars 1 to 16—Kick fill, bars 13 to 16—
Lead—Motif, bars 3 to 8Motif with an answer every fourth pass, from half a bar before bar 9Motif up an octave, bars 11 to 13
Arp (dynamics: 80%)Arp over the chord cell, bars 5 to 12———

What plays, and in what context:

Lane & barPlaysWhyKey / HarmonyFeel / Voice
Kick, bar 10BeatChorus says nothing for Kick before bar 13, so Song shows throughnone: absolute MIDI notesswing 18% (lane voice override beats Chorus conductor)
Kick, bar 14Kick fillSection sheet over Song sheetnone: absolute MIDI notesswing 18% (lane voice override applies to all items on Kick)
Lead, bar 12Motif up an octaveLive sheet over Section sheetF major, Chorus harmony (Conductor, by time)straight (Conductor, by time)
Lead, half bar before bar 9Chorus lead’s pickupChorus has the later instance.start_step on the Section sheetF major, Chorus bar-1 chord (Own, negative harmony clamped to step 0)straight (Own, from the Chorus)
Same pickup, set to FollowChorus lead’s pickupSame sheet precedenceD minor, song harmony (Conductor, by time)swing 18% (Conductor, by time)
Arp, bar 7ArpOnly Song covers ArpD minor (Conductor, by time)swing 18% (Conductor), dynamics 80% (Voice)
Arp, bar 10ArpSame Song placementF major (Conductor, by time)straight (Conductor, by time), dynamics 80% (Voice)

Arp shifts to F major and straight feel at bar 9 because both come from the Conductor by time while retaining its lane dynamics (80%), whereas Kick keeps its swung pocket through the straight Chorus because its lane sets a local Voice feel override.

12.2 A Loop

Eight bars: a kit, bass, pad, and lead sharing one harmony.

Song   8 bars · 4/4 · D harmonic minor · 124 BPM · harmony: Harmony · feel: swing 18%

Kick   [909 kit]      kick notes
Hats   [909 kit]      hat notes |> time scale ×3 |> chance 30%
Clap   [909 kit]      clap notes
Bass   [Sub bass]     bass notes
Pad    [Warm pad]     chord notes
Lead   [Pulse lead]   Motif |> every 4: reverse        can also launch: Motif |> transpose +12

Named: Harmony, Motif
  • Three lanes share the kit instrument.
  • Bass, pad, and lead follow the song harmony by context.
  • Swing is set once on the song.
  • Only Harmony and Motif need names, because only those two nodes are shared; every single-consumer chain stage stays inline.

12.3 A Song with Form

A 64-bar arrangement built from six distinct sections placed across eight instances, with two instances carrying local overrides:

InstanceSectionWhat the instance changes
Bars 17 to 24Buildnone
Bars 41 to 48BuildPinned value: Arp rate 2, accent off
Bars 25 to 32Dropnone
Bars 49 to 56Drop (Climax)Lead adds an octave layer on alternate passes; pinned Arp rate 2; Ride, Bell, and Perc enter

What runs where:

On the song, running through sections
  Chords  [Supersaw]   Chord cell |> velocity 54%                     silent in the last bar of each Build
  Arp     [Glass Arp]  Chord cell |> arp |> shape(accent) |> transpose +12

In sections
  Lead    [Anthem Lead]  Hook                                         Drop
                         Hook |> mask(Tease mask) |> velocity 60%     Tease, Build, Outro
  Chords                 Stab voicing |> mask(Stab rhythm)            Drop, covering the pad
  Bass    [Sub Drive]    Sub pulse |> range fold                      Intro, Build, Breakdown, Outro
                         Bass groove |> range fold |> shape(bounce)   Tease, Drop
  Kick    [Club Kick]    Kick 4x4                                     Tease, Drop, Outro
                         a four-bar build phrase                      second half of Build
  Hats, Open hat, Rim  [EDM Kit]   one lane each                      Tease, first half of Build, Drop; hats in Outro
  Clap    [EDM Kit]                                                   second half of Tease, Outro
  Snare   [EDM Kit]      backbeat, tom turnaround every 4th pass      Drop
                         a four-bar roll                              second half of Build
  Crash   [EDM Kit]                                                   Drop, first bar of Breakdown, Outro
  Ride    [EDM Kit]                                                   Climax instance override only
  Bell, Perc, FX Sweep   one lane each
  • The pad and arp live on the Song sheet so sections do not restate them; Build silences Chords on its last bar via Item::Silence.
  • The kit is seven lanes sharing one Rack instrument, folding cleanly into one row in Arrange.
  • The bass is degree 1 on a rhythm node, following the active harmony automatically by context.
  • “Arp rate 2” in the second Build is a pinned SectionInstance.values entry targeting ParamAddress::Node { node, param: NodeParam::ArpRate }.