Commit Graph

23 Commits

Author SHA1 Message Date
josh 35971d4acc Add ShoeGaze Builder demo apps (macOS + iOS)
Two thin app shells hosting ShoeGazeBuilderView:

- macOS (AppKit): seeds one board with an Overdrive; anchors the window
  ~100px from the left of the visible screen and sizes it to most of the
  screen height via LyrebirdWindow.nsWindow.
- iOS (SwiftUI): NavigationStack hosting the builder; AVAudioSession +
  iOSAudioDriver; logs session-activation failures.

Both .xcodeproj reference the local package (..) + the remote Lyrebird
package, with fresh hex object-id prefixes; added to ShoeGaze.xcworkspace.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 09:32:18 -07:00
josh d41ba37093 Add signal-flow pedalboard builder UI
Interactive builder views in LyrebirdShoeGazeUI:

- PedalPaletteView: vertical sidebar listing every pedal (tap to append
  to the main chain, drag "add:<type>" onto a lane) plus routing actions
  (Stereo Split / Parallel Split / Merge to Mono).
- BoardFlowView: left-to-right signal-flow board driven by
  board.orderedSegments. Pedal cards joined by pink connector lines
  (double for stereo width); split regions render as two stacked L/R
  (A/B) lanes you fill independently by dropping pedals; per-card trash,
  drag-to-reorder within a lane, region route/mode controls, and a
  region trash. Reads shoeGaze.boards[index] fresh each body (index is
  the stable anchor across rebuilds).
- ShoeGazeBuilderView: sidebar + vertically-centered flow board, with
  transport, input picker, board picker, and JSON save/load (NSSavePanel
  / NSOpenPanel on macOS, fileExporter/Importer on iOS via
  RigFileDocument).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 09:32:09 -07:00
josh e1ec98413d Add board edit API: lane-addressed pedal/region editing
Core support for interactively building and editing a board, all via the
existing capture-BoardState -> mutate -> rebuildBoard path (no RT-graph
surgery):

- PedalLane addresses the main chain or a stereo/parallel branch.
- appendPedal/removePedal/movePedal gain a `lane:` parameter (default
  .main, so existing call sites are unchanged).
- appendStereoSplit/appendParallelSplit/appendMergeToMono/removeSegment
  insert and remove branch regions; split/merge guarded by tail width.
- setInputSource preserves the rig across an input-source change.
- rebuildAllBoards / loadRig(from:Data) / rigData added; loadRig is now
  atomic (teardown-on-failure) so a failed load leaves an empty rig.
- Expose PedalBoard.orderedSegments and BoardSegment publicly so a UI can
  walk live board structure; index aligns with captureState().segments.
- InputSource: Equatable. New errors: unknownPedalType,
  pedalIndexOutOfRange, cannotSplitStereoChain, cannotMergeMonoChain,
  notABranchRegion.

Tests cover append/remove/move on main and branch lanes, region
add/remove, width guards, move-to-end before trailing regions, input
switch, and knob/bypass/branch value persistence through save/load.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 09:31:57 -07:00
josh 0960d4e7c5 Merge bass-octaver-pedal: Boss OC-2 style bass octaver 2026-06-21 20:49:32 -07:00
josh 2ba57cadd6 Add Bass Octaver pedal (Boss OC-2 style)
Monophonic octave-down pedal with OCT1/OCT2/Direct knobs and a Mode
switch between two algorithms:

- Flip-flop (default): a hysteresis comparator clocks a T flip-flop
  divider chain (new SubOctaveDivider generator) to produce square
  sub-octaves one and two octaves down, amplitude-followed off the dry
  signal. Time-domain — tracks low bass with no detection floor.
- Tracking: FreqTracker drives square oscillators at half and quarter
  the detected frequency. Cleaner, but limited by the tracker's ~90 Hz
  floor; flip-flop is the bass mode.

SubOctaveDivider classifies its input as generator-or-scalar at init to
keep _computeSamples allocation-free, uses a shared file-scope zero
block, bounds-checks the input read, and traps on divisor < 2.

Tests: BassOctaverPedal integration (both modes non-silent, modes
differ, sub-octaves change output, knobs/switch/preset/registry) and
SubOctaveDivider deterministic frequency-division (divisor 2 -> /2,
divisor 4 -> /4, /4 one octave below /2). 127 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 20:43:03 -07:00
josh c677e124f4 Merge stereo-preset-topology: split-region topology serialization
Boards serialize as ordered segments (pedal | parallel | stereoSplit |
mergeToMono) so split regions, branch chains, and routing modes round-trip
through presets. Backward-compatible decode of legacy flat-pedal files;
lightweight recall covers branches. Suite 116/116.
2026-06-21 17:13:38 -07:00
josh 712f049f96 Serialize split-region topology in presets
Replace the flat per-board pedal list with an ordered [BoardSegmentState]
(pedal | parallel | stereoSplit | mergeToMono) so parallel and stereo
split regions — branch pedal chains plus SplitMode/StereoRoute — round-trip
through saveRig/loadRig and rebuildBoard.

- PedalBoard.orderedSegments tracks chain structure (add/split/splitStereo/
  mergeToMono); captureState() walks it; rebuildSegments() replays it.
- BoardState backward-compatible: decodes legacy flat `pedals` arrays;
  computed `pedals` exposes the linear subset; throws on a file missing both
  keys. BoardSegmentState wire discriminators documented.
- applyState (lightweight recall) extended to branch pedals + routing modes.
- Unknown pedal types skipped on load, including inside branches.
- Tests: parallel / stereo / mergeToMono file round-trips, legacy decode,
  unknown-pedal-in-branch, branch-param recall. Suite 116/116; demo builds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 17:12:46 -07:00
josh 211b9da438 Merge stereo-routing: mono→stereo PedalBoard routing
Width propagation (mono/stereo, capped at 2), widener + stereo-native
pedals, auto-stereoize, splitStereo with four route modes, width-aware
output, SwiftUI views, preset registration, and a macOS demo .stereo mode.
2026-06-21 16:59:54 -07:00
josh d5b17b7663 Update stereo-routing doc: demo .stereo mode done
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 16:57:18 -07:00
josh 5522109689 Add .stereo mode to the macOS demo app
New DemoMode.stereo: Overdrive → splitStereo(Delay | Ping-Pong) →
collectStereo, finalized to stereo output. DemoRootView renders the
pre-split board + StereoWidthBadge above StereoSplitSectionView, so the
four StereoRoute modes are selectable live. No new files / no .pbxproj
change — the demo already links LyrebirdShoeGazeUI. BUILD SUCCEEDED.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 16:57:09 -07:00
josh 30e96b8ee1 Add stereo-routing SwiftUI views
- StereoRouteControlView: 4-way StereoRoute segmented selector + L/R/DRY
  source LEDs, bound to StereoSplitSection.route (observes collector gains).
- StereoSplitSectionView: route control + L/R branch pedal rows.
- StereoWidthBadge: MONO/STEREO pill from PedalBoard.width.
- Expose StereoSplitSection.collector publicly for UI observation.
- Document UI + preset scope in stereo-routing-design.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 16:53:55 -07:00
josh 02cee9a358 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>
2026-06-21 16:50:26 -07:00
josh f89229282f 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>
2026-06-21 16:48:25 -07:00
josh ca4cabb42f Merge pedal-colors: enclosure tints for the new pedals 2026-06-21 15:54:37 -07:00
josh 1ecacbfc21 Add enclosure tints for the four new pedals
Mu-Tron plum, Auto-Wah gold, Feedback Delay tape sepia, Multi-Tap Delay
cyan — distinct from the existing eight so they no longer fall through to
the default steel gray.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 15:54:37 -07:00
josh 79e200a61e Merge pedal-footer-symmetry: Level | bypass | Mix footer 2026-06-21 15:53:57 -07:00
josh b564b154a0 Flank bypass switch with Level and Mix for a symmetric pedal footer
Move the Mix knob out of the knob grid into the bottom control row, to the
right of the bypass footswitch, mirroring Level on the left. Every pedal
now shares a consistent knob-switch-knob footer. The knob grid drops the
trailing Mix and Level entries (was just Level).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 15:53:57 -07:00
josh 393fb47a78 Add .gitignore for SwiftPM build and Xcode user state
Ignores .build/, .swiftpm/, xcuserdata, and .DS_Store. Package.resolved
stays tracked to pin the Lyrebird dependency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 15:48:01 -07:00
josh 9cf431d8ee Merge envelope-and-delay-pedals: 4 pedals + segmented switch control 2026-06-21 15:40:29 -07:00
josh cb28ea8c7d Add segmented pedal switch control; Mu-Tron sweep + mode switches
Introduces a discrete multi-position switch control alongside the rotary
knobs, and uses it to expose the Mu-Tron's sweep direction and filter mode.

- PedalSwitch: UI-agnostic descriptor (label, node, ordered options of
  caption + value), parallel to PedalKnob. Two options make a two-state
  switch, three a three-state switch.
- PedalSwitchView: segmented SwiftUI control bound to a UIParamNode. Lit
  segment is the option nearest the node's value; tapping writes that
  option's value. Serves both two- and three-state switches.
- Pedal gains an effectSwitches hook; PedalView renders a switch row
  between the knob grid and the footswitch.
- MuTronPedal: sweep direction is now a two-state switch (Down/Up) and
  filter mode a three-state switch (LP/BP/HP). The effect builds six
  MuTronIII instances (three modes x two directions) selected by a nested
  Select so every filter state stays warmed for click-free switching.
- Presets: PedalState gains a backward-compatible switchValues array
  (decodes to empty for older presets); captureState/applyState persist
  and restore switch positions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 15:40:26 -07:00
josh c28e7cac90 Add four pedals: Mu-Tron, Auto-Wah, Feedback Delay, Multi-Tap Delay
Two envelope filters and two delays, registered in PedalRegistry and
showcased on demo Board 3.

- Mu-Tron: wraps the MuTronIII generator; three parallel LP/BP/HP
  instances switched live by a Select on the mode knob so filter state
  stays warmed across mode changes. Knobs: Mode, Sensitivity, Resonance.
- Auto-Wah: explicit amplitude-tracking chain — AmplitudeFollower scaled
  by sensitivity, clamped, mapped through LinExp to a swept SVF bandpass.
  Knobs: Sensitivity, Resonance, Range.
- Feedback Delay: DelayLineFeedback (cubic) into an RBJ lowpass for a
  darker, tape-style multi-repeat echo. Knobs: Time, Feedback, Tone.
- Multi-Tap Delay: three non-feedback DelayLine taps summed, per-tap
  volume folded into each tap's mul. Six knobs in two rows of three.

Bumps the Lyrebird dependency to 1.2.0 for the MuTronIII/SVF generators.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 15:07:34 -07:00
josh 6f55615d7b 1.0 release 2026-06-21 12:25:18 -07:00
josh b7973cba9a Initial commit 2026-06-21 18:04:09 +00:00