commit current state

This commit is contained in:
2026-06-22 15:40:23 -07:00
parent e36dc3a527
commit c6f567535b
14 changed files with 431 additions and 101 deletions
@@ -427,6 +427,44 @@ struct BoardEditAPITests {
#expect(hasNonSilentOutput(samples), "parallel board should render audio")
}
// MARK: - Engine reconfiguration
@Test func reconfigureEnginePreservesRigAndAppliesConfig() throws {
let (sg, engine, url, _): (ShoeGaze, SynthesisEngine, URL, PedalBoard) =
try makeRig(pedals: ["Overdrive", "Delay"])
defer { try? FileManager.default.removeItem(at: url) }
try sg.reconfigureEngine(sampleRate: 96_000, inputChannels: 0, outputChannels: 2)
#expect(engine.sampleRate == 96_000)
#expect(engine.numInputChannels == 0)
#expect(engine.numOutputChannels == 2)
#expect(sg.boards.count == 1)
#expect(names(sg.boards[0]) == ["Overdrive", "Delay"], "rig preserved across reconfigure")
let samples: [Float] = try render(engine, url)
#expect(hasNonSilentOutput(samples), "reconfigured rig should render")
}
@Test func reconfigureResetsOutOfRangeLiveInput() throws {
let (engine, url): (SynthesisEngine, URL) = makeNRTEngine(
duration: 0.1,
numInputChannels: 2,
numAudioBuses: 128
)
defer { try? FileManager.default.removeItem(at: url) }
let sg: ShoeGaze = ShoeGaze(engine: engine, inputSource: .liveInput(channel: 1))
let board: PedalBoard = try sg.addBoard()
try board.add(OverdrivePedal())
try sg.finalizeBoard(board)
// Drop to a single input channel — channel 1 no longer exists.
try sg.reconfigureEngine(sampleRate: 48_000, inputChannels: 1, outputChannels: 2)
#expect(sg.inputSource == .testLoop, "out-of-range live input should fall back to test loop")
#expect(engine.numInputChannels == 1)
}
// MARK: - Save / load round-trip on an edited board
@Test func overdriveDriveEightPersistsAcrossSaveAndReload() throws {