791fbd1b2c
Cross-repo plan: cabinet-IR pedal ships on 1.6.4 (reuses ConvolutionReverb); tone-stack / triode / neural-inference land as Lyrebird 1.7; amp pedals + UI ship as ShoeGaze 2.0. Branch + review gates and versioning strategy included. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
110 lines
6.5 KiB
Markdown
110 lines
6.5 KiB
Markdown
# ShoeGaze 2.0 — Amp Modeling Plan
|
||
|
||
Adds guitar-amp modeling to ShoeGaze. Core DSP primitives that don't yet exist land in
|
||
Lyrebird and ship as **Lyrebird 1.7**; the amp pedals + UI land in ShoeGaze and ship as
|
||
**ShoeGaze 2.0**.
|
||
|
||
Feasibility basis: the public literature is deep (WDF/DAFx for white-box, NAM/GuitarML for
|
||
black-box), and Lyrebird already provides most of the DSP (oversampling, waveshapers, the full
|
||
filter suite, `SampleLoop` per-sample feedback, partitioned FFT convolution via
|
||
`ConvolutionReverb`, WAV IR loading via `LyrebirdBuffer.read(filePath:)`, and the
|
||
`PhysicalModels` precedent for nonlinear stateful per-sample DSP). The only genuine gap is a
|
||
real-time neural-inference kernel.
|
||
|
||
## Versioning & repo strategy
|
||
|
||
- **Lyrebird → 1.7.0** for every core addition. Dev repo is BitBucket (`origin`, SSH); public
|
||
release repo is mooo. Cut 1.7 once the needed core subset is merged to `main`: RELEASES entry,
|
||
tag `v1.7.0`, push BitBucket, then `/lyrebird_release_prep` → commit/tag → push mooo
|
||
(**HTTPS, force `-c http.version=HTTP/1.1`** — mooo's HTTP2 is flaky).
|
||
- **ShoeGaze → 2.0.0**. `origin` is mooo (HTTPS). Bump `Package.swift` dependency to
|
||
`from: "1.7.0"` once 1.7 is released; bump `MARKETING_VERSION` to `2.0.0` at the end.
|
||
- **Dev-time cross-repo:** ShoeGaze work needing unreleased Lyrebird uses
|
||
`swift package edit lyrebird --path <dev-repo>` locally, then drops the override and bumps
|
||
`from:` after 1.7 ships. (Same flow used for the 1.6.4 work.)
|
||
|
||
## Branch + review gates (apply to every feature below)
|
||
|
||
**Lyrebird feature** (`feat/<name>` off `main`):
|
||
1. `swift test` green.
|
||
2. Guards as applicable: `check-docc.sh`, `check-doc-snippets.sh`; if a public generator init
|
||
changes, regenerate the DSL registry and run `generate-dsl-registry.sh --check`.
|
||
3. `/lyrebird_review` clean (no blocking findings) — re-run until clean.
|
||
4. FF/merge to `main`. Append phase entry to `phase_history.md`.
|
||
|
||
**ShoeGaze feature** (`feat/<name>` off `main`):
|
||
1. `swift test` green.
|
||
2. `/lyrebird_external_review` clean (RT-safety on any new Generators).
|
||
3. Merge to `main`.
|
||
|
||
New public RT generators require a deterministic input→output test (not just "not silent") —
|
||
e.g. the Goertzel alias-ratio pattern used for the oversampled saturators.
|
||
|
||
## Phase 0 — Decisions (no code)
|
||
|
||
- **Neural kernel strategy:** (a) hand-written Swift LSTM/GRU (Proteus-size), or (b) bridge
|
||
RTNeural (C++) via the existing `LyrebirdC` target. **Recommend (a)** first — pure Swift keeps
|
||
the Linux/Windows port intact (see the cross-platform feasibility work) and Proteus-size LSTMs
|
||
are small. Keep (b) as an optional fast-path later.
|
||
- **White-box depth:** full nodal/WDF vs static triode waveshaper + oversampling. **Recommend
|
||
static-waveshaper triode stages first** (Koren/Dempwolf transfer curves), add a minimal WDF
|
||
core later only if the voicing demands true bidirectional stages.
|
||
|
||
## Lyrebird 1.7 — core additions
|
||
|
||
Only what has no existing primitive. Each is its own branch + `/lyrebird_review`.
|
||
|
||
- **L1 · ToneStack generator** (`feat/tonestack`) — passive Fender/Marshall/Vox tone-stack IIR
|
||
(Yeh coefficients), control-rate coefficient updates. Filters exist but not this specific
|
||
topology as a first-class, model-selectable block.
|
||
- **L2 · Triode preamp stage** (`feat/triode-stage`) — nonlinear tube gain stage: bias +
|
||
coupling cap + Koren/Dempwolf static curve, **built-in 2×/4× oversampling** (reuse the
|
||
halfband primitives), grid-conduction asymmetry. The white-box building block.
|
||
- **L3 · Neural inference generator** (`feat/neural-inference`) — RT-safe LSTM/GRU (and later
|
||
WaveNet) as a `GeneratorBase` subclass: weights preloaded at `init` into pre-allocated
|
||
matrices, alloc-free/lock-free per-sample matmul on the render thread (same discipline as the
|
||
physical models). Plus a weight-container loader for NAM `.nam` / Proteus JSON.
|
||
- **L4 · (optional) WDF core** (`feat/wdf-core`) — minimal wave-digital adaptors (series/parallel
|
||
/R/C/diode + triode root with a **bounded, alloc-free Newton solve**). Defer unless L2 proves
|
||
insufficient.
|
||
- **L0 · Verify, likely no-op:** cabinet convolution + WAV IR loading already exist
|
||
(`ConvolutionReverb`, `LyrebirdBuffer.read`). Confirm the convolver is comfortable with
|
||
cab-length IRs (tens of ms) at low latency; only add a thin general `Convolution` alias if the
|
||
reverb framing is awkward for cabs. **Probably needs no 1.7 change.**
|
||
|
||
Cut **Lyrebird 1.7.0** after L1–L3 (and L0 if touched) are merged.
|
||
|
||
## ShoeGaze 2.0 — amp pedals + UI
|
||
|
||
- **S1 · Cabinet IR pedal** (`feat/cabinet-pedal`) — wraps `ConvolutionReverb` + a bundled/loadable
|
||
IR set + IR picker. **No Lyrebird dependency change — ships on 1.6.4.** Quick win; can land
|
||
before 1.7. Pair with an oversampled `Waveshaper` for an immediate amp-ish chain.
|
||
- **S2 · Component amp pedal** (`feat/amp-component`, needs 1.7 L1+L2) — input → gain →
|
||
oversampled triode stage(s) → tone stack → power-amp sag (dynamics) → cabinet IR. Model-select
|
||
a few voicings (clean/crunch/lead).
|
||
- **S3 · Neural amp pedal** (`feat/amp-neural`, needs 1.7 L3) — loads NAM/Proteus captures;
|
||
model browser; DI-in → neural → (optional) cabinet IR.
|
||
- **S4 · Amp UI** (`feat/amp-ui`) — amp-head-style card: Gain, Bass/Mid/Treble/Presence, Master,
|
||
Cab select, Model select; MIDI/CC mapping; larger `widthUnits`. (Mind the flow-canvas height:
|
||
no greedy vertical `Spacer`s — see the looper fix.)
|
||
- **S5 · Rigs, presets, release** — factory amp rigs; docs; bump dep to Lyrebird 1.7, app to
|
||
2.0.0; tag + push mooo (HTTP/1.1).
|
||
|
||
## Suggested order
|
||
|
||
1. S1 cabinet pedal (independent, ships on 1.6.4).
|
||
2. Lyrebird 1.7: L1 tone stack → L2 triode → L3 neural (each branch + review); cut 1.7.
|
||
3. ShoeGaze: S2 component amp, then S3 neural amp; S4 UI alongside; S5 release 2.0.
|
||
|
||
## Risks / open items
|
||
|
||
- **RT budget:** stacked oversampled stages + convolution + neural can be heavy. Measure with the
|
||
CPU meter; consider `ParallelGroup` for independent chains.
|
||
- **Neural portability:** Swift kernel preserves the cross-platform port; an RTNeural C++ bridge
|
||
would not — decide in Phase 0.
|
||
- **WDF Newton solve** must be strictly alloc-free with bounded iterations to satisfy RT rules.
|
||
- **Licensing:** vet cab-IR and NAM-model licenses before bundling any factory content.
|
||
- **Anti-aliasing:** every nonlinear stage oversamples (the halfband primitives are proven);
|
||
neural distortion aliases too — consider the fine-tuning / oversampling mitigations from the
|
||
recent literature if artifacts appear.
|