Add mono→stereo routing to PedalBoard

Introduce chain width propagation (mono=1 / stereo=2, capped at 2),
represented as a pair of mono buses to reuse existing infrastructure.

- Pedal: width-parameterized build() with channelKind (mono / widener /
  stereoNative); effect() runs per channel for auto-stereoize, shared knobs.
- PedalBoard: width tracking, add() dispatch, mergeToMono(), splitStereo()/
  collectStereo() with four route modes (stereo / leftOnly / rightOnly /
  bypass), centered solo, click-free lagged gains.
- BoardOutputMaster: width-aware (Pan2 mono, direct L/R stereo).
- New routing nodes: StereoSplitter, StereoRouteCollector, StereoSplitSection.
- Reference pedals: OctaveUpSplitterPedal (widener), PingPongDelayPedal
  (stereo-native).
- 12 stereo-routing tests; full suite 108/108.

Design: docs/stereo-routing-design.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 16:48:25 -07:00
parent ca4cabb42f
commit f89229282f
14 changed files with 1486 additions and 34 deletions
@@ -42,6 +42,12 @@ public enum ShoeGazeError: Error, LocalizedError, Equatable, Sendable {
/// session is not started.
case recordTapFailedToOpen(URL)
/// Thrown by `PedalBoard.add(_:)` when a widener pedal (``PedalChannelKind/widener``)
/// is added while the board is already stereo (width 2). The chain width is capped at 2.
///
/// Narrow the chain with `mergeToMono()` before adding another widener.
case stereoWidthExceeded
// MARK: - LocalizedError
public var errorDescription: String? {
@@ -56,6 +62,8 @@ public enum ShoeGazeError: Error, LocalizedError, Equatable, Sendable {
return "ShoeGaze: set recordingFolder before calling startRecording()."
case .recordTapFailedToOpen(let url):
return "ShoeGaze: could not open recording file '\(url.lastPathComponent)'."
case .stereoWidthExceeded:
return "PedalBoard: chain is already stereo (width 2); cannot add another widener. Use mergeToMono() first."
}
}
}