Add rig-wide output volume + hard mute, MIDI-mappable

Volume is a CC-mappable [0,1] gain applied after every board's output; mute
is a separate hard gate (not the existing dry bypass), togglable via
Program Change. Both are lagged to avoid clicks and fan out across all
boards from a single ShoeGaze-level setter.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-01 19:28:09 -07:00
parent d4664b3c1f
commit 75edf44b64
10 changed files with 230 additions and 11 deletions
@@ -165,6 +165,22 @@ struct MIDIControllerCCTests {
}
}
@Test func ccCanTargetRigVolume() throws {
let (controller, sg, _, url): (MIDIController, ShoeGaze, PedalBoard, URL) = try makeRig()
defer { try? FileManager.default.removeItem(at: url) }
withExtendedLifetime(sg) {
controller.armCCLearn(.rigVolume)
controller.ingestForTesting(.controlChange(channel: 0, controller: 40, value: 0)) // learn
controller.ingestForTesting(.controlChange(channel: 0, controller: 40, value: 127))
#expect(abs(sg.rigVolume - 1.0) < 1e-9, "CC 127 should drive rig volume to max")
controller.ingestForTesting(.controlChange(channel: 0, controller: 40, value: 0))
#expect(abs(sg.rigVolume - 0.0) < 1e-9, "CC 0 should drive rig volume to min")
controller.ingestForTesting(.controlChange(channel: 0, controller: 40, value: 64))
#expect(abs(sg.rigVolume - 64.0 / 127.0) < 1e-9, "CC 64 should map mid-range")
}
}
@Test func unboundCCIsIgnored() throws {
let (controller, sg, board, url): (MIDIController, ShoeGaze, PedalBoard, URL) = try makeRig()
defer { try? FileManager.default.removeItem(at: url) }