Release 2.0.0: metronome, rig mute + shortcuts, set-list ordering, per-rig persistence

- Visual metronome tempo indicator (pendulum playhead) replacing the flashing LED
- Rig Mute (Cmd-Z) hard-silence, distinct from Bypass Rig; wired to header, board menu, MIDI
- Keyboard shortcuts: Cmd-1..9 board switch, Cmd-Shift-1..0 set-list rig load, Cmd-Z mute
  (macOS native menus + iOS/iPadOS hardware keyboards)
- Rig set-list ordering: drag or Move Up/Down in the picker; order saved and archive-portable
- Persist tempo, input selection, and engine I/O with a rig (I/O applied via opt-in
  applyChannelLayout, not forced on load)
- Fix archive import colliding set-list positions with existing rigs
- Remove ShoeGazeDemo / ShoeGazeiOSDemo apps and projects; keep the two Builder apps
- Bump marketing version to 2.0.0 on both Builder projects; pin Lyrebird 1.2.3
- Add CHANGELOG.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 12:30:45 -07:00
parent 4b0cf65a2b
commit e051521c04
52 changed files with 991 additions and 2166 deletions
+20
View File
@@ -43,6 +43,23 @@ public struct HelpView: View {
"Bypass Rig compares your sound with and without the whole pedalboard.",
]
)
topicSection(
icon: "keyboard",
title: "Keyboard Shortcuts",
intro: "With a hardware keyboard, these speed up live use.",
steps: [
"⌘1–⌘9 switch to (and solo) boards 1–9 — the fastest way to change board live.",
"⌘⇧1–⌘⇧9 and ⌘⇧0 load set-list rigs 1–10 in the order shown in the Rigs list — "
+ "build a set list by reordering rigs, then step through them hands-free.",
"⌘Z mutes and unmutes the whole rig — a hard silence of all output (distinct "
+ "from Bypass Rig, which passes your dry signal through).",
"On macOS the menu bar adds: ⌘N New Rig, ⌘S Save Rig, ⌘E Export Archive, "
+ "⌘I Import Archive, ⌘B Add Board, ⇧⌘R Start / Stop Recording, ⌘? Help, and "
+ "Rigs ▸ Set List (the ⌘⇧ rig slots).",
"The board and set-list shortcuts and ⌘Z also work on iOS / iPadOS with a "
+ "hardware keyboard attached.",
]
)
topicSection(
icon: "waveform",
title: "Choosing an Input",
@@ -64,6 +81,9 @@ public struct HelpView: View {
+ "crossfade time; each board has S (solo) and B (bypass).",
"The Rigs sidebar lists saved rigs, with New, Save, Save As, Duplicate, Rename, "
+ "Delete, and Erase All.",
"Reorder rigs into a set list by dragging a row, or via each rig's Move Up / "
+ "Move Down menu. The order is saved and travels with an exported archive; "
+ "the top ten map to ⌘⇧1–⌘⇧0.",
]
)
topicSection(
@@ -16,4 +16,8 @@ public extension Notification.Name {
/// Create a new, named, empty rig and make it current.
static let shoeGazeNewRig: Notification.Name = Notification.Name("net.realizedsound.shoegaze.newRig")
/// Load the set-list rig at a zero-based slot index (0…9, mapped to ⌘⇧1…⌘⇧0 on macOS). The
/// slot index is posted as the notification's `object` (an `NSNumber`/`Int`).
static let shoeGazeLoadRigSlot: Notification.Name = Notification.Name("net.realizedsound.shoegaze.loadRigSlot")
}
@@ -149,7 +149,20 @@ struct RigLibrarySidebarView: View {
.contentShape(Rectangle())
}
.buttonStyle(.plain)
// Drag the row onto another to reorder; dropping inserts it just before the target. Works
// on macOS (mouse drag) and iPad (long-press drag); taps still select.
.draggable(entry.id.uuidString)
.dropDestination(for: String.self) { droppedIDs, _ in
guard let first: String = droppedIDs.first else { return false }
moveDragged(first, onto: entry)
return true
}
.contextMenu {
Button("Move Up") { store.moveUp(entry) }
.disabled(isFirst(entry))
Button("Move Down") { store.moveDown(entry) }
.disabled(isLast(entry))
Divider()
Button("Rename…") { onRename(entry) }
Button("Duplicate…") { onDuplicate(entry) }
// Encoding a fully-concrete RigEntry to JSON does not fail in practice; on the
@@ -167,6 +180,28 @@ struct RigLibrarySidebarView: View {
}
}
// MARK: - Reorder helpers
private func isFirst(_ entry: RigEntry) -> Bool {
store.entries.first?.id == entry.id
}
private func isLast(_ entry: RigEntry) -> Bool {
store.entries.last?.id == entry.id
}
/// Moves the dragged entry (by id string) to sit just before `target` in the set list.
private func moveDragged(_ draggedIDString: String, onto target: RigEntry) {
guard let draggedID: UUID = UUID(uuidString: draggedIDString), draggedID != target.id else { return }
var order: [UUID] = store.entries.map(\.id)
guard let from: Int = order.firstIndex(of: draggedID) else { return }
order.remove(at: from)
// Target's index in the post-removal array; inserting there drops the dragged row before it.
guard let to: Int = order.firstIndex(of: target.id) else { return }
order.insert(draggedID, at: to)
store.applyOrder(order)
}
// MARK: - Action bar
private var actionBar: some View {
@@ -65,6 +65,9 @@ public struct ShoeGazeBuilderView: View {
private static let maxCrossfadeSeconds: Double = 10.0
/// Highest board reachable via a ⌘-number switch shortcut.
private static let maxBoardShortcuts: Int = 9
/// The number of set-list rigs reachable by ⌘⇧1…⌘⇧0 (the top ten).
private static let maxRigShortcuts: Int = 10
/// Default filename offered when exporting the whole library as an archive.
private static let defaultArchiveFileName: String = "ShoeGaze Library"
/// Extra width reserved for the rig-library sidebar on top of the builder's minimum width.
@@ -311,6 +314,11 @@ public struct ShoeGazeBuilderView: View {
.onReceive(NotificationCenter.default.publisher(for: .shoeGazeNewRig)) { _ in
promptNewRig()
}
.onReceive(NotificationCenter.default.publisher(for: .shoeGazeLoadRigSlot)) { note in
if let index: Int = note.object as? Int {
loadRigSlot(index)
}
}
.confirmationDialog(
"Clear all boards?",
isPresented: $showClearDialog,
@@ -578,14 +586,7 @@ public struct ShoeGazeBuilderView: View {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
rigBypassButton
// fixedSize stops the switch Toggle from expanding to fill the row (which pushed
// the following controls far to the right, under the scope).
Toggle("Mute rig", isOn: Binding(
get: { shoeGaze.tunerMutesRig },
set: { shoeGaze.tunerMutesRig = $0 }
))
.toggleStyle(.switch)
.fixedSize()
rigMuteButton
helpButton
if let midi: MIDIController = midi {
MIDIIndicatorView(controller: midi) { showMIDISheet = true }
@@ -942,6 +943,7 @@ public struct ShoeGazeBuilderView: View {
}
helpButton
rigBypassButton
rigMuteButton
EngineConfigView(
shoeGaze: shoeGaze,
hardwareSampleRate: hardwareSampleRate,
@@ -951,12 +953,13 @@ public struct ShoeGazeBuilderView: View {
.frame(height: TempoView.enabledHeight)
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
// Mute-rig-while-tuning toggle sits to the left of the input selector.
Toggle("Mute rig", isOn: Binding(
// Whether engaging the tuner silences the rig; sits left of the input selector.
Toggle("Mute while tuning", isOn: Binding(
get: { shoeGaze.tunerMutesRig },
set: { shoeGaze.tunerMutesRig = $0 }
))
.toggleStyle(.switch)
.fixedSize()
Text("Input:")
.font(.subheadline)
@@ -1010,6 +1013,22 @@ public struct ShoeGazeBuilderView: View {
.help("Bypass the entire rig — every board passes your dry input straight through")
}
/// Global rig mute — a hard gate to silence the whole output (distinct from Bypass, which
/// passes the dry signal through). Lit when engaged. A live performance panic/silence control.
private var rigMuteButton: some View {
let muted: Bool = shoeGaze.rigMuted
return Button {
shoeGaze.toggleRigMuted()
} label: {
Label(muted ? "Rig Muted" : "Mute Rig",
systemImage: muted ? "speaker.slash.fill" : "speaker.wave.2.fill")
.font(.subheadline)
}
.buttonStyle(.bordered)
.tint(muted ? .red : .gray)
.help("Mute the entire rig output — silences all sound")
}
// MARK: - Board area
private var boardArea: some View {
@@ -1213,19 +1232,40 @@ public struct ShoeGazeBuilderView: View {
// MARK: - Board-switch shortcuts
/// Hidden ⌘1…⌘9 buttons that solo (live-switch to) the matching board and select it as the
/// edit target. Kept at zero opacity so the shortcuts stay active without showing chrome.
/// edit target, plus ⌘M to toggle the rig mute. Kept at zero opacity so the shortcuts stay
/// active without showing chrome.
private var boardSwitchShortcuts: some View {
ZStack {
ForEach(0 ..< min(ShoeGazeBuilderView.maxBoardShortcuts, shoeGaze.boards.count), id: \.self) { index in
Button("") { switchToBoard(index) }
// Titles are invisible (the ZStack is opacity 0) but feed the iPadOS ⌘-hold
// discoverability HUD, so the shortcut reads as a named command there.
Button("Switch to Board \(index + 1)") { switchToBoard(index) }
.keyboardShortcut(KeyEquivalent(Character("\(index + 1)")), modifiers: .command)
}
// ⌘Z toggles rig mute on iOS/iPadOS hardware keyboards. On macOS the Board menu item
// owns the ⌘Z equivalent, so it is not also bound here (a double-bound event is ambiguous).
#if !os(macOS)
Button("Mute / Unmute Rig") { shoeGaze.toggleRigMuted() }
.keyboardShortcut("z", modifiers: .command)
// ⌘⇧1…⌘⇧9 + ⌘⇧0 load set-list rigs 1…10. macOS binds these via the Rigs ▸ Set List menu
// instead, so they are not also bound here.
ForEach(0 ..< ShoeGazeBuilderView.maxRigShortcuts, id: \.self) { slot in
Button("Load Set List Rig \(slot + 1)") { loadRigSlot(slot) }
.keyboardShortcut(ShoeGazeBuilderView.rigSlotKey(slot), modifiers: [.command, .shift])
}
#endif
}
.opacity(0)
.frame(width: 0, height: 0)
.accessibilityHidden(true)
}
/// The key equivalent for set-list slot `slot` (0-based): slots 0…8 map to `1`…`9`, slot 9 to
/// `0` — matching the ⌘⇧1…⌘⇧0 physical row.
private static func rigSlotKey(_ slot: Int) -> KeyEquivalent {
KeyEquivalent(Character(slot < 9 ? "\(slot + 1)" : "0"))
}
/// Solos board `index` (a live amp-channel-style switch) and makes it the edit target.
private func switchToBoard(_ index: Int) {
guard index < shoeGaze.boards.count else { return }
@@ -1315,6 +1355,16 @@ public struct ShoeGazeBuilderView: View {
transportTick.toggle()
}
/// Loads the set-list rig at zero-based `index` (the library's manual order), if one exists.
/// Backs the ⌘⇧1…⌘⇧0 shortcuts and the macOS Rigs ▸ Set List menu. Routes through
/// ``requestLoad(_:)`` so the unsaved-changes prompt and no-op-if-current behaviour apply.
///
/// - Parameter index: Zero-based slot index (0…9).
private func loadRigSlot(_ index: Int) {
guard index >= 0, index < library.entries.count else { return }
requestLoad(library.entries[index])
}
/// Switches to `entry`, prompting to save first when the current rig has unsaved changes.
/// No-op when `entry` is already the current rig.
private func requestLoad(_ entry: RigEntry) {
+82 -12
View File
@@ -19,13 +19,32 @@ public struct TempoView: View {
// MARK: - Constants
private static let pollIntervalNanoseconds: UInt64 = 33_333_333 // ~30 Hz
/// Fraction of each beat the LED stays lit — a short flash, not a 50% duty-cycle blink.
private static let flashDutyCycle: Double = 0.15
private static let minBpm: Double = 30.0
private static let maxBpm: Double = 300.0
private static let bpmStep: Double = 1.0
private static let ledDiameter: CGFloat = 14
private static let rowSpacing: CGFloat = 10
// Metronome track: a dot swings wall-to-wall once per beat, pausing at each wall (the beat)
// so the eye can anticipate the hit. Pendulum easing comes for free from the cosine map.
private static let trackWidth: CGFloat = 150
private static let trackHeight: CGFloat = 16
private static let trackCornerRadius: CGFloat = 4
private static let trackBrightness: Double = 0.14
private static let trackBorderOpacity: Double = 0.35
private static let trackBorderWidth: CGFloat = 1
/// Vertical playhead sweeping horizontally across the track (Looper-style), full track height.
private static let lineWidth: CGFloat = 3
/// Playhead opacity floor at mid-swing; ramps to full at the walls so it fades as it travels
/// toward center and re-brightens into each beat.
private static let lineMinOpacity: Double = 0.25
/// Curve on the wall-proximity → brightness map; > 1 dims harder through the middle.
private static let brightnessFadeCurve: Double = 1.6
/// Soft glow drawn behind the playhead; its opacity peaks at the turnaround (on the beat).
private static let glowWidth: CGFloat = 16
private static let glowMaxOpacity: Double = 0.7
/// End-wall tick marks sit on the beat positions.
private static let wallTickWidth: CGFloat = 2
private static let wallTickOpacity: Double = 0.4
/// Fixed row height = the enabled (BPM/TAP-visible) height, so toggling doesn't shift layout.
static let enabledHeight: CGFloat = 34
@@ -34,7 +53,8 @@ public struct TempoView: View {
private let shoeGaze: ShoeGaze
@State private var displayedBpm: Double
@State private var ledOn: Bool = false
/// Continuous beat position, polled from the clock; drives the metronome dot.
@State private var beat: Double = 0.0
// MARK: - Init
@@ -57,7 +77,7 @@ public struct TempoView: View {
.help("Show the tempo indicator and enable tempo-synced controls")
if shoeGaze.tempoEnabled {
led
metronome
Text("\(Int(displayedBpm.rounded())) BPM")
.font(.system(size: 18, weight: .semibold, design: .rounded))
.foregroundStyle(Color.white)
@@ -84,9 +104,7 @@ public struct TempoView: View {
.frame(height: TempoView.enabledHeight)
.task(id: shoeGaze.tempoEnabled) {
while shoeGaze.tempoEnabled && !Task.isCancelled {
let beat: Double = shoeGaze.clock.currentBeat
let phase: Double = beat - beat.rounded(.down)
ledOn = phase < TempoView.flashDutyCycle
beat = shoeGaze.clock.currentBeat
displayedBpm = shoeGaze.clock.bpm
try? await Task.sleep(nanoseconds: TempoView.pollIntervalNanoseconds)
}
@@ -95,10 +113,62 @@ public struct TempoView: View {
// MARK: - Subviews
private var led: some View {
Circle()
.fill(ledOn ? Color.red : Color.red.opacity(0.15))
.frame(width: TempoView.ledDiameter, height: TempoView.ledDiameter)
/// Horizontal pendulum: the dot maps `beat` through a cosine so it eases to a stop at each
/// wall (an integer beat) and moves fastest at mid-swing — the wall pauses give the eye a
/// runway to anticipate the beat. `x01 = (1 − cos(π·swing)) / 2`, `swing = beat mod 2`, puts
/// the left wall on even beats and the right wall on odd beats (one wall hit per beat).
private var metronome: some View {
// Reduce beat mod 2 before the cosine so precision holds over a long session.
let swing: Double = beat.truncatingRemainder(dividingBy: 2)
let x01: Double = (1 - cos(.pi * swing)) / 2
// Proximity to a wall in [0, 1]: 1 at a wall (on the beat), 0 at mid-swing. The curve dims
// harder through the middle so the playhead visibly fades as it travels toward center.
let wallGlow: Double = pow(1 - 2 * min(x01, 1 - x01), TempoView.brightnessFadeCurve)
return ZStack(alignment: .leading) {
RoundedRectangle(cornerRadius: TempoView.trackCornerRadius)
.fill(Color(white: TempoView.trackBrightness))
.overlay(
RoundedRectangle(cornerRadius: TempoView.trackCornerRadius)
.strokeBorder(
Color.white.opacity(TempoView.trackBorderOpacity),
lineWidth: TempoView.trackBorderWidth
)
)
// Beat-position tick marks flush against each end wall.
.overlay(alignment: .leading) { wallTick }
.overlay(alignment: .trailing) { wallTick }
playhead(x01: x01, wallGlow: wallGlow)
}
.frame(width: TempoView.trackWidth, height: TempoView.trackHeight)
.clipShape(RoundedRectangle(cornerRadius: TempoView.trackCornerRadius))
}
private var wallTick: some View {
Rectangle()
.fill(Color.white.opacity(TempoView.wallTickOpacity))
.frame(width: TempoView.wallTickWidth)
}
private func playhead(x01: Double, wallGlow: Double) -> some View {
// Travel spans the track minus the line's own width so the playhead kisses each wall.
let travel: CGFloat = TempoView.trackWidth - TempoView.lineWidth
let x: CGFloat = CGFloat(x01) * travel
let lineOpacity: Double = TempoView.lineMinOpacity + (1 - TempoView.lineMinOpacity) * wallGlow
// Center glow + line share a leading-aligned box; offset positions the line's leading edge.
return ZStack {
Rectangle()
.fill(Color.red.opacity(TempoView.glowMaxOpacity * wallGlow))
.frame(width: TempoView.glowWidth, height: TempoView.trackHeight)
.blur(radius: TempoView.glowWidth / 3)
Rectangle()
.fill(Color.red.opacity(lineOpacity))
.frame(width: TempoView.lineWidth, height: TempoView.trackHeight)
}
.frame(width: TempoView.lineWidth, height: TempoView.trackHeight, alignment: .center)
.offset(x: x)
}
private var tapArea: some View {