1a09cf9cf8
A stereo-output pedal (Ping-Pong, Octave Splitter) now shows a "Stereo flow / Split L/R" toggle on its card: - Stereo flow (default): unchanged broadcast behavior — following pedals process both channels as one stereo flow. - Split L/R: inserts a Stereo Unzip region right after the pedal, routing the L channel into one lane and R into the other for independent processing, then recombining to stereo with the same route/solo/bypass control as the stereo split. Engine/core: - StereoUnzipSplitter: 2-in -> 3-out node (L->lane L, R->lane R, and a centered 0.5*L+0.5*R dry tap for the bypass route). - PedalBoard.unzipStereo() mirrors splitStereo() but reads both tails and requires width 2; reuses collectStereo / StereoSplitSection / StereoRouteCollector. New stereoUnzipSections (cleared on teardown). - BoardSegment/.stereoUnzip + StereoUnzipState round-trip via preset capture/rebuild/applyState. - ShoeGaze.insertStereoUnzip(afterSegment:)/isStereoUnzip(afterSegment:) drive the toggle; invalid insert (mono tail) throws cannotUnzipMonoChain and the atomic rebuild keeps the board intact. - StereoSplitSection.splitter relaxed to `any Synthesizer` (stored only) so it can hold either splitter type. UI: per-pedal toggle + STEREO UNZIP region rendering in BoardFlowView. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
37 lines
1.6 KiB
Swift
37 lines
1.6 KiB
Swift
// BoardSegment.swift
|
|
// Lyrebird
|
|
//
|
|
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
/// One ordered element of a ``PedalBoard``'s signal chain, used to capture full topology
|
|
/// (including parallel and stereo split regions) in signal-flow order.
|
|
///
|
|
/// `PedalBoard` records these as pedals and split regions are added, so a board can be
|
|
/// serialized and rebuilt faithfully rather than as a flat pedal list. Branch pedals live
|
|
/// inside their section objects, not as separate segments.
|
|
///
|
|
/// Public so a UI can walk a board's live structure in signal-flow order (each element carries
|
|
/// the live `Pedal` / section object). The index of a segment within `PedalBoard.orderedSegments`
|
|
/// matches its index in `captureState().segments`, which is the region index used by the
|
|
/// lane-addressed edit API (see ``PedalLane``).
|
|
public enum BoardSegment {
|
|
|
|
/// A single linear pedal in the main chain.
|
|
case pedal(Pedal)
|
|
|
|
/// A parallel section (`split()` → two branches → `merge()`).
|
|
case parallel(ParallelSection)
|
|
|
|
/// A stereo split region (`splitStereo()` → two branches → `collectStereo()`).
|
|
case stereoSplit(StereoSplitSection)
|
|
|
|
/// A stereo unzip region (`unzipStereo()` → two branches → `collectStereo()`). Reuses the
|
|
/// `StereoSplitSection` payload; the distinct case lets capture/rebuild pick the unzip splitter.
|
|
case stereoUnzip(StereoSplitSection)
|
|
|
|
/// A `mergeToMono()` collapse — narrows a stereo tail back to mono. Carries no state;
|
|
/// recorded so the width transition replays on rebuild.
|
|
case mergeToMono
|
|
}
|