Commit Graph

236 Commits

Author SHA1 Message Date
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 53b506adeb fix(pedal): audio-rate linear bypass crossfade to kill on/off click
The engaged↔bypassed crossfade smoother was a one-pole Lag.Control,
whose exponential curve is front-loaded (steepest slope at the very
start). That clicked when the two crossfade legs are decorrelated and
full-scale — e.g. a wet-only pitch shifter swapping against the dry
note — and was only masked when wet ≈ dry.

A block-rate smoother does not fix it: at the engine's 512-sample block
a short fade is just a few coarse steps, each its own click.

Switch to an audio-rate linear Slew.Audio, which ramps one step per
sample regardless of block size, driving an equal-power crossfade. The
old `private let bypassLagTime` becomes an overridable `open var
bypassFadeTime`, clamped to a positive floor before taking its
reciprocal so a subclass override of 0 or negative cannot reintroduce
an instantaneous (clicking) or inverted slew. Affects every pedal's
on/off transition.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-15 12:11:06 -08:00
josh 4e8f6e280c release: ShoeGaze 3.3.0 — noise-gate threshold + mono-output fixes on Lyrebird 2.2.0
Bump to Lyrebird 2.2.0 (both Package.resolved pins → 2.2.0 / 24ea32e) and cut
ShoeGaze 3.3.0. This release surfaces the upstream ramp-origin fix plus the two
local fixes already on main:

- Noise Gate respects its threshold after loading a rig: the gate's open level is
  derived from the threshold, which previously swept up from a default on the first
  audio block and tripped the gate on the transient (latching it open). Lyrebird
  2.2.0 delivers a pre-first-render parameter value flat, so the gate reads its real
  threshold from block one.
- Mono rigs output at unity (were ~3 dB down through a centre pan).
- Noise Gate detector Peak/RMS switch, defaulting to RMS.

NoiseGatePedal doc comment tidied (signal-chain diagram + detector parameter).
App build track: MARKETING_VERSION 3.3, CURRENT_PROJECT_VERSION 23.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-03 13:09:48 -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 0ddf350f1f Migrate to Lyrebird 2.0.0; app version bump
Lyrebird 2.0 moved `@UIParam` / `UIParamNode` out of `LyrebirdUI` into the
core `LyrebirdSynth` module (the `Lyrebird` product); `LyrebirdUI` no longer
re-exports them. Migrate:
- add `import LyrebirdSynth` to every file that uses `@UIParam`/`UIParamNode`
  (the pedal controls, tempo-syncable params, and the SwiftUI views).
- Package.swift: the `LyrebirdShoeGazeUI` target now also depends on the
  `Lyrebird` product (previously only `LyrebirdUI`), so `import LyrebirdSynth`
  resolves there under explicit module maps.
- Package.resolved (SwiftPM + both Xcode projects) pinned to Lyrebird 2.0.0.

Also: app marketing/project version bumps, Xcode upgrade-check, and a
CHANGELOG wording tweak carried in the same working tree.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-23 21:17:30 -07:00
josh f8926ecfb8 fix(mutant): double-width pedal so switch captions don't wrap — 3.1.1
The Mutant envelope filter's three segmented switches (Direction / Mode /
Range — seven segments total) were crammed into a single-width pedal, so the
"Down" caption wrapped to "Do wn". Mutant is now double-width, like the
Cabinet and amp pedals, giving the switch row room for its captions.

Bumps both apps to MARKETING_VERSION 3.1.1 and records the fix in
CHANGELOG.md / RELEASES.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-13 20:04:56 -07:00
josh 9873dd258b fix(rigs): don't let starter overwrites be reverted by reseeding
External-review findings for 3.1.0:

- A starter rig can no longer be overwritten in place. Saving over a loaded
  starter previously stored the edited content under the rig's fixed factory
  id, so the next starter-catalog update (or Restore Starter Rigs) would
  silently revert it to the shipped version. The confirmation now offers only
  Save as New Rig / Cancel — a starter is managed content, and the player's
  changes are kept as their own rig (a new id) instead.
- restoreStarterRigs advances the seed-version marker only on success, matching
  start(), so a failed manual restore no longer suppresses the next launch's
  automatic catch-up seed.
- CHANGELOG: correct the starter-rig count (18, not 19).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-13 10:38:26 -07:00
josh 93ca9076d2 docs: 3.1.0 release notes, README refresh, Help + version bump
- CHANGELOG: add the 3.1.0 entry (starter rigs, Mine/Starters sidebar, Vibe
  and Sustain Fuzz pedals, Mutant Range/Sweep/Attack/Release, input-preserved
  rig switching, shimmer defaults, overwrite guard, router persistence).
- README: correct the pedal count (36 -> 67, incl. 26 amp models), add the
  Amp Model and Cabinet catalog rows and the new pedals, add a Starter Rigs
  feature, and bump the Lyrebird requirement to 1.7.0+.
- Help: add a "Starter Rigs" topic and note that switching rigs keeps the
  current input.
- Bump the iOS app MARKETING_VERSION to 3.1.0 to match macOS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-13 09:58:34 -07: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 850b86209a fix(shimmer): lower default + starter decay/shimmer to avoid self-oscillation
The shimmer reverb's regenerating loop gain is ~decay + shimmer, so hot
values screech into sustained feedback with little or no input. The pedal
defaults summed to 1.3 (0.8 + 0.5) — over unity on a fresh add — and several
starter rigs ran 1.3–1.6.

- Pedal defaults: decay 0.8 -> 0.5, shimmer 0.5 -> 0.25, damp 0.4 -> 0.5
  (sum 0.75), with a doc note on keeping decay + shimmer < 1.
- Starter rigs using it (Dreampop Chorus Cathedral, Ambient Shimmer Bed,
  Post-Rock Crescendo, Comfortably Numb Lead): decay/shimmer pulled down so
  each sums to ~0.8 or less; damping raised. Bumped seedVersion to 4 so
  existing libraries refresh.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-12 14:59:58 -07:00
josh 2aea609f34 feat(rigs): ship the tweaked Garcia rig as a captured state
Replace the code-built Garcia with the user's hand-authored version,
transcribed verbatim as a ShoeGazeState: Board 1 (Bass Octaver, Mutant,
Overdrive, Graphic EQ, Phaser, Delay, Fullerton Reverb) and Board 2
(Overdrive, Graphic EQ, Compressor, Fullerton Reverb), preserving exact mix,
graphic-EQ slider, cab-selector and amp sag/bias values. Input source and
channel counts are omitted so the rig stays input-agnostic.

Adds a FactoryRigBuild.state case (and matching FactoryRig init) for rigs
shipped as a pre-captured state rather than a live builder, and bumps
seedVersion to 3 so existing libraries refresh Garcia to the new version.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-10 17:04:58 -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 5decdd8693 fix(rigs): refresh stale starters on update; tab follows current rig
- Seeding now (re)installs every starter by stable id, so a corrected rig
  definition replaces the stale copy already in a library (save upserts by
  id, keeping its position) — user rigs untouched. Bumped seedVersion to 2
  so existing libraries pick up the two-board Garcia rig (the old router
  version showed "No board at index 0" because the builder UI renders boards,
  not routers, and the stale entry was never refreshed). "Restore Starter
  Rigs" likewise refreshes all starters, not just missing ones.
- The Mine/Starters toggle now opens on the group containing the currently
  loaded rig (Starters when a factory rig like Garcia is active, else Mine),
  and follows the selection when the current rig changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 17:57:57 -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 392ae1525a fix(ui): split builder presentation chain to satisfy the type-checker
The factory-overwrite confirmation dialog pushed ShoeGazeBuilderView's
already-large presentation modifier chain past the Swift expression
type-checker's budget — it compiled under `swift build` but failed the
Xcode app build with "unable to type-check this expression in reasonable
time". Extract the first half of the chain into a `chromeWithPrompts`
computed property so each half type-checks quickly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 14:20:04 -07:00
josh ad6ed41674 feat(ui): Mine/Starters rig toggle + seed starters into existing libraries
Two fixes so shipped starter rigs are actually reachable:

- Seeding no longer requires an empty library. On launch it installs any
  factory rigs whose stable ids are missing, once per FactoryRigLibrary
  .seedVersion (a per-device UserDefaults marker). Existing users therefore
  receive the starters on their next launch; a starter the user later
  deletes stays deleted (the marker has advanced); bumping seedVersion when
  new starters ship re-runs catch-up for just the new ones. Idempotent by id,
  so iCloud-synced devices never duplicate.
- Sidebar gains a segmented Mine / Starters toggle. "Mine" is the flat,
  reorderable user list; "Starters" groups the shipped rigs by category. A
  "Restore Starter Rigs" action (Starters empty-state button + library menu)
  re-installs missing starters on demand via RigLibraryBootstrap.restoreStarterRigs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 14:11:22 -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 779c55493d feat(rigs): add six more single-board starter rigs
Extend the factory catalog from 8 to 14 using existing pedals: Funk
Envelope Clav, Nashville Clean Comp, Rockabilly Slapback (classic),
Post-Rock Crescendo, Dub Delay Throw (ambient), and Ring-Mod Texture
(experimental). All build/load/render green via the existing tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 12:58:23 -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 654e80e9c8 docs(help): add Amp Models + Cabinets & Microphones help sections
Two new in-app Help topics for the 3.0 amp features:
- Amp Models: picking an amp, the 1–11 Gain taper, Master (power-amp drive)
  vs Level (clean trim), analog soft-limiting, and the advanced pop-over
  (Sag / Bias / Bias X) reached via the top-right sliders button.
- Cabinets & Microphones: an amp's built-in cab vs a standalone Cabinet
  pedal ("None (direct)" + a Cabinet after the amp), cab/mic voicing, and
  the mic-placement + dual-mic pop-over (Position / Proximity / Mic B /
  Blend / Offset). Notes the models are original DSP, not captures.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-05 14:12:52 -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 a1ce308082 ui(layout): size pedal card width to content, not widthUnits × base
Cards were `220 × widthUnits` wide, so control-sparse multi-unit pedals sat
mostly empty (a 3-unit amp was 660px for a 4-knob row needing ~270; the
2-unit Cabinet was 440 for three selectors). Size the enclosure to its widest
actual row instead — knob grid (columns capped by widthUnits), inline
selectors, or switches — floored at the 3-slot Level·Bypass·Mix footer, and
still widened for a vertical-fader bank. New: Cabinet 440→252, Bluesbreaker
660→330, Boutique/Dual 880→330; 1-unit pedals ~252.

widthUnits now only sets the knob-column cap (≥2 packs 4 across), not raw
width, so all 4-knob amps land at the same tight width regardless of their
3/4 unit value. The looper keeps the flat multiple — its bespoke three-column
timeline/knobs/transport layout genuinely needs the wide card.

675 tests pass (view geometry; no logic change).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 19:02:50 -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 11ce3f47d2 ui(palette): move Cabinet to row 2 between Routing and Amp Model
The Cabinet got its own category (row 1, effects) in the last change; move it
to the second row so the rig-structure blocks read left-to-right as
Routing | Cabinet | Amp Model. Split a cabinetGroup out of effectGroups and
render it between the Routing cards and the amp group in the horizontal picker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 11:48:18 -07:00
josh ebc660898d docs(amp): reattach powerAmpDrive comment after the dial constants 2026-08-04 10:47:47 -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 da2c3328ee ui(cabinet): own category after amps + double-width card + stable selector id
- Add a dedicated PedalCategory.cabinet (tweed tan), placed right after
  Amp Model, and remap the Cabinet pedal to it (was buried in EQ & Filter).
  Move "Cabinet" in the palette preferredOrder to just after the amps.
- CabinetPedal is now double-width (widthUnits 2): three selectors
  (Cab / Mic / Mic B) crowded at single width, clipping the leading Cab
  caption and overlapping dials (a drag near the Mic/Mic B boundary could
  land on the neighbor's gesture — the "moving Mic moved Mic B" report).
- Harden the selector-row ForEach: key by the (unique-per-pedal) selector
  label instead of the array offset, so each selector keeps a stable SwiftUI
  identity across board rebuilds and can't inherit a sibling's drag state.

669 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 10:01:39 -07:00
josh 9b23f99a58 docs(cabinet): fix doc attachment + class-level surface for dual-mic
Review follow-ups (all doc-only; DSP/RT/preset verified correct):
- The blendSecondMic insertion had detached applyPlacement's summary; give each
  helper its own complete doc block again.
- Update the class-level signal-path diagram + ## Parameters list for micB /
  micBlend / micOffset and the optional parallel second-convolver branch.
- micOffset: note it is a set-and-leave spacing control (live-sweeping it moves
  the comb, a flanger-like effect) — keeps .linear interp so micOffset=0 is a
  true zero-delay alignment.
- Correct the maxMicOffsetSeconds comment (1.5 ms ~ 0.5 m spacing, not "mic
  diameters"; first notch near 330 Hz at full offset).

669 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 09:40:09 -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 96ab2a0586 docs(cabinet): note partial-mix comb from the limiter's wet delay 2026-08-04 09:08:29 -07:00
josh 99649c2d89 fix(cabinet): transparent look-ahead limiter instead of always-on tanh
External-review blocker: the tanh soft-limit (drive 1.0) is not unit gain at
realistic levels (tanh(0.5)=0.462, -7.6% plus harmonics), so it silently
colored and compressed EVERY signal through this general-purpose pedal, not
just peaks -- an always-on tone change to all existing CabinetPedal presets.

Replace it with LookAheadLimiter (maxAmplitude 1.0, 2 ms look-ahead, 50 ms
release): a true peak limiter that leaves below-ceiling signals untouched (no
coloration of clean material) and only pulls gain down for the brief peaks a
convolution can push past +/-1. Matches the requested "soft limiting" intent
(peak taming, not saturation); adds a short 2 ms delay.

Also (caveman nits): collapse the duplicate dB->amplitude divisor constant to
one shared name; the wet/dry mix is equal-power, so the doc no longer claims a
partial-mix +/-1 guarantee. 659 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 09:06:15 -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 9c0122f199 docs(preset): reattach applyState doc above its declaration
The legacy-migration fix spliced private declarations between applyState's
doc comment and the method, so the doc silently reattached to the private
modernHighGainType constant. Move it back above applyState (and note the
legacyMigrated normalization + advanced-knob restore). Caught in re-review.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 21:26:35 -07:00