158 Commits

Author SHA1 Message Date
josh 4cae1e6fd0 fix(tunedverb): silence the wash until a moment is captured
An uncaptured TunedVerb has no filter template, so it must output silence —
but the live cross-map was pouring the dry pass-through straight into the
reverb, so every TunedVerb hummed on startup (and looked like a stale
capture surviving a restart). Gate the reverb input by the Capture latch:
`masked * $captured` feeds the reverb zero until the footswitch fires.

Because `captured` is 0 by default, reset to 0 on every graph rebuild
(resetForRebuild) and on engine stop (engineDidStop -> releaseHold), the
same gate also guarantees a fresh app launch or engine restart comes up
silent with no carried-over capture. The analysis side-chain keeps tracking
while gated, so pressing Capture still freezes the current-moment spectrum.

FreezVerb is unaffected: its Freeze holds a working reverb's tail, so it
should produce sound before freezing.

Tests: new wetIsSilentUntilCaptureThenAudible; panShiftsTheLeftLeg and
captureLocksTheFilter... updated to the new contract (capture before
measuring the wash). 856 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-26 14:02:47 -08:00
josh 52c676605f feat(postboard): shared post-board chain after the board mix
Add a dedicated linear stereo post-board chain that processes the summed
board mix once, after the board split, before the hardware output — for
global reverb, a bus limiter, a final EQ, and the like.

Routing: when a post-chain exists, every BoardOutputMaster writes a shared
stereo mix bus (parameterized output bus indices) instead of hardware; the
post-chain (PostChain + PostChainOutput) reads that mix, runs its pedals in
order, and copies the tail to the hardware outputs. Always stereo-headed
(dual-mono for a mono rig) so mono pedals auto-stereoize per channel.

The chain's head node is inserted at .tail(of: mainGroup), so it evaluates
after every board master regardless of board add order — no re-order on
board add, and no board dropped from the mix. buildPostChain tracks the
chain before wiring it so a mid-build throw stays reclaimable by teardown.

State: additive ShoeGazeState.postChain (nil-when-empty, decodeIfPresent,
byte-identical old-rig round-trip). Edit API (append/insert/remove/move)
mirrors the pre-board chain: capture-from-live, stop/teardown/rebuild. Undo
treats a post-topology change as a full rebuild via id-sequence compare.
UI: a hide-when-empty post-board strip below the boards, symmetric to the
pre-board strip, with palette routing and per-pedal remove through undo.

Bumps the iOS demo's Lyrebird pin to 2.3.0 (onEditingEnded).

Tests: PostBoardChainTests (render, closed-volume silences output,
post-chain-after-every-master ordering, board-add ordering, insert/move/
remove, save/load round-trip with knob, old-rig decode) + post-pedal undo.
855 tests pass. Reviewed (RT-safety + line sweep); the ordering bug both
reviewers caught is fixed at the root and covered by a deterministic test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-26 00:22:39 -08:00
josh 10a6e122bf feat(midi): MIDI-mappable primary transport footswitch (Capture / Freeze)
Expose a pedal's primary transport footswitch — TunedVerb's Capture, FreezVerb's
Freeze — as a MIDI-mappable action, so a footswitch (Program Change) can trigger
it. Previously only per-pedal Bypass and the looper's transport were mappable.

- New `MIDITransportPedal` protocol (@MainActor): `midiTransportName` + a
  `toggleMIDITransport()` that presses the pedal's primary footswitch. TunedVerb
  (Capture) and FreezVerb (Freeze) conform.
- `MIDIMap.PedalActionKind.pedalPrimaryTransport`, dispatched by MIDIController to
  `toggleMIDITransport()`. Learn / persist / resolve-by-id ride the existing
  pedalAction path (same as the looper actions).
- The mapping sheet lists the action for any `MIDITransportPedal`
  ("Board 2 · TunedVerb · Capture"); the per-pedal control-mapping strip shows a
  badge for it. A future press-to-trigger pedal just conforms and appears.

Tests: conformance + a Program-Change round-trip toggling Capture on/off. Full
suite 846 green; both demos build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-25 20:11:07 -08:00
josh 9dfadb129d feat(preboard): shared pre-board chain feeding every board
Add a pre-board stage: one linear pedal chain that processes the input once,
before the board split, and feeds every board — for front-of-chain gates /
drive / EQ, and multi-board "voice spray" rigs (one source → N panned boards →
Blend).

Routing: a stable mono feed bus every board taps. `FeedPassThrough` copies the
input source — or, when a pre-chain exists, that chain's mono output — onto the
feed bus (`ensureFeed`/`buildFeed`/`tearDownFeed`). The pre-chain is modeled as
an unfinalized `PedalBoard` fed from the source; a stereo tail folds to mono
(board heads are mono). Empty pre-chain = passthrough, byte-for-byte
behavior-preserving. addBoard taps the feed bus; teardown releases it
remove-before-release.

State: additive `ShoeGazeState.preChain` (`decodeIfPresent` → nil for old rigs,
no format bump; `hasSameRigContent` includes it). `captureState` reads the LIVE
pre-pedals so knob tweaks are saved; `rebuildAllBoards` sets the pre-chain
before building boards.

Edit API: appendPrePedal / insertPrePedal / removePrePedal / movePrePedal —
each folds in live knob values, then a full ordering-safe rig rebuild
(`setPreBoardChain`, mirrors setInputSource; rolls back on failure). Undo: a
pre-chain topology change (compared by id sequence, so knob-only edits stay on
the surgical path) rebuilds from the snapshot, stopping/starting the engine.
`allPedals()` now includes the pre-chain so pre-pedal knob undo resolves.

UI: an inline pre-board strip above the boards — hidden to a "+ Pre" button when
empty; otherwise the pre-pedals (keyed by stable id) with a per-pedal remove and
a "feeds all boards" divider. Palette adds route to the pre-board via a flag
(reset on any dismissal). Add / remove go through the undo wrapper.

Known scope: a pre-board edit resets transient/looper state (full rebuild, like
input-switch — setup-time); chain-router branches read the input directly and
are not fed by the pre-board. Both documented.

Tests: PreBoardChainTests (feeds boards, closed pre-Volume silences every board,
remove restores direct feed, save/load incl. a knob tweak, prior pre-pedal's
knob survives adding another, old-rig decode) + a pre-board undo test. Full
suite 844 green; both demos build. External review + caveman sweep: one blocking
(live knob sync) fixed + regression-tested, all non-blocking addressed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-25 19:18:04 -08:00
josh 1f5b70edc7 feat(undo): parameter undo for knobs, sliders, switches, selectors
Tier 2 of the rig-undo feature, on the same undo stack as the structural
(tier 1) edits. Records one undo checkpoint when the user finishes changing a
pedal control, so ⌘Z / the ↶ button step back through knob turns and switch
flips as well as add/remove/move.

- UndoEntry.parameter + PedalControlGroup (knob/advancedKnob/slider/switch/
  selector); UndoCoordinator.recordParameterEdit + .parameter handling in
  undo()/redo(). applyParameter re-resolves the LIVE node by (pedalID, group,
  controlLabel) via ShoeGaze.pedal(id:), so an undo lands on the right control
  even after an intervening structural rebuild replaced the pedal's node
  (pedal ids persist through rebuild). old == new records nothing.
- Knobs record via Lyrebird 2.3.0's ParameterKnob.onEditingEnded (one edit per
  drag): PedalView.recordingKnob (main / advanced / mix / level / looper) and
  TempoSyncKnobView.
- Self-contained views (VerticalParameterSlider, PedalSwitchView,
  PedalSelectorKnobView) record via a new \.pedalParameterEditRecorder
  environment closure PedalView installs, capturing pedal.id + the coordinator.
  Slider/selector snapshot node.value at drag start; switch records old→new on
  the committing tap.
- rebuildsOnChange switches/selectors are deliberately NOT recorded (they alter
  graph topology and would fight the structural restore's live-value merge) —
  documented as a known gap, along with tempo-sync division changes.
- Bump the Lyrebird pin to 2.3.0 (the released tag with onEditingEnded), drop
  the dev-time local path override.

Tests: 18 UndoCoordinator tests (knob/slider/switch/selector round-trips,
post-rebuild re-resolution, + a catalogue test asserting unique control labels
per group so the by-label resolution can't mis-target). Full suite 837 green;
both demo schemes build against 2.3.0. External review + caveman sweep: no
blocking findings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-25 14:23:00 -08:00
josh a8bd0242a3 feat(undo): multi-level structural undo/redo for rig edits
Add UndoCoordinator: 50-deep undo/redo of structural edits (add/insert/
remove/move pedals in any lane, stereo-split/parallel/merge/unzip routing,
add/remove/move boards, Clear Board). Each edit records a named checkpoint
via a perform(label:) wrapper threaded through the builder, board-flow,
board-bar, and boards-sheet views (injected through the SwiftUI environment,
re-injected onto the boards sheet).

Restore is surgical, not a whole-rig reload: it reconciles board-by-board
(remove added / re-add removed / rebuild changed / reorder) using the same
per-board rebuild path as an ordinary edit, so undo never tears the rig down
— recording, looper buffers, other boards' reverb/delay tails, and
bypass/solo state all survive. It also merges live parameter values by pedal
id, so undoing a topology edit never reverts a knob turned afterwards; a
pedal the edit removed returns with its snapshot values. No-op edits record
nothing (compared via hasSameRigContent). History clears on rig load / new /
switch.

UI: macOS Edit menu (Undo ⌘Z / Redo ⇧⌘Z with dynamic "Undo <action>" titles,
deferring to a text field's own editor while typing); iOS visible ↶/↷ buttons
+ ⌘Z/⇧⌘Z. Rig mute moves from ⌘Z to ⌘M. Help text updated.

Fix: every pedal edit rebuilt the board via BoardState(label:segments:)
without id:, regenerating the board UUID and breaking MIDI board bindings
after any edit. Thread id: board.id through all 10 rebuild sites; add
editingPreservesBoardIdentity regression test.

Tests: 12 UndoCoordinator tests (restore correctness, param preservation,
untouched-board identity, multi-board re-add, depth cap, no-op, throwing
action). Full suite 830 green; both demo schemes build (macOS + iPad).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-25 10:22:51 -08:00
josh 4c09825c2e rename(reverb): Freeze → FreezVerb, and FreezVerb → TunedVerb
Shuffle the two new reverbs' display names:
- the spectral snapshot/hold pedal (was "Freeze") becomes "FreezVerb"
  (FreezePedal → FreezVerbPedal); its Freeze footswitch keeps its label.
- the filter-from-the-current-moment pedal (was "FreezVerb") becomes
  "TunedVerb" (FreezVerbPedal → TunedVerbPedal).

Renames the types, registry keys, category entries, classes, files and tests,
and updates the cross-reference between them. Behaviour unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 20:55:45 -08:00
josh b1e59d2c03 rename(reverb): Freeze Reverb → Freeze
Shorten the pedal's display name to just "Freeze". Renames the type, registry
key, category entry, class (FreezeReverbPedal → FreezePedal) and its files/tests,
and updates the FreezVerb doc cross-reference. Behaviour unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 20:07:11 -08:00
josh 0873bbd82e feat(reverb): add FreezVerb — filter-from-the-current-moment into a stereo room
A spectral reverb ported from the composer's FilterFromCurrentMoment process.
Press Capture and the spectrum playing at that instant is locked in as a fixed
filter; everything you play afterwards is masked through that frozen spectral
shape and poured into a large reverb. The name plays on the FreeVerb tank at
its core.

- A side-chain SpectralChain (analyze-only) of the dry drives a SpectralCrossMap
  (maxMagnitude, mode 1.0) as a `.dual` stage on a main chain over the dry. While
  live the mask tracks the input; the Capture footswitch sets crossMap.freeze, so
  the captured moment becomes a fixed formant filter on the ongoing signal.
- The masked result feeds a GVerb room (fixed 120 m, as in the original), with a
  Time knob (T60, tempo-syncable) and a Damp knob shaping the tail.
- Mono in, stereo out (channelKind .widener): the reverb is summed to mono and
  placed across the field by a Pan knob (Pan2), replacing the original's
  ambisonic encoding. The time-stretched random-pointer source is dropped — the
  filter is captured straight off the live input by the footswitch.
- `captured` is transport state (a Capture button indicator) and is not
  serialized into presets.

Wired at all four points (+ README catalog). 818 tests pass;
lyrebird_external_review clean (no blocking findings).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 20:02:13 -08:00
josh 843ae5b5f6 feat(reverb): add Freeze Reverb — a true spectral snapshot / infinite hold
A new reverb pedal that captures the sound at the instant you press Freeze and
holds it as an endless, smoothly-sustaining pad while you keep playing over it.

- Phase-vocoder SpectralFreeze (inside a SpectralChain) locks the magnitude
  spectrum of the moment and keeps each partial rotating at its own frequency,
  so the held chord is natural and glassy rather than a looped ring or a
  metallic feedback tank.
- The frozen spectrum is wrapped in a FreeVerb tank (summed to mono) for a
  diffuse, blooming space — the "reverb" half — then gated by a Lag ramp so the
  freeze blooms in and releases out over the Rise knob.
- The dry signal always passes through undelayed; the wash is layered on top
  (Mix hidden, base mix fully wet). The SpectralChain's FFT latency sits only on
  the gated wet path, and a frozen spectrum is uncorrelated with the moved-on
  dry, so there is no comb filtering.
- Latching Freeze footswitch (LED). On release the gate fades the held pad out
  and the return-to-live analysis is deferred until the fade completes (guarded
  by a generation token), so the fade is of the snapshot, not a live delayed
  copy that would comb against the dry.
- `frozen` is transport state (an @UIParam button indicator, like the Looper's
  isPlaying) and is not serialized into presets.

Wired at all four points (+ README catalog). 808 tests pass;
lyrebird_external_review clean (no blocking findings).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 18:10:09 -08:00
josh 3e3f86b737 feat(karplus): collapse tuning UI to a Free/Pitched switch + one Root knob
Replace the four-control tuning surface (continuous Tune Hz knob + Tuning
selector + separate Note and Octave selectors) with a single Free/Pitched
switch and one chromatic Root selector that steps every semitone from E1
(MIDI 28) to E5 (MIDI 76), captioned by note name ("E1", "A3", "E5"). The
Root selector is shown only in Pitched mode; in Free mode the continuous
Tune Hz knob drives the root as before.

- Drop the `note`/`octave` @UIParams and `noteFrequency(pitchClass:octave:)`;
  add a `pitchedNote` @UIParam (MIDI note number, A3=57=220 Hz default) and
  `frequency(forMidiNote:)` / `caption(forMidiNote:)` helpers.
- Knob positions are unchanged (Tune always present), so positional presets
  stay aligned; only the trailing selector set varies by mode, with Voicing
  pinned at index 0.
- Document the switch-before-selector pass order in Pedal.applyState as
  contractual: a mode-dependent selector set (like this one) relies on it.

798 tests pass; lyrebird_external_review clean (no blocking findings).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 17:29:15 -08:00
josh 097c38283e feat(karplus): extend Free-tune range up to E5
The Free-mode Tune knob now reaches 660 Hz (E5, the top of the treble
staff), up from 400 Hz, so the resonator root can be dialled across the full
guitar range by ear. Note mode already covered this via the octave selector.

Test: Free Tune at E5 rings near 659 Hz. Full suite 795 green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 14:59:16 -08:00
josh 89a34016de feat(karplus): add Free-Hz vs Note+Octave tuning modes
The Karplus Resonator root can now be set two ways, via a Tuning selector:
- Free: the continuous Tune Hz knob (unchanged behaviour, still the default).
- Note: an equal-tempered pitch chosen with Note (C…B) and Octave (1…6)
  selectors. A4 = 440, so A3 = 220 Hz, etc.

noteFrequency() computes the root from scientific-pitch note/octave; the
string bank reads whichever root the mode selects. The per-string delay line
is widened to 0.08 s so the lowest Note-mode roots (down to a sub-C1 octave
string) fit without the KarplusStrong frequency clamp engaging.

Tests: equal-temperament mapping, Note-mode A3→220 Hz ring, octave shift,
and selector/preset round-trip. Full suite 794 green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 14:55:40 -08:00
josh d1f823e54c feat(pedals): add Karplus Resonator, Tape Looper, and DL4 delay
Three new pedals, each wired at all four points (PedalType, PedalRegistry,
PedalCategory, README) and covered by a dedicated test suite.

Karplus Resonator (texture): a bank of four tuned KarplusStrong strings
plucked by an amplitude-envelope → Schmitt-trigger gate off the note onset,
ringing sympathetically in the tail. Tune / Sustain / Tone / Sensitivity
knobs plus a Voicing selector (Drone / Octaves / Shimmer). Bank summed at
1/stringCount so a full-scale pluck stays at or below unity.

Tape Looper (texture): a simple single-track looper (RecordBuffer /
PlayBuffer) with record / overdub / play and the two classic tape tricks —
half-speed (octave down) and reverse — as live playback-rate controls.
Overdub is gated to forward-normal speed both at engage time and in the
graph, so flipping Reverse/Half-Speed mid-overdub can't misalign layers.

DL4 (delay): an umbrella multi-model delay with a Model selector dispatching
to eight per-model builders — Tube, Tape, Analog, Analog Mod, Multi-Head,
Sweep, Lo-Res, Reverse — over shared Time / Repeats / Tone / Mod controls,
Time tempo-syncable. Multi-Head tap sum gain-staged to 1.0.

Passed /lyrebird_external_review (RT-safety + caveman sweep); all blocking
findings fixed. Full suite 791 tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 14:47:51 -08:00
josh 75de04160b feat(script-phaser): one-knob four-stage phaser (orange script voicing)
Add ScriptPhaserPedal, modeled on the classic one-knob four-stage orange
phaser. A single Speed knob sweeps a fixed four-stage all-pass cascade
(Phaser.Audio with stages: 4), and a Voicing two-state switch picks
Script (smoother, lower feedback) or Block (more resonant, higher
feedback). The voicing maps to the feedback amount through a live linear
expression — no rebuild, since feedback is a live Phaser parameter — and
a short Lag glides the coefficient so a Script↔Block toggle doesn't step
audibly. Distinct from the general-purpose Phaser (six stages, with rate
and feedback knobs).

Named to avoid the trademark (per the amp convention) and the bare
"Phase <n>" the code-style rule bans. Wire into PedalType, the registry,
and the modulation category; add to the README modulation catalog.
8 tests: voicing and speed each change the output by a magnitude (RMS
difference), determinism (bit-identical, no RNG), a click-free bypass
flip at the 512-sample block, knob/switch exposure, preset round-trip,
registry presence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 12:34:16 -08:00
josh 74227400ad feat(granular-reverb): pitch-scattered grain-cloud reverb
Add GranularReverbPedal: a diffuse, blooming wash built from an
InputGrain cloud — short grains sprayed from a rolling capture at a
chosen density, each smeared in time and given a random pitch offset
(scatter) around a center pitch — then reverberated through a GVerb tank,
folded stereo→mono. Deliberately unlike Shimmer Reverb: an incoherent
random-scatter grain cloud, not a tuned coherent feedback octave tail.
At pitch 0 / scatter 0 it tracks the input's pitch; raising scatter
smears it into a broadband haze.

The cloud is power-normalized by sqrt(grain overlap = density·grain), so
turning density up thickens the texture at a roughly constant level and
the peak stays bounded below clipping even at max overlap with correlated
grains (no downstream limiter). Scatter is scaled by the center ratio so
the per-grain spread stays proportional and a down-shifted cloud never
reaches a negative (reverse) ratio.

Knobs: Decay/Damp (GVerb tail), Density, Grain (duration), Pitch
(semitones), Scatter (the defining control). Wire into PedalType, the
registry, and the reverb category; add to the README reverb catalog.
10 tests: scatter smears pitch (normalized-autocorrelation tonalness),
density normalization bounds the peak at the worst overlap corner (decay
12 s, near-full-scale input), density changes texture, tail persistence,
determinism, a click-free bypass flip at the 512-sample block, knob
labels, preset round-trip, registry presence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 11:23:30 -08:00
josh 243be726ea feat(reverse-reverb): backwards-swelling reverb pedal
Add ReverseReverbPedal: the "sucked-in" pre-verb of ambient/shoegaze
records. The dry signal runs through the existing segmented ReverseDelay
generator — notes are captured in fixed segments and played back
reversed, so a decay becomes a swell rising into the note — then feeds a
GVerb room tank, folded stereo→mono, so the backwards swell arrives
wrapped in a diffuse wash. Distinct from the plain Reverse Delay (no
reverb) and a forward Room Reverb (energy follows the note instead of
swelling up to it).

Knobs: Time (reverse segment length / swell pre-delay, tempo-syncable),
Decay/Size/Damp (GVerb tail). GVerb dry/tail/early levels kept modest for
output headroom, and early reflections trimmed since they fire forward,
against the backwards character. Latency is one segment.

Wire into PedalType, the registry, and the reverb category; add to the
README reverb catalog. 9 tests: pre-delay (energy arrives after one
segment), a rising-swell-shape assertion across the reversed segment,
reverb tail persistence, determinism, a click-free bypass flip at the
512-sample block, knob labels, preset round-trip, registry presence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 10:14:58 -08:00
josh 20b2034fed feat(poly-octave): EHX POG-style polyphonic octave pedal
Add PolyOctavePedal: a fixed-interval polyphonic octave generator. Four
PitchShift voices at exact power-of-two ratios — −2, −1, +1, +2 octaves,
each single-stage within PitchShift's [0.25, 4.0] clamp — stacked under a
dry voice, each with its own level. Because the ratios need no pitch
tracking, chords stack as cleanly as single notes.

A Tone low-pass shapes the shifted voices (dry stays clean). An Attack
knob adds the POG's volume swell via a "slow-gear" gain: the ratio of a
slow envelope follower to a fast one, clamped to [0, 1] and guarded
against divide-by-zero — unity (instant) at Attack 0, blooming in as it
rises, independent of playing level. The five voice levels sum without an
internal limiter (as with BassOctaver); the level knob and board master
set final gain.

Wire into PedalType, the registry, and the pitch category; add to the
README pitch catalog. 12 tests: per-voice pitch (±1/±2 oct + unison) by
autocorrelation, swell neutral-vs-bloom, seeded determinism, a click-free
bypass flip at the real 512-sample block, knob labels, preset round-trip,
registry presence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-24 09:53:43 -08:00
josh 3edd64e782 feat(whammy): DigiTech Whammy expression-pedal pitch shifter
Add WhammyPedal: a rocking expression pedal (position, heel 0 → toe 1)
that sweeps pitch between two endpoints set by the selected mode, in the
three families the hardware groups — Whammy (wet-only pitch bend),
Harmony (dry note + morphing bent voice), and Detune (dry + near-unison
beating voice).

Each voice is a PitchShift SOLA stage; the three-octave Dive Bomb
cascades two stages (each -18 st) to clear a single stage's ±2-octave
ratio clamp. Harmony/Detune legs are attenuated 0.5 so the summed
dry+shifted output stays within the input peak. A fixed PRNG seed per
stage makes a given setting render identically (reproducible audio and
exact-pitch tests), with a distinct stage-2 seed so the cascade's grain
dispersion decorrelates.

Wire it into PedalType, the registry, and the pitch category; add it to
the README pitch catalog. Tests cover pitch at heel/toe, the Dive Bomb
cascade, harmony dry presence, seeded determinism, preset round-trip,
mode rebuild, registry presence, and a click-free bypass flip at the
real 512-sample block (guarding the audio-rate bypass fix).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-15 12:11:16 -08:00
josh a434b14f4b fix(output,gate): unity mono output + RMS noise-gate detector
Two fixes from the guitar-input analysis:

- Mono board output no longer loses 3 dB. BoardOutputMaster panned a mono
  board to stereo centre with an equal-power Pan2 (×0.707 per channel). A
  mono rig should come out at the level it went in, so the signal is now
  written to both hardware buses directly at unity.

- Noise Gate gains a Peak/RMS detector switch (defaults to RMS). The peak
  follower (|x|) rides the waveform's peaks, so the gate's threshold decision
  tracked instantaneous peaks rather than loudness; the RMS detector
  (√ symmetric-average of x²) follows perceived level, so the gate opens and
  closes where the note actually is. Implemented as a rebuildsOnChange switch
  that builds only the chosen follower. Serialization-safe: a gate saved
  before the switch (empty switchValues) loads with the RMS default.

Tests cover the detector switch, RMS default (incl. legacy load), state
round-trip, and RMS closing earlier than Peak on a sustained tail.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-03 08:49:16 -08:00
josh 4a9bf0fb30 feat(mutant): add Range switch, Sweep, and Attack/Release controls
The envelope filter's cutoff sweep was fixed (80 Hz -> 3200 Hz, 5 ms / 150 ms),
so it read as either muted (resting too low) or extreme (40x span). The
underlying MuTronIII generator already takes freqLo/freqHi/attack/release as
live params, so expose them:

- Range switch (Lo/Hi) on the face — shifts the whole sweep window low
  (rhythm/bass) or high (harmonics/solos), matching the original Mu-Tron III.
- Sweep, Attack, Release in the advanced pop-over — Sweep sets how far input
  amplitude drives the cutoff (peak = resting x sweep); Attack/Release shape
  the envelope response.
- Tamer defaults: resting 80 -> 120 Hz, span 40x -> 20x.

Serialization-safe: new continuous params live in advancedValues and Range is
a trailing switch, so a rig saved with the old 2-switch / no-advanced layout
loads unchanged with the new controls at their defaults (test covers it).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-13 09:42:52 -07:00
josh 44e6c35550 fix(rigs): don't flag a rig dirty over input/channel differences
Switching between starter rigs prompted "save changes?" even when nothing
was edited. The unsaved-changes check compared full ShoeGazeState snapshots
(`captureState() != entry.state`), which include the live input source and
engine channel counts — and those legitimately differ from a factory rig's
saved values now that a rig switch preserves the player's current input
instead of adopting the rig's saved one.

Add ShoeGazeState.hasSameRigContent(as:) comparing only rig content (boards,
routers, MIDI map, tempo) and use it for the dirty check, so session/engine
settings no longer register as unsaved changes. Test added.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-10 16:40:35 -07:00
josh 132515b4cd fix(rigs): address starter-rig feedback (toggle, Garcia, shimmer, input)
- Center the Mine/Starters toggle in the sidebar column.
- Garcia rig: build it as two plain boards (effects + clean) selected via
  the multi-board Solo/Blend control, instead of a ChainRouter — the builder
  UI renders boards, not routers, so the router version showed empty boards.
- Dreampop Chorus Cathedral: lower shimmer decay/feedback and delay feedback
  so the octave-up regeneration no longer screeches into runaway feedback.
- Preserve the current input across rig switches: loadRig gains a
  keepingCurrentInput flag (default false → file open / launch restore still
  apply the rig's saved input; RigStore session-restore continuity intact),
  and the rig-switch path (loadEntry) passes true so a live guitar isn't
  snapped back to the test tone when changing rigs. Tests updated to cover
  both directions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 14:36:49 -07:00
josh fba32ff0aa feat(ui): group factory rigs by category in the rig sidebar
The rig-library sidebar now presents shipped starter rigs under their
FactoryRigCategory headers (Shoegaze Walls, Dreampop, Classic, Ambient,
Experimental) in fixed catalog order, with the user's own rigs under a
"My Rigs" header. Starter rows show a "Starter rig" subtitle and are not
reorderable; user rows keep drag-to-reorder and Move Up/Down (now scoped to
the user's own rigs). Grouping is presentational, so it stays correct
regardless of underlying library order.

Adds FactoryRigLibrary.category(for:) and rigs(in:) with tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 13:53:56 -07:00
josh 2c970aa344 refactor(rigs): address external-review findings
- Recall router state in applyState: the lightweight (no-rebuild) recall path
  now positionally applies router branch pedal params and the splitter/merger
  blend, instead of silently dropping them for routed rigs. Test added.
- Simplify first-run seeding: RigLibraryStore.save persists asynchronously
  (best-effort, logged not thrown), so the previous per-entry rollback could
  never fire for a real disk failure. Replaced with an honest best-effort
  save + working-rig fallback, and a comment stating the semantics.
- Move FactoryRigBuild to its own file (one public type per file).
- Document that a router's output master gain is intentionally not persisted,
  matching BoardState's treatment of board master gain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 13:32:58 -07:00
josh 7dccf596f4 feat(rigs): persist chain routers + add Garcia two-board split rig
Add ChainRouter persistence so routed multi-board rigs survive save/load —
previously captureState/loadRig only handled plain boards, so any A/B router
rig was silently lost on save (a latent gap this fixes for user rigs too).

- New ChainRouterState (Codable): each router's two linear branches as
  [PedalState] plus splitter branch levels and merger output levels.
- ShoeGazeState gains an additive `routers` field decoded with
  decodeIfPresent (nil for old rigs) — no format-version bump; routerless
  rigs stay byte-identical (nil, not []).
- captureState snapshots routers; rebuildAllBoards reconstructs each via
  makeChainRouter/addTo{A,B}/finalize and restores the blend.

FactoryRig gains a session-scoped builder variant (FactoryRigBuild enum) so
a rig can create its own boards/routers; makeEntries branches on it.

Ships the Garcia OBEL Clean/Effects Split: an effects/lead board (octave,
envelope filter, overdrive, phaser, delay, amp) vs a clean direct board,
selectable via the router — showcasing the multi-board capability.

Tests: full router capture -> JSON -> load round-trip with structure and
branch-level assertions plus a render check, backward-compat (no routers
key when routerless), and the Garcia rig via the factory load+render suite.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 13:19:42 -07:00
josh 75b99a547b feat(pedals): add Sustain Fuzz pedal + Gilmour/doom rigs
New "Sustain Fuzz": a mid-scooped, high-sustain fuzz distinct from the
single-stage Fuzz. Two cascaded soft-clip (softClipNormalized) stages
compress and stack harmonics for smooth violin-like sustain; a fixed
midrange scoop (RBJPeakingEQ cut at 750 Hz) hollows the mids; a tone
low-pass sets the top end. Sustain/Tone/Scoop knobs. Composed in effect(),
no new RT generator.

Registered in PedalType/PedalRegistry, enclosure colour, palette order.
Tests cover build+non-silent, each knob changing output, knob listing,
preset round-trip.

Adds two factory rigs: Comfortably Numb Lead and Doom Riff Wall.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 13:10:16 -07:00
josh 965633de34 feat(pedals): add Vibe pedal + Psychedelic Vibe Lead rig
New "Vibe" pedal: a photocell-style vibe built as four staggered all-pass
stages swept by one shared sine LFO (unequal centre frequencies give the
uneven, vocal throb that distinguishes a vibe from a phaser). Speed and
Intensity knobs, Chorus/Vibrato mode switch (chorus blends dry+swept,
vibrato passes swept only). Composed from RBJAllPass in effect(), mirroring
PhaserPedal — no new RT generator.

Registered in PedalType/PedalRegistry, enclosure colour, and palette order.
Tests cover build+non-silent, each control measurably changing output, the
knob/switch listing, and preset round-trip.

Adds the Psychedelic Vibe Lead factory rig (Fuzz -> Vibe -> Delay -> Plate).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 13:06:17 -07:00
josh bb418ca2e8 feat(rigs): confirm before overwriting a built-in factory rig
Saving over a currently-loaded factory rig now shows a confirmation dialog
instead of silently replacing the shipped original: Overwrite (destructive),
Save as New Rig… (new id, keeps the original), or Cancel. The pending
follow-up (e.g. the Save & Clear clear step) is threaded through all three
paths.

Adds FactoryRigLibrary.factoryIDs / isFactory(_:) so the UI can tell a
shipped rig from a user rig by id, with a test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 12:42:03 -07:00
josh 4eb1cbdd61 feat(rigs): ship built-in factory starter rigs
Add a factory rig library: 8 curated starter pedalboard rigs seeded into
an empty rig library on first launch. Rigs are compile-checked builders
(construct concrete pedals, set typed @UIParam values, board.add) rather
than hand-written JSON, so a renamed pedal control is a build error, not a
silently corrupted preset.

Seeding builds each rig in a throwaway offline (never-started) engine,
captures a RigEntry with a stable per-rig UUID (idempotent re-seed), and
saves to the store. Bootstrap rolls back this run's saves if any store.save
fails, so a partial library can't freeze future seeding (gated on isEmpty).

Rigs are named/described by sound, not trademarked products or artists; a
test guards against brand names leaking into names/blurbs. Full ship-path
test loads and renders every rig to non-silent output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 12:37:34 -07:00
josh 292261a088 refactor(ui): make widthUnits mean "base width in columns" + tidy overrides
Follow-up cleanup now that card width is content-derived. Redefine widthUnits
as the card's base width in knob columns (1 = 3-wide, 2 = 4-wide) — both the
knob-grid column count and the card's minimum width — with selector/switch rows
able to push wider. Values above 2 no longer do anything.

- Delete the now-misleading widthUnits 3/4 overrides on 11 amps; they inherit
  AmpVoicePedal's 2 (all full-surface amps → the same tight 4-wide card).
- Remove Mutant's redundant override (2 knobs + 2 switches → 3-wide either way).
- Cabinet: keep widthUnits 2 so it's 4-wide like the amps — its Cab/Mic/Mic B
  selector captions (voice names) need the room to stay readable (per request).
- Looper keeps widthUnits 3 (the one pedal still using the flat multiple for its
  bespoke timeline/knobs/transport layout).
- Refresh the widthUnits docs (base + AmpVoicePedal + Cabinet); update the amp
  tests' widthUnits assertions (3/4 → 2; Looper stays 3).

675 tests pass; no visual change to the amps, Cabinet now matches their width.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-05 09:05:40 -07:00
josh 5a3cbeb372 fix(noise-gate): smooth asymmetric close + Attack/Release knobs
Reported bug: a sustained note popped into a different tone mid-decay (~3.63s
in the user's recording). Root cause confirmed by rendering the user's rig with
their input file: the gate keyed off the raw guitar and, as a note decayed
through the threshold, snapped its gain 1.0 -> floor in ~10 ms (symmetric 10 ms
Lag). With heavy downstream gain (the rig's Fuzz, ~50x) amplifying that step,
the ~-9 dB duck read as an audible pop.

Fix: replace the symmetric Lag with an asymmetric LagUpDown — fast open (so a
note's attack isn't softened) / slow close (fades the gate shut and rides out
envelope chatter at the threshold). Verified against the user's input file: the
gate gain now fades 1.0 -> floor smoothly over ~70 ms, monotonic, no snap.

Feature (per request): expose Attack (open) and Release (close) time as knobs
in the advanced pop-over rather than a separate near-duplicate "Vari" gate.
Placed in advancedKnobs so they persist append-only in advancedValues — gates
saved before this load with the timing at defaults, no migration (verified by
test). Release default 0.08 = the smooth close; range 10 ms..500 ms.

Tests: gate close lingers longer with a longer Release and the default lingers
well past a fast close (guards the pop fix + the Release control); Attack/
Release exposed in the pop-over (not the face), round-trip through state, and a
legacy no-advancedValues preset defaults the timing. 675 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 16:41:27 -07:00
josh f9ddd6b160 feat(amp): Gain/Drive become a 1–11 dial with a musical taper
Every amp's Gain (and the boutique/drive-channel Drive) is now a 1–11 dial —
yes, it goes to eleven — instead of the raw 1–30 tube-drive number.

- New AmpVoicePedal.taperedDrive(_:) maps the 1–11 dial to the 1–30 tube drive
  through an exponential LinExp taper, so 1 is nearly clean, 11 is full
  saturation, and the useful grind spreads across the dial (fine at the bottom,
  steep at the top) rather than bunching near the low end.
- Wired into the base preampStage and every override that feeds a drive:
  Boutique / Fullerton Drive / Jazz Clean / British Dual (Drive channel),
  Anaheim (SS preamp), British Master (cascaded stage).
- gainRange / driveRange → 1...11; every amp's default gain/drive reconverted
  from drive-space to the equivalent dial value (dial = 1 + 10·ln(drive)/ln(30)),
  so each amp's shipped voicing is preserved.
- No preset migration (nothing shipped — per product owner); all knob work
  stays within ShoeGaze (no core Lyrebird change).
- Tests updated to the 1–11 scale; added range + exponential-taper assertions.

671 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 10:42:35 -07:00
josh d7eb0690ff feat(cabinet): dual-mic blend with comb (14c)
Phase 14c — the classic two-mic technique. When "Mic B" (a second mic-voice
selector, default No Mic) is engaged, a parallel convolver (same cab voice,
mic B's IR) is delayed by up to 1.5 ms (Mic Offset) and summed with the
aligned primary at the Mic Blend balance — the time offset between the two
coherent copies produces comb filtering (e.g. a 57 + 121 blend).

- Mic B: rebuildsOnChange selector; No Mic (default) builds NO second
  convolver, so the single-mic path is bit-identical to before and costs one
  convolution. Mic Blend / Mic Offset are live smooth knobs (advanced pop-over,
  appended after Position/Proximity — append-only for advancedValues).
- Coherent (same-source) mics sum linearly: A*(1-blend) + Bdelayed*blend.
- The look-ahead limiter still bounds the summed output to ±1.

Tests: second mic changes output; with Mic B Off the blend/offset are inert
(single-mic path untouched); blend + comb offset both change output when
engaged; dual-mic round-trips through state; dual-mic stays within ±1. 669
tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 09:31:14 -07:00
josh 35ae16040a docs+test(cabinet): accurate signal-path diagram + honest placement tests
Review follow-ups (no blockers):
- Update the CabinetPedal class doc signal-path diagram to show the full chain
  (mic baked into the IR -> Position/Proximity shelves -> look-ahead limiter),
  which had drifted to the original convolution-only form.
- Reword the placement "neutral defaults" test: it is a default-consistency /
  determinism guard (explicit defaults == default render), not proof of 0 dB
  shelf identity (both sides run the same shelves) -- that identity is the RBJ
  property the reviewer verified. Add loud render-length assertions so a short
  render fails instead of silently passing the guard.

664 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 09:24:24 -07:00
josh f67a5370ff feat(cabinet): mic placement — Position + Proximity (14b)
Phase 14b of cabinet mic modeling. Two live, continuous placement controls in
the CabinetPedal advanced pop-over:

- Position [0,1]: on-axis (0, bright) -> cone edge / off-axis (1, dark), a live
  RBJ high-shelf cut (0..-9 dB @ 3.5 kHz).
- Proximity [0,1]: distant (0, flat) -> close-mic'd (1), a live RBJ low-shelf
  boost (0..+6 dB @ 150 Hz) modelling the proximity effect.

Both are LIVE post-convolution shelves (not baked), so they are smooth knobs
with no rebuild-on-change, and each maps its knob to 0 dB at 0 -> a bit-exact
identity at the defaults (existing cab presets sound unchanged). Placed in
advancedKnobs (advancedValues), append-only, so old CabinetPedal presets don't
shift Mix/Level positions. The look-ahead limiter still bounds output.

Tests: Position/Proximity change output; neutral (0,0) is a bit-exact identity;
advanced knobs exposed; round-trip through state; placement extremes stay within
the ±1 ceiling. 664 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 09:16:22 -07:00
josh 7f1856e8e5 feat(cabinet): mic voicing (14a) + cabinet output soft-limit
Phase 14a of cabinet mic modeling.

- MicVoice (No Mic / Dynamic / Ribbon / Condenser): broad-strokes synthesized
  mic curves (our own MIT content, not captures) as CabIRStage biquad specs
  (presence bump, low/high shelving) that CabinetIRFactory appends to the cab
  cascade before baking — folded into the SAME single convolution IR, so mic
  choice costs nothing at render time. MicVoice.off appends nothing → the IR
  is byte-identical to the raw cab voice (backward compatible).
- CabinetIRFactory.makeIR gains a `mic:` param (default .off) + RBJ low/high
  shelf offline biquads.
- CabinetPedal: Mic selector (rebuildsOnChange, append-only 2nd selector so
  old presets still load with mic defaulting to off) + a tanh soft-limit →
  Clip(±1) output stage, so a decoupled amp → cabinet chain can't clip the
  DAC (a speaker cab is analog; clean signals pass at ~unit gain).
- Help acknowledgment notes the mic voicings are synthesized, not captures.

Tests: No-Mic IR byte-identical to raw cab; dynamic lifts presence, ribbon
darkens top, condenser adds air (peak-normalization-invariant tilt ratios);
mic changes output, round-trips; output stays within ±1 across cab×mic. 659
tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 08:55:11 -07:00
josh a2fcd59e1b docs+test(amp): honest Bias X wording + combined-extreme ceiling test
Review follow-ups (no blockers were found):
- Rewrite Bias X docs: it's a power-amp bias-balance CHARACTER control that
  re-shapes the saturation knee, not a literal push-pull even-harmonic model
  (averaging two same-polarity bias-offset stages doesn't replicate push-pull
  imbalance). Document that both halves are always built (2x power-amp cost
  even at biasX=0 — chosen for a smooth live knob over a rebuild-on-change
  fast path). Fix a public->internal DocC symbol link (plain code font).
- Add extremeBiasAndBiasXStayWithinCeiling: Bias hot + Bias X max drives a
  half-stage bias to ±0.6 (tanh-bounded, outputLimit-clamped) — asserts
  finite, ≤ ±1.

651 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 08:26:56 -07:00
josh 594c501039 feat(amp): Bias X (push-pull balance) in the advanced pop-over
Phase 13. Add a shared power-amp Bias X control modelling push-pull tube
balance. powerAmpStage(_:) runs two TriodeStage halves biased at
powerAmpBiasInput ± (biasX·biasXMaxSpread) and averages them: at biasX = 0
both halves share the base bias, so the average is bit-identical to the
prior single stage (default, no re-voicing); turning it up spreads the
operating points, shifting the even/odd harmonic mix.

Deliberately a character control on the single-ended power model, not a
full push-pull topology rebuild — it reduces to the exact shipped tone at
biasX = 0 (monotonic imbalance amount, default 0). Appended to advancedKnobs
(Sag, Bias, Bias X) — append-only so Phase-11 presets (2 advancedValues)
still load with Bias X defaulting.

Tests: Bias X changes waveshape (RMS-normalized, not level), stays within
±1, is exposed in the pop-over, round-trips through state; neutral
Sag/Bias/Bias X is bit-exact identity. 650 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 08:18:50 -07:00
josh e8b858f1aa fix(amp): clamp cab selector before Int() in isCabinetBypassed
External-review blocker: a huge finite cab value (from a corrupted or
hand-edited rig JSON, restored unclamped via PedalState.selectorValues)
would trap Int(cab.rounded()) at board-build time. Clamp in Double space
first, mirroring CabinetVoice.voice(atSelectorValue:). Regression test
renders infinity / ±1e20 / NaN / out-of-range cab values without trapping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 21:39:27 -07:00
josh 9daffbbdf3 feat(amp): decouple cabinet — "None (direct)" stop + cabinet as separate block
Phase 12. Split AmpVoicePedal.cabinetAndLimit into cabinet(_:) (the
ConvolutionReverb, or a straight pass) + outputLimit(_:) (tanh soft-limit →
Clip(±1)). The output limit ALWAYS runs on the amp, so the per-amp ±1
guarantee survives cabinet removal.

- Cab selector gains a "None (direct)" stop (value = CabinetVoice.allCases
  .count, appended last so existing preset cab indices stay stable).
  isCabinetBypassed skips the convolver at that stop.
- With Cab = None the amp emits its limited, cab-less power-amp signal; the
  player drops the existing standalone Cabinet pedal (shared CabinetVoice /
  CabinetIRFactory, no DSP dup) after it as a real chain block. Default stays
  cab-on (backward compatible).

Tests: None bypasses the convolver, None still limits to ±1 (limiter
survived), the None stop is exposed, and an amp(None) → standalone Cabinet
chain renders non-silent/finite. Note: a downstream cab can overshoot ±1
like any post-amp pedal — end-of-chain level is the board's stage, not the
amp's.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 21:34:12 -07:00
josh 781577b062 fix(amp): preserve legacy rigs across the Sag/Bias rename + move
Addresses two blocking findings from the external review, both legacy
preset-compat (no RT/protocol issues were found):

- Rename compat: "Fullerton Princeton" → display "Fullerton Ivy League"
  would silently drop the pedal from any rig saved under the old name
  (displayName is the serialization key). Add PedalRegistry.legacyTypeAliases
  resolved in makePedal (self-healing: loads, then re-saves under the new
  name). Regression test asserts the old name still resolves.
- Knob-shift compat: moving Modern High-Gain's Sag off the face shrank its
  effectKnobs by one, so an old 11-value knobValues array would misassign
  Sag→Mix and Mix→Level on load. Add a targeted PedalState migration
  (Pedal.legacyMigrated) that lifts Sag into advancedValues and keeps
  Mix/Level in place. Regression test decodes a hand-built legacy preset
  and asserts correct placement.

Also: drop the not-yet-built "Bias X" from a doc comment; de-brand "Vox"
from the Chime variants test names (ToneStackModel .vox enum refs kept).

643 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 21:20:16 -07:00
josh 1de14fd879 feat(amp): shared power-amp Sag + Bias in an advanced pop-over
Phase 11. Promote Sag from Modern High-Gain to a shared AmpVoicePedal
capability and add a Bias control, both surfaced in a new pedal-card
pop-over rather than on the amp face.

- AmpVoicePedal gains `sag` [0,1] (AmplitudeFollower gain-droop, clamped
  [0.15,1] to prevent phase inversion) and `bias` [0,1] mapped to the
  power-amp TriodeStage grid bias ([-0.25,0.25], neutral 0.5 → 0.0 so
  existing voices are unchanged at defaults). Both applied in
  preCabinetCore; new `applySag(_:)` + `powerAmpBiasInput` helpers.
- Modern High-Gain drops its bespoke sag (now inherited); keeps sag=0.3
  default. Sag moves off its face into the pop-over.
- Pedal gains an `advancedKnobs` surface; PedalView draws a gear button
  (top-right) presenting them in a popover, reusing the existing pattern.
- Advanced knobs round-trip through PedalState (new `advancedValues`,
  backward-compatible decode) and are MIDI-CC-mappable (appended last).

De-branding (review nits): "Vox" removed from the Chime family's
user-visible summaries + docs; "Fullerton Princeton" renamed to display
"Fullerton Ivy League". Palette horizontal picker second row now shows
Routing before the Amp Model group.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 21:08:23 -07:00
josh 0f6d69819d chore(amps): hide Neural Amp from palette/registry (keep code for later)
Remove Neural Amp from PedalRegistry.builtIn and PedalPaletteView.preferredOrder
so it can't be added — the model loader's security-scoped file access is unresolved
(fails silently under sandboxing; flagged in external review). NeuralAmpPedal, its
neuralModelRow UI, PedalType/category/color mappings, and tests are all kept for
later iteration — re-add the two entries to re-enable. Help acknowledgment for the
GuitarML loader dropped (feature not user-reachable); registry test now asserts it
is not registered.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 17:34:46 -07:00
josh 3cdb8d9ddb docs+test(amps): Modern High-Gain re-review nits
- Note the sagGainFloor 0.15 rationale (~-16 dB, deepest droop before gating).
- Rename the sag test's metric to dotProduct (it's an unnormalized sign check).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 16:28:05 -07:00
josh b4a04f6dc8 fix(amps): clamp Modern High-Gain sag gain (no phase inversion)
Review blocker: sag gain 1 - sag*envelope went negative because the envelope
follows the post-Presence/Depth-shelf signal, which exceeds 1 (shelves add up to
+8/+6 dB) — at high sag+presence+depth it phase-inverted loud content instead of
drooping (verified ~-1.0 correlation). Clamp the sag gain to [sagGainFloor(0.15),
1] so it always attenuates, never inverts. Doc/const nits fixed (per-const docs,
"switches" not "sweeps" for the binary Tight). Regression test asserts positive
correlation (no inversion) at presence/depth/sag maxed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 16:25:26 -07:00
josh f7787c4ba3 feat(amps): Modern High-Gain — rectifier w/ Sag + Tight (Phase 10)
New ModernHighGainAmpPedal: a BoutiqueAmpPedal on the .mesa stack (Clean/Lead +
Master + Presence/Depth) voiced as a hot modern rectifier. Two new controls:
- Sag — power-supply droop/bloom, built from AmplitudeFollower (envelope → gain
  droop, slow release) in shapeVoice. No dedicated Lyrebird block needed, so no
  1.7.3 release: sag = signal × (1 − sag·envelope), envelope of the post-power-amp
  signal; louder → lower gain → recovers slowly.
- Tight switch — a pre-preamp high-pass whose corner sweeps 20→120 Hz (firms the
  low end for fast riffing), live via inputShaping.

Registered across 6 sites as .amp. 7 tests (sag/tight change output, inherited
channel + rebuildsOnChange, ceiling at max with everything cranked, control
surface, round-trip, registry). Completes the amp-expansion plan.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 16:16:48 -07:00
josh 8a8cac3823 feat(amps): Lyrebird 1.7.2 — re-voice Cali/Boutique onto Mesa/Soldano stacks (Phase 9)
Bump the Lyrebird pin to 1.7.2 (brings the sample-rate-invariant TriodeStage
coupling fix — no more low-end thinning at 88.2/96 kHz — plus the new Mesa/Soldano
tone stacks and the GrayNoise clamp). Re-voice onto the accurate stacks:
- Cali Hi-Gain (Mesa Mark): .fender → .mesa.
- Boutique Lead (Soldano SLO): .marshall → .soldano.
Other amps unchanged (tweed = .fender = Bassman; Music Man Fender-derived).

Tone-stack-model test assertions + docs updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 16:04:09 -07:00
josh ac61b47d17 feat(amps): character amps — Command/Citrus/Sixties/Magna/Anaheim (Phase 8)
Five character voices:
- Command (Hiwatt) — BritishCombo variant: loud hi-fi clean, high headroom.
- Citrus (Orange) — .marshall, fixed mid bump + a single Shape tilt control.
- Sixties Combo (Supro) — .fender, gritty early breakup + onboard tremolo (shared
  tremolo helper + footswitch).
- Magna Vibrato (Magnatone) — .fender, TRUE pitch vibrato: a DelayLine whose delay
  is swept by an LFO (Speed/Depth + footswitch), not amplitude tremolo.
- Anaheim (Music Man hybrid) — .fender, symmetric-bias (solid-state-flavoured)
  preamp, huge headroom, Bright + Deep switches, and a built-in Limiter
  (LookAheadLimiter, ceiling 0.5 when engaged, before the power amp). True
  oversampled hard-clip SS shaper deferred to Lyrebird 1.7.x.

Registered across 6 sites as .amp. New CharacterAmpsTests suite (10 tests):
per-amp control/effect changes, Sixties tremolo bit-exact bypass, Magna vibrato
on≠off + fixed-delay-when-off, Anaheim switches + limiter engages hot, ceiling at
max for all five, tone-stack models, round-trip, registry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 15:36:06 -07:00
josh 95839a9e35 feat(amps): Cali Hi-Gain — Mesa Mark w/ 5-band graphic EQ (Phase 7)
New CaliHiGainAmpPedal: a BoutiqueAmpPedal (Clean/Lead channel, Master, Presence,
Depth) with an onboard 5-band graphic EQ layered in shapeVoice — RBJ low shelf
(80) → peaks (240/750/2200) → high shelf (6600), each a dB fader via
effectSliders, cascaded after the base Presence/Depth shaping. Defaults to a mild
scooped "V" (the Mark-series signature). .fender tone stack (Mark lineage);
gain 6, hot Lead drive 16, British 4×12.

Registered across 6 sites as .amp. 7 tests (EQ bands change output, inherited
channel/master, ceiling with EQ + gain maxed, control surface incl. slider bank,
round-trip, registry).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 15:18:06 -07:00