Register stereo pedals for preset round-trip

Add Octave Splitter and Ping-Pong to PedalRegistry so rigs containing
them reconstruct on loadRig — board.add replays the mono→stereo width
transition automatically. Document that split-section topology (parallel
and stereo) remains outside the captured linear chain, as before.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 16:50:26 -07:00
parent f89229282f
commit 02cee9a358
2 changed files with 56 additions and 3 deletions
@@ -12,9 +12,16 @@
/// are silently skipped by the loader.
///
/// To register custom pedal types, extend `builtIn` by building your own dictionary
/// and merging it before calling `loadRig`. The built-in registry covers the twelve
/// factory pedals: Overdrive, Delay, Reverb, Modulation, Fuzz, Tremolo, Phaser,
/// Compressor, Mu-Tron, Auto-Wah, Feedback Delay, and Multi-Tap Delay.
/// and merging it before calling `loadRig`. The built-in registry covers the factory
/// pedals: Overdrive, Delay, Reverb, Modulation, Fuzz, Tremolo, Phaser, Compressor,
/// Mu-Tron, Auto-Wah, Feedback Delay, Multi-Tap Delay, Octave Splitter, and Ping-Pong.
///
/// > Note: A saved rig captures each board's *linear* pedal chain only (see `BoardState`).
/// > When a registered widener (e.g. Octave Splitter) or stereo-native pedal (e.g.
/// > Ping-Pong) appears in that chain it round-trips fully — `board.add(_:)` replays the
/// > mono → stereo width transition on load. Parallel sections (`split()`/`merge()`) and
/// > stereo split regions (`splitStereo()`) are *not* part of the captured linear chain
/// > and are therefore not serialized.
public enum PedalRegistry {
/// Maps each built-in pedal display name to a `@MainActor` no-argument constructor.
@@ -36,6 +43,8 @@ public enum PedalRegistry {
"Auto-Wah": { AutoWahPedal() },
"Feedback Delay": { FeedbackDelayPedal() },
"Multi-Tap Delay": { MultiTapDelayPedal() },
"Octave Splitter": { OctaveUpSplitterPedal() },
"Ping-Pong": { PingPongDelayPedal() },
]
/// Returns a new `Pedal` instance for the given type string, or `nil` if the type