Each CC binding gains an "Invert" toggle in the mapping sheet (shown once the
control is bound). Inverting swaps the sweep — CC 0 drives the control to its
max, 127 to its min — so a single expression pedal can crossfade two controls:
map both to the same CC and invert one.
The MIDICCBinding.inverted field and applyCC already honored inversion; this
adds isCCInverted / setCCInverted plus the sheet toggle, and the binding label
now notes "· inverted".
Test: an inverted binding reverses the mapped output. 321 green; both app
targets build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Maps the rig's "All" button (selectAllBoards — cancel any solo, bring every
board back up) to a Program Change. One-shot (no latch); rig-level, so no
board hint. Appears in the Switches section under Rig Bypass.
Test: PC fires selectAllBoards, clearing an active solo. 320 green; both app
targets build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The MIDI Mapping sheet's two sections both keyed their ForEach rows on the
enumeration offset (0,1,2…) and the Expression section mixed a bare header
Text with a ForEach. SwiftUI's List reused structurally identical row views
across the sections, so Program-Change switch rows (e.g. "Board 1 · Solo",
"Board 1 · Overdrive · Bypass") leaked into the Expression (CC) section and
their Learn button armed a Program Change instead of a Control Change.
- Rebuild both sections from precomputed row models with globally-unique,
section-namespaced string ids and a single ForEach each; no bare headers.
- CC target is now an enum: `.pedalControl` (a knob/slider) or `.boardLevel`
(the board fader). Board master level is now CC-assignable, shown as
"<Board> · Level".
- CC rows are labelled "<Pedal> · <Control>" (e.g. "Overdrive · Drive").
- Stale-binding + steal-on-reassign now key off an address matcher on the
target enum.
Tests updated for the enum target; added a board-level CC test. 319 green;
both app targets build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Review fixes:
- Remove stale phase-plan references from MIDIController / MIDIMappingSheet
doc-comments (describe current behavior instead).
- insertPedal: a board with no linear pedals but a trailing routing region
now inserts at the head (before the region) instead of appending after it.
- Drop the unused MIDIController.retarget (the app recreates the controller
against a fresh engine rather than re-pointing it).
- CC steal now matches controller AND channel, so per-channel CC bindings
can coexist.
Feature (requested): CC mapping now covers every continuous pedal control,
not just rotary knobs. New PedalControl descriptor + Pedal.ccMappableControls
(knobs followed by effect sliders); the Expression sheet lists them grouped
per pedal with a header, so slider params (e.g. EQ bands) are assignable and
labelled clearly. Knob-first ordering keeps existing CC bindings stable.
Tests: +2 (CC drives a slider control; insert into a region-only board lands
before the region). 318 total green; both app targets build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Headline: MIDI control for a Behringer FCB1010 (four phases).
- MIDIController (Lyrebird MIDI client): connection indicator via source
polling, background-queue->main-actor hop, MIDI Learn.
- Volume and Wah pedals (Wah reuses the SVF bandpass sweep, driven by
pedal position instead of an envelope follower).
- CC -> any pedal knob (0-127 mapped across the knob range).
- Program Change -> pedal/board/rig toggles: software latch for booleans,
exclusive radio for board solo. Positional addressing with display-name
hints; stale/out-of-range bindings are skipped, not fired.
- Per-rig MIDIMap embedded in ShoeGazeState as an optional field (old rigs
decode to nil; no preset version bump). Central MIDI Mapping sheet with
Learn/Clear per control.
Also included (same working branch):
- Full board bypass and rig bypass (dry passthrough via cascaded
crossfades in BoardOutputMaster), with UI toggles.
- Horizontal pedal picker grouped by category in filter order.
- Drag a palette pedal onto a chain card to insert before it
(ShoeGaze.insertPedal); tap still appends.
- iOS: guard macOS-only .menuStyle(.borderlessButton) to silence the
_UIReparentingView warning; iCloud-unavailable alert; keep the device
awake while audio runs.
Tests: 24 added (Volume/Wah, MIDIMap Codable incl. legacy decode,
CC and PC controller behavior, insert/bypass API). Full suite green;
macOS and iOS app targets build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Introduce a single shareable document type for rigs and boards:
- ShoeGazeDocument: versioned JSON envelope wrapping either a RigArchive
(one or many rigs) or a BoardVersion, with a tolerant decoder that also
reads the legacy bare-RigArchive and bare-ShoeGazeState shapes.
- Register the .shoegaze UTType (net.realizedsound.shoegaze, conforms to
public.json) in all four demo app Info.plists.
- Migrate library export/import onto the envelope: exportDocumentData() and
a decoder-tolerant importArchive(); RigFileDocument and the Builder
exporter/importer now use .shoegaze. Internal per-rig and board-version
files stay app-private JSON.
- Add OS share-sheet entries via SwiftUI ShareLink: Share per rig in the
library sidebar, Share per version in the board editor, backed by the
Transferable wrappers RigShareItem / BoardShareItem.
Tests: ShoeGazeDocument round-trip and legacy decode, library .shoegaze
export/import round-trip, and a board-document-imports-no-rigs case.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The granulators read grains from behind the write head, so each grain
replayed the last grainSize of audio — an audible delay. Rework
StereoGranulator to the straight-through approach (matching Lyrebird's
InputGrain at position 0): grains apply their Hann window and random pan to
the LIVE input sample with no look-back buffer, so there is zero added
latency. Output is normalised by overlap so density doesn't change level.
Drops the circular buffer entirely.
GranulatorPedal / AutoGranulatorPedal are unchanged (same generator API).
Generator tests (seeded determinism, zero-spread centering, full-spread
L/R separation) still hold. Suite 271.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- StereoGranulator generator: records mono input into a circular buffer and
replays overlapping Hann-windowed grains, each randomly panned by `spread`
(0 = centred, 1 = full field). Voice pool + control-rate grain size /
overlap / spread, all pre-allocated; inlined xorshift64 for grain pans.
- GranulatorPedal (.widener): Grain / Overlap / Spread.
- AutoGranulatorPedal (.widener): grain size tracks input level via
AmplitudeFollower → LinLin, with a Response switch (Loud→Short / Loud→Long)
selected by a CrossFade. Min/Max Grain / Overlap / Spread.
- Pedal picker (PedalPaletteView): cards colour-coded by a new PedalCategory
(Gain/Dynamics/EQ&Filter/Modulation/Pitch/Delay/Reverb/Texture) plus a
"filter by type" menu defaulting to All.
Tests: generator (seeded determinism + stereo-spread L/R separation) and
both pedals (build/non-silent, param/response changes, knobs, registry,
preset round-trip). Suite 271.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
High shimmer built a DC offset: the octave-up of DC is DC and the damping
one-pole passes DC, so the loop DC gain (~decay + shimmer) exceeds 1 above
~shimmer 0.25 at high decay and accumulates a clamped offset. Add a one-pole
DC blocker (~7 Hz, sub-bass only) on the feedback path so the loop has no DC
gain; the shimmer wash is unaffected.
Adds a regression test (zero-mean input, max shimmer/decay, small tank →
no DC offset vs the no-shimmer baseline). Suite 257.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sanitise control-rate reads (finite check + clamp) before they reach
seconds→frames Int conversions or feedback math, so a NaN/inf/huge size,
delay, downsample, bits, decay, shimmer, damp, or feedback can never trap
the Int() conversion nor poison a feedback loop:
- ShimmerReverb: clamp() helper; bound size to maxSizeSeconds before Int.
- ReverseDelay: finite-clamp delay (to maxDelaySeconds) and feedback.
- SampleRateDecimate: clamp downsample to [1, maximumFactor] before Int.
- BitReduce: finite-guard bits before Int(bits.rounded()).
Adds a ShimmerReverb regression test (NaN controls → finite output).
Keeps `import Foundation` in ShimmerReverb (cos for the init-time Hann
table) with a clarifying comment. Suite 256.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add init-level /// - Parameters: block to ShimmerReverb (dual-location docs).
- Add a pinned-value generator test: with decay/shimmer/damp = 0 the tank is
a unity-DC allpass chain, so two DC levels scale exactly linearly (ratio 2.0,
output-gain independent).
Suite 256.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New RT-safe ShimmerReverb generator: a damped feedback tank with a
two-grain, 50%-overlap, Hann-windowed octave-up reader INSIDE the feedback
path, so the pitched tail recirculates into an ascending wash (true
regenerative shimmer, not a one-shot parallel pitch-into-reverb). Two
series Schroeder allpasses diffuse the input; a per-sample safety clamp +
denormal flush bound the loop. Buffers pre-allocated for maxDelay + grain;
Hann table precomputed at init; size/decay/shimmer/damp read at control
rate.
ShimmerReverbPedal wraps it (Size/Decay/Shimmer/Damp), registered with
enclosure color + palette slot. Tests: generator silent-in→silent-out,
decay-changes-tail; pedal build/non-silent, shimmer-changes-output, knobs,
preset round-trip, registry. Suite 254.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two new RT-safe generators (ShoeGaze): SampleRateDecimate (sample-and-hold
decimator, control-rate downsample factor) and BitReduce (quantise to
2^bits levels via integer shift, control-rate bit depth). BitcrusherPedal
chains decimate → bit-reduce → tone low-pass (Crush/Bits/Tone).
Registered with enclosure color + palette slot. Tests: build/non-silent,
crush-changes-output, bits-change-output, knobs, registry. Suite 242.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New RT-safe ReverseDelay generator (ShoeGaze): double-buffered segmented
recorder that plays each segment back reversed, ping-ponging record/play
buffers at each boundary with a linear edge-fade to de-click the wrap and
optional feedback for layered reverse trails. Buffers pre-allocated for
maxDelay; delay/feedback read at control rate; segment length changes only
at a boundary.
ReverseDelayPedal wraps it (Time/Feedback), registered with enclosure
color + palette slot. Tests: build/non-silent, feedback-changes-output,
knobs, preset round-trip, registry. Suite 237.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Stereo rotary-speaker emulation: per-channel Doppler-swept delay (FM) plus
correlated amplitude throb (AM) from one rotor LFO, left/right rotors in
anti-phase for a rotating stereo image. Two-speed Chorale/Tremolo switch
with an Accel knob that ramps the rotor rate via a Lag for authentic
spin-up/spin-down. Depth scales both AM and FM. Runs as a .widener.
Registered (PedalType + registry + enclosure color + palette slot) with
build/non-silent, speed-change, control-surface, preset round-trip, and
registry tests. Suite 232.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Harmonizer: two granular PitchShift voices at fixed musical intervals
(ratio 2^(semitones/12) via Exp), mixed under the dry signal with V1/V2/
Direct level knobs. Two interval "knob pickers" snap through octave,
fifth, fourth, and minor/major third and sixth above and below.
New reusable control:
- PedalSelectorKnob (model) + PedalSelectorKnobView (rotary knob that snaps
to labelled stops; drag up/down to step, shows the stop caption).
- Pedal.effectSelectors hook; PedalView renders a selector row.
- PedalState.selectorValues for preset round-trip (forward-compatible).
Registered + PedalType.harmonizer + enclosure color + palette slot.
Tests: build/non-silent, interval-change-changes-output, selector preset
round-trip, registry. Full suite 213 passing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the remaining synchronous main-thread I/O off the main actor:
- RigLibraryStore now constructs instantly with a local placeholder and
exposes an awaitable async start(): it resolves the iCloud-or-local
location off-main (the blocking ubiquity lookup), loads entries off-main
via the shared ioQueue (so a reload can't drop a just-saved rig), then
sets isLoaded. reload() is async; iCloud metadata updates re-read via it.
- Seeding moves into RigLibraryBootstrap.start(_:seedFrom:), which seeds a
"Default" rig only AFTER the (possibly iCloud) library has loaded and is
still empty — preventing a duplicate "Default" on every synced device on
first launch.
- Sidebar shows a Loading state until isLoaded; the builder restores the
persisted current-rig highlight when isLoaded flips true (initialRigID
param dropped).
- Shells construct the store synchronously and start it asynchronously
(macOS via Task in didFinishLaunching; iOS via .task). Codec + file
helpers are nonisolated static so background work needs no actor hop.
- Tests await store.start().
Full suite: 206 passing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Save/delete/eraseAll now update the in-memory entries on the main actor
immediately and run the file write/delete — including NSFileCoordinator —
on a serial background queue, removing the UI stall the synchronous
coordinated write caused (especially on the iCloud path).
- Encoding stays synchronous so encode errors still surface to the caller;
only the disk write is deferred (logs on failure).
- File-system helpers and coordinated I/O are now nonisolated static so the
background queue can call them without touching actor state.
- Add flushPendingWrites() to drain the queue; called by tests asserting
on-disk state and by both app shells at termination / background.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the single hand-saved rig file with a managed library of named
rigs persisted in app storage and synced across devices and both builder
apps via a shared iCloud container (iCloud.net.realizedsound.ShoeGazeData),
falling back to local storage when iCloud is unavailable.
Core (LyrebirdShoeGaze/Presets):
- RigEntry: named, timestamped ShoeGazeState (a whole multi-board rig).
- RigArchive: portable multi-rig JSON bundle for backup/transfer; legacy
single-rig files import as a one-rig archive.
- RigLibraryStore (@MainActor @Observable): one JSON file per rig, with
NSFileCoordinator writes and NSMetadataQuery live remote-change watching.
- RigLibraryLocation: iCloud-or-local directory resolver (skips the slow
ubiquity lookup when no iCloud account is signed in).
- ShoeGaze.loadRig(from: ShoeGazeState) + captureEntry; shared filename
sanitizer factored out of BoardVersionStore.
UI (LyrebirdShoeGazeUI):
- RigLibrarySidebarView: persistent left listing with new/save/save-as/
duplicate/rename/delete/erase-all and archive import/export.
- RigNamePrompt; RigLibraryBootstrap one-call shell setup.
- ShoeGazeBuilderView: sidebar wired in; selecting a rig replaces the
session; File menu / sidebar do whole-library archive import/export.
Shells/entitlements: both builder targets own+start the store and carry
the iCloud Documents entitlement; NSUbiquitousContainers exposes the rigs
in the Files app. (macOS pbxproj also carries a pre-existing 1.0->1.1.1
version bump.)
Tests: RigEntry/RigArchive round-trip + RigLibraryStore CRUD/import/export
(15 new; full suite 206 passing).
Provisioning (manual, not done here): enable the iCloud container on both
App IDs and select it in Signing & Capabilities for both targets.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drag/drop only supported add: (palette→anywhere) and same-lane reorders, so
dragging a pedal from the main chain (or another lane) into a Stereo Unzip /
Split / Parallel lane highlighted the lane but the drop was a no-op.
- New core ShoeGaze.movePedal(from:at:to:in:) moves a pedal across lanes,
preserving its PedalState (params), with destination-index correction when the
removal deletes a top-level segment before the target region.
- BoardFlowView routes movemain:/movebranch: payloads dropped on a lane (or the
main chain, or another lane's card) through it via moveAcross(_:toLane:).
Tests: move a main pedal into an unzip lane (params preserved); move a pedal
that sits before the region (index-adjust path).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A .widener pedal that splits the dry signal into overlapping RBJ band-pass bands
and pans each by frequency (low to left, high to right); the spread knob fans the
spectrum from mono (spread 0) to a wide diffuse image (spread 1), using linear
pan expressed purely as node arithmetic.
Registered, with PedalType.diffuser, enclosure color, palette order, summary,
and tests (non-silent stereo; L == R at spread 0; L != R at full spread).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Persistence (macOS + iOS):
- RigStore autosaves the rig (rigData JSON) to Application Support and restores
it on launch. App models restore-or-seed at init; macOS saves on terminate +
resignActive, iOS saves on scenePhase leaving .active. The builder also
autosaves after structural edits (add board/pedal, load, clear).
Clear (both platforms):
- A Clear button in the builder opens a confirmation dialog: Save & Clear /
Clear Without Saving / Cancel. Clear removes all boards and seeds one fresh
empty board, then autosaves. Save & Clear triggers the save mechanism and only
clears once the save completes (cancelling the save leaves the rig intact).
- The rig-save exporter is now cross-platform (was iOS-only) so Save and the
Save & Clear flow work on macOS too; macOS keeps its File-menu Load.
Tests: RigStore save/restore round-trip across instances; restore is a no-op
with no autosave. 186 tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pedals (each registered, with PedalType static, enclosure color, palette order,
summary, and tests):
- Chorus: true-stereo widener (two anti-phase modulated delay lines), distinct
from the mono-summed Modulation chorus.
- Sustainer: one-knob compressor (sustain drives threshold/ratio/makeup via
LinLin) + tone low-pass.
- Ring Modulator: dry × tunable sine carrier.
Pedal-info UI:
- Pedal.summary (open var, overridden by all 21 pedals; mandatory going forward).
- PedalRegistry.summary(for:) for the picker.
- PedalPaletteView rows show the summary as a subtitle.
- PedalView gains an ⓘ button → PedalInfoView sheet showing the description and
the effect controls (knobs/sliders/switches) with ranges/options — excludes
the common Mix/Level/bypass.
Tests: per-pedal build/param-change/knob-list; every built-in pedal has a
non-empty summary; info excludes common controls. 183 tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename the user-facing 'Mu-Tron' pedal to the non-proprietary 'Mutant':
displayName, registry key, PedalType.mutant, enclosure color, palette order,
and the class (MuTronPedal -> MutantPedal) + test file. The underlying Lyrebird
MuTronIII generator (and its Mode/Sweep types) keep their names — that's the
dependency's DSP type, not user-facing.
Note: displayName doubles as the rig-save key, so rigs saved with 'Mu-Tron'
won't match on load (acceptable pre-1.0; nothing released).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
appendPedal(type: String, to:) is replaced by appendPedal(_ kind: PedalType, to:),
where PedalType is an extensible RawRepresentable struct with static members for
the built-in pedals:
try shoeGaze.appendPedal(.overdrive, to: board)
Discoverable/autocompleting call sites, still open for custom pedals
(PedalType("My Pedal")). rawValue == the pedal's displayName, so PedalRegistry
and the rig JSON format are unchanged — saved rigs load exactly as before.
Named PedalType (not PedalKind) to avoid colliding with Lyrebird's score-notation
PedalKind enum, which is visible when both modules are imported. The UI palette
wraps its registry-key strings as PedalType(key); demos/tests use the static
members. PedalRegistry.makePedal(type:) stays string-keyed as the serialization
boundary used by loadRig.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each board previously got its own TestLoopSource, so multiple boards ran
independently-phased arpeggios and any rebuild restarted them out of sync —
audible polyrhythms. Now a single global TestLoopSource writes a shared test
bus, and each board gets a lightweight TestLoopTap (added .after the source)
copying that bus into its head bus. The shared source survives board
add/remove, so the test signal stays phase-locked and never restarts.
- ShoeGaze: globalTestSource + globalTestBus (lazy via ensureGlobalTestSource),
per-board testLoopTaps; teardown removes taps + source and releases the bus.
- New TestLoopTap (generic bus copy, like HardwareInputPassThrough).
- ShoeGazeError.testBusUnavailable for an exhausted bus pool.
- Test: testLoop boards share the source via taps; removal leaves others intact.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A pre-compression input gain knob (Input, dB, range [-12, +24], default 0)
boosts/cuts the signal before it hits the compressor, so driving the input
harder pushes more of the signal past the threshold. The dB value is converted
to a linear multiplier via Exp(dB * ln(10)/20) and applied to the dry signal.
Tests: knob list is [Input, Threshold, Ratio]; input gain changes the output.
The preset recall test now finds the Threshold knob by label, not position.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- moveBoard/removeBoard now keep activeBoardIndex pointing at the soloed board
(track by identity on move; shift down or clear on remove), so the Solo
highlight no longer lights the wrong cell after reorder or delete.
- rebuildWithLiveInput snapshots the rig before any teardown and aborts if the
snapshot fails, instead of tearing down then seeding a fallback (no silent
rig loss). The engine-already-has-input early return now also persists the
live-input selection, via a shared selectLiveInputAndPersist helper.
- Test: activeBoardIndex tracks reorder and removal.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Live input on iOS needs an input channel, but constructing the engine with one
up-front makes iOS prompt for the microphone at the first Start even in
test-loop mode. Instead the engine starts input-less (no prompt) and is rebuilt
on demand:
- ShoeGazeBuilderView gains an optional onEnableLiveInput hook. When the user
picks live input but the engine has no input channel, the picker offers a
"Live Input" option that calls the hook; the input binding routes there too.
On macOS (engine already has an input channel) the hook is nil and live input
is selected directly.
- The iOS app model implements the hook: request mic access, then on grant
snapshot the rig (rigData), stop + teardown the engine, rebuild it with one
input channel, restore the rig (loadRig), and select live input. The new
ShoeGaze is published so the @Observable host view re-binds.
- Input persistence restores live on relaunch: a saved live choice with the mic
already authorised triggers the same rebuild silently (no prompt).
Test: a rig captured on a 0-input engine restores onto a freshly built 1-input
engine and live input is then selectable.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Multi-board playback was all-or-one: selectBoard soloed exclusively,
selectAllBoards summed. There was no way to play an arbitrary subset, and
the builder only exposed a dropdown that picked which board to *edit*.
ShoeGaze API:
- setBoard(_:audible:crossfadeSeconds:) toggles one board's select-gain in
place without disturbing the others (Blend mixing); clears activeBoardIndex.
- soloBoard(_:crossfadeSeconds:) — the "Solo" verb (wraps selectBoard).
- isBoardAudible(_:) reports a board's live select-gain target.
UI — BoardBarView (shared macOS/iOS):
- Horizontal board-mixer strip. Each board is a channel cell: audible LED,
Solo button, and a master-gain fader. Tapping a cell name sets the edit
target (independent of what's audible); context menu silences/deletes.
- Solo | Blend mode switch + an All button + a crossfade slider.
- Replaces the builder's board dropdown and Add Board button; the cell's +
adds a board.
Tests: solo/blend/all audibility transitions and activeBoardIndex tracking;
setBoard no-op for a board owned by another manager.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Three new pedals:
- LimiterPedal: linear boost gain stage into a LookAheadLimiter brick-wall
ceiling. Reads engine sampleRate injected by PedalBoard.add at build time.
- NoiseGatePedal: AmplitudeFollower -> hysteretic Schmidt gate -> LinLin floor
map -> Lag smoothing. Tuneable residual floor when the gate is closed.
- GraphicEQPedal: five cascaded RBJ filters (low/high shelf + three peaking
mids) with per-band dB gains and a linear master output gain.
New UI control:
- PedalSlider descriptor and Pedal.effectSliders hook, alongside effectKnobs
and effectSwitches.
- VerticalParameterSlider: a vertical fader bound to a UIParamNode.
- PedalView renders the fader bank and widens the enclosure to fit it.
Persistence/registry:
- PedalState.sliderValues (decodeIfPresent for backward compatibility); capture
and apply in Pedal+Preset.
- Registry entries and palette ordering for all three pedals.
Tests: non-silent builds, limiter ceiling enforcement, gate open/closed/unity
floor power ratios, EQ flat output, global-gain scaling, and 6-slider preset
round-trip.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A stereo-output pedal (Ping-Pong, Octave Splitter) now shows a
"Stereo flow / Split L/R" toggle on its card:
- Stereo flow (default): unchanged broadcast behavior — following pedals
process both channels as one stereo flow.
- Split L/R: inserts a Stereo Unzip region right after the pedal, routing
the L channel into one lane and R into the other for independent
processing, then recombining to stereo with the same route/solo/bypass
control as the stereo split.
Engine/core:
- StereoUnzipSplitter: 2-in -> 3-out node (L->lane L, R->lane R, and a
centered 0.5*L+0.5*R dry tap for the bypass route).
- PedalBoard.unzipStereo() mirrors splitStereo() but reads both tails and
requires width 2; reuses collectStereo / StereoSplitSection /
StereoRouteCollector. New stereoUnzipSections (cleared on teardown).
- BoardSegment/.stereoUnzip + StereoUnzipState round-trip via preset
capture/rebuild/applyState.
- ShoeGaze.insertStereoUnzip(afterSegment:)/isStereoUnzip(afterSegment:)
drive the toggle; invalid insert (mono tail) throws
cannotUnzipMonoChain and the atomic rebuild keeps the board intact.
- StereoSplitSection.splitter relaxed to `any Synthesizer` (stored only)
so it can hold either splitter type.
UI: per-pedal toggle + STEREO UNZIP region rendering in BoardFlowView.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Core support for interactively building and editing a board, all via the
existing capture-BoardState -> mutate -> rebuildBoard path (no RT-graph
surgery):
- PedalLane addresses the main chain or a stereo/parallel branch.
- appendPedal/removePedal/movePedal gain a `lane:` parameter (default
.main, so existing call sites are unchanged).
- appendStereoSplit/appendParallelSplit/appendMergeToMono/removeSegment
insert and remove branch regions; split/merge guarded by tail width.
- setInputSource preserves the rig across an input-source change.
- rebuildAllBoards / loadRig(from:Data) / rigData added; loadRig is now
atomic (teardown-on-failure) so a failed load leaves an empty rig.
- Expose PedalBoard.orderedSegments and BoardSegment publicly so a UI can
walk live board structure; index aligns with captureState().segments.
- InputSource: Equatable. New errors: unknownPedalType,
pedalIndexOutOfRange, cannotSplitStereoChain, cannotMergeMonoChain,
notABranchRegion.
Tests cover append/remove/move on main and branch lanes, region
add/remove, width guards, move-to-end before trailing regions, input
switch, and knob/bypass/branch value persistence through save/load.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Monophonic octave-down pedal with OCT1/OCT2/Direct knobs and a Mode
switch between two algorithms:
- Flip-flop (default): a hysteresis comparator clocks a T flip-flop
divider chain (new SubOctaveDivider generator) to produce square
sub-octaves one and two octaves down, amplitude-followed off the dry
signal. Time-domain — tracks low bass with no detection floor.
- Tracking: FreqTracker drives square oscillators at half and quarter
the detected frequency. Cleaner, but limited by the tracker's ~90 Hz
floor; flip-flop is the bass mode.
SubOctaveDivider classifies its input as generator-or-scalar at init to
keep _computeSamples allocation-free, uses a shared file-scope zero
block, bounds-checks the input read, and traps on divisor < 2.
Tests: BassOctaverPedal integration (both modes non-silent, modes
differ, sub-octaves change output, knobs/switch/preset/registry) and
SubOctaveDivider deterministic frequency-division (divisor 2 -> /2,
divisor 4 -> /4, /4 one octave below /2). 127 tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add Octave Splitter and Ping-Pong to PedalRegistry so rigs containing
them reconstruct on loadRig — board.add replays the mono→stereo width
transition automatically. Document that split-section topology (parallel
and stereo) remains outside the captured linear chain, as before.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Introduces a discrete multi-position switch control alongside the rotary
knobs, and uses it to expose the Mu-Tron's sweep direction and filter mode.
- PedalSwitch: UI-agnostic descriptor (label, node, ordered options of
caption + value), parallel to PedalKnob. Two options make a two-state
switch, three a three-state switch.
- PedalSwitchView: segmented SwiftUI control bound to a UIParamNode. Lit
segment is the option nearest the node's value; tapping writes that
option's value. Serves both two- and three-state switches.
- Pedal gains an effectSwitches hook; PedalView renders a switch row
between the knob grid and the footswitch.
- MuTronPedal: sweep direction is now a two-state switch (Down/Up) and
filter mode a three-state switch (LP/BP/HP). The effect builds six
MuTronIII instances (three modes x two directions) selected by a nested
Select so every filter state stays warmed for click-free switching.
- Presets: PedalState gains a backward-compatible switchValues array
(decodes to empty for older presets); captureState/applyState persist
and restore switch positions.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two envelope filters and two delays, registered in PedalRegistry and
showcased on demo Board 3.
- Mu-Tron: wraps the MuTronIII generator; three parallel LP/BP/HP
instances switched live by a Select on the mode knob so filter state
stays warmed across mode changes. Knobs: Mode, Sensitivity, Resonance.
- Auto-Wah: explicit amplitude-tracking chain — AmplitudeFollower scaled
by sensitivity, clamped, mapped through LinExp to a swept SVF bandpass.
Knobs: Sensitivity, Resonance, Range.
- Feedback Delay: DelayLineFeedback (cubic) into an RBJ lowpass for a
darker, tape-style multi-repeat echo. Knobs: Time, Feedback, Tone.
- Multi-Tap Delay: three non-feedback DelayLine taps summed, per-tap
volume folded into each tap's mul. Six knobs in two rows of three.
Bumps the Lyrebird dependency to 1.2.0 for the MuTronIII/SVF generators.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>