Commit Graph

22 Commits

Author SHA1 Message Date
josh 0d17ed260b Persist board across restarts + Clear button with save prompt
Persistence (macOS + iOS):
- RigStore autosaves the rig (rigData JSON) to Application Support and restores
  it on launch. App models restore-or-seed at init; macOS saves on terminate +
  resignActive, iOS saves on scenePhase leaving .active. The builder also
  autosaves after structural edits (add board/pedal, load, clear).

Clear (both platforms):
- A Clear button in the builder opens a confirmation dialog: Save & Clear /
  Clear Without Saving / Cancel. Clear removes all boards and seeds one fresh
  empty board, then autosaves. Save & Clear triggers the save mechanism and only
  clears once the save completes (cancelling the save leaves the rig intact).
- The rig-save exporter is now cross-platform (was iOS-only) so Save and the
  Save & Clear flow work on macOS too; macOS keeps its File-menu Load.

Tests: RigStore save/restore round-trip across instances; restore is a no-op
with no autosave. 186 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 18:54:03 -07:00
josh f29ab609bd Add Chorus, Sustainer, Ring Modulator pedals + pedal-info UI
Pedals (each registered, with PedalType static, enclosure color, palette order,
summary, and tests):
- Chorus: true-stereo widener (two anti-phase modulated delay lines), distinct
  from the mono-summed Modulation chorus.
- Sustainer: one-knob compressor (sustain drives threshold/ratio/makeup via
  LinLin) + tone low-pass.
- Ring Modulator: dry × tunable sine carrier.

Pedal-info UI:
- Pedal.summary (open var, overridden by all 21 pedals; mandatory going forward).
- PedalRegistry.summary(for:) for the picker.
- PedalPaletteView rows show the summary as a subtitle.
- PedalView gains an ⓘ button → PedalInfoView sheet showing the description and
  the effect controls (knobs/sliders/switches) with ranges/options — excludes
  the common Mix/Level/bypass.

Tests: per-pedal build/param-change/knob-list; every built-in pedal has a
non-empty summary; info excludes common controls. 183 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 18:05:30 -07:00
josh 5040ea1518 Rename Mu-Tron pedal to Mutant (de-trademark)
Rename the user-facing 'Mu-Tron' pedal to the non-proprietary 'Mutant':
displayName, registry key, PedalType.mutant, enclosure color, palette order,
and the class (MuTronPedal -> MutantPedal) + test file. The underlying Lyrebird
MuTronIII generator (and its Mode/Sweep types) keep their names — that's the
dependency's DSP type, not user-facing.

Note: displayName doubles as the rig-save key, so rigs saved with 'Mu-Tron'
won't match on load (acceptable pre-1.0; nothing released).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:00:02 -07:00
josh 21b9123a87 Replace stringly-typed pedal API with PedalType tokens
appendPedal(type: String, to:) is replaced by appendPedal(_ kind: PedalType, to:),
where PedalType is an extensible RawRepresentable struct with static members for
the built-in pedals:

    try shoeGaze.appendPedal(.overdrive, to: board)

Discoverable/autocompleting call sites, still open for custom pedals
(PedalType("My Pedal")). rawValue == the pedal's displayName, so PedalRegistry
and the rig JSON format are unchanged — saved rigs load exactly as before.

Named PedalType (not PedalKind) to avoid colliding with Lyrebird's score-notation
PedalKind enum, which is visible when both modules are imported. The UI palette
wraps its registry-key strings as PedalType(key); demos/tests use the static
members. PedalRegistry.makePedal(type:) stays string-keyed as the serialization
boundary used by loadRig.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:34:45 -07:00
josh 475dd392e6 Fix iOS Load file picker not opening
Five presentation modifiers (.sheet, .alert, two .fileImporter, .fileExporter)
were stacked on the builder's root view. SwiftUI reliably drives only one
presentation per view node, so adding the Boards .sheet swallowed the iOS rig
Load importer — the Load button toggled its flag but no picker appeared. Move
each presentation onto its own Color.clear background anchor so they no longer
collide.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 08:07:37 -07:00
josh 6ad813601f Review fixes: reindex activeBoardIndex; safer live-input rebuild
- moveBoard/removeBoard now keep activeBoardIndex pointing at the soloed board
  (track by identity on move; shift down or clear on remove), so the Solo
  highlight no longer lights the wrong cell after reorder or delete.
- rebuildWithLiveInput snapshots the rig before any teardown and aborts if the
  snapshot fails, instead of tearing down then seeding a fallback (no silent
  rig loss). The engine-already-has-input early return now also persists the
  live-input selection, via a shared selectLiveInputAndPersist helper.
- Test: activeBoardIndex tracks reorder and removal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 21:22:44 -07:00
josh 652a5a76ca Default iOS builder to one input channel
Construct the iOS engine with one input channel by default so live input is
available immediately and the In: stepper reads 1. Trade-off: iOS prompts for
microphone access at the first Start even while input defaults to test loop.
The permission-gated enableLiveInput() rebuild stays in place for any future
input-less configuration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 21:10:13 -07:00
josh 705b4ed534 iOS live input via permission-gated engine rebuild
Live input on iOS needs an input channel, but constructing the engine with one
up-front makes iOS prompt for the microphone at the first Start even in
test-loop mode. Instead the engine starts input-less (no prompt) and is rebuilt
on demand:

- ShoeGazeBuilderView gains an optional onEnableLiveInput hook. When the user
  picks live input but the engine has no input channel, the picker offers a
  "Live Input" option that calls the hook; the input binding routes there too.
  On macOS (engine already has an input channel) the hook is nil and live input
  is selected directly.
- The iOS app model implements the hook: request mic access, then on grant
  snapshot the rig (rigData), stop + teardown the engine, rebuild it with one
  input channel, restore the rig (loadRig), and select live input. The new
  ShoeGaze is published so the @Observable host view re-binds.
- Input persistence restores live on relaunch: a saved live choice with the mic
  already authorised triggers the same rebuild silently (no prompt).

Test: a rig captured on a 0-input engine restores onto a freshly built 1-input
engine and live input is then selectable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 20:52:11 -07:00
josh 4627b3b800 Boards sheet, ⌘1–9 switching, unified player bar, input persistence
Boards sheet (BoardsSheetView): rename, drag-reorder, swipe-delete, plus
per-board enable/solo/level and a Solo/Blend + crossfade header. Opened from a
"Boards…" button in the builder; presented with medium/large detents on iOS.
Makes ShoeGaze.moveBoard public to back the reorder.

Keyboard switching: hidden ⌘1…⌘9 buttons in the builder solo (live-switch to)
the matching board and select it as the edit target.

Unified player: ShoeGazeView drops its bespoke Active picker + crossfade field
and hosts the shared BoardBarView, matching the builder.

Input persistence: the builder saves the input choice (test loop vs live
channel) to UserDefaults and restores it on appear. With no saved choice it
defaults to live input when the mic is already authorised and an input channel
exists, else stays on the test loop. The iOS builder now opens one input
channel so live input is actually available there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 20:38:43 -07:00
josh c25d783b71 Lock iOS builder + demo to iPad-only landscape
The board bar and scope/CPU layout already flow to iOS via the shared
ShoeGazeBuilderView. Restrict both iOS apps to iPad (TARGETED_DEVICE_FAMILY=2),
landscape-only orientations, and UIRequiresFullScreen so the wide builder
layout always has the room it needs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 17:25:16 -07:00
josh cdac587454 update signing 2026-06-23 13:02:07 -07:00
josh 372494aae4 Add lyrebird app icon to all four ShoeGaze projects
Add an AppIcon asset catalog to ShoeGazeBuilder, ShoeGazeDemo,
ShoeGazeiOSDemo, and ShoeGazeBuilderiOS, wired via
ASSETCATALOG_COMPILER_APPICON_NAME. macOS apps use the full 16–512
@1x/@2x icon set with the framed rounded-tile artwork; iOS apps use a
single 1024 universal icon with the white frame flood-filled to a
full-bleed teal so it reads correctly under the iOS corner mask.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 09:59:42 -07:00
josh 9ebcbd4027 Set stable signing team on Demo, iOS Demo, and iOS Builder projects
ShoeGazeBuilder already carries the development team; the other three signed
ad-hoc (DEVELOPMENT_TEAM = ""), so every rebuild produced a new code hash and
TCC logged a fresh microphone permission row. Set DEVELOPMENT_TEAM =
HE5VJFE9E4 on all three so rebuilds reuse one signing identity and stop
stacking duplicate privacy entries.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 09:42:26 -07:00
josh 46e075fb8c Add live-input mic permission, audio-input entitlement, and engine-config review fixes
Live input was silent on macOS because the apps ran under hardened runtime
without the microphone entitlement, so AUHAL input received silent zeros and
the OS never prompted. Fixes:

- Add com.apple.security.device.audio-input entitlement to the macOS Builder
  and Demo apps (CODE_SIGN_ENTITLEMENTS wired in both targets).
- Add MicrophonePermission helper (AVCaptureDevice.requestAccess) and gate
  live-input selection through it in the Builder view and Demo controller;
  deny falls back to the test loop with an explanatory alert.
- Fix ShoeGazeDemo inputChannels 6 -> 1 (built-in mics are mono; 6 made
  CoreAudio deliver silence).

Engine-config review fixes:
- installScopeTap now requires the engine stopped (precondition) and
  reconfigureEngine reinstalls the tap on every exit path via defer, so
  engine.scopeTap never points at a stale channel layout.
- EngineConfigView stops the engine on a post-start (iOS) sample-rate
  mismatch instead of running pitch-shifted, and surfaces non-mismatch
  start errors through the alert.
- Remove redundant installScopeTap call in the demo controller (ShoeGaze.init
  already installs it).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 09:36:35 -07:00
josh ed27ab166c add scope for debugging 2026-06-22 21:07:13 -07:00
josh c6f567535b commit current state 2026-06-22 15:40:23 -07:00
josh 499ab1310e Add recording UI to the builder apps (macOS menu + iOS controls)
Wires the existing ShoeGaze recording engine into the builder:

- macOS: a Record menu (Choose Recording Folder…; Start/Stop Recording,
  ⇧⌘R) in the app shell's AppDelegate. validateMenuItem gates Start on a
  chosen folder and flips the title; the title is also set directly in
  the toggle action so it never goes stale.
- iOS: an in-view recording row in ShoeGazeBuilderView — folder picker
  (.fileImporter with security-scoped access) + Record/Stop button,
  gated on a chosen folder.
- Both: a red REC indicator in the transport header bound to isRecording.

Reuses startRecording/stopRecording/recordingFolder/isRecording (already
covered by RecordingTests); no core or RT changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:20:51 -07:00
josh 8ffc1caa42 Fix plist copyright; move macOS Save/Load to the menu bar
- Info.plists: "Realized Sound" -> "realizedsound" in the copyright string
  (all four demo apps).
- macOS: Save/Load now live in a File menu (Save Rig… ⌘S, Load Rig… ⌘O)
  and a Board menu (Add Board ⌘B, Start ⌘R, Stop ⌘.) in the app shell's
  AppDelegate; the in-view Save…/Load… buttons and their NSPanel code are
  now iOS-only (#if !os(macOS)), with iOS keeping fileExporter/Importer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 09:39:06 -07:00
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 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 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