Looper: MIDI-mappable Sync, cycling through the switch options
Add a looperSyncToggle PedalActionKind (dispatched to LooperPedal.cycleSyncMode) and a Sync row in the MIDI mapping sheet. A mapped switch/Program Change oscillates the control through its positions on each press, via a reusable PedalSwitch.nextValue(after:) that advances to the next option and wraps — so this generalises to any multi-position switch, not just the two-state Sync. Tests: cycleSyncModeOscillatesThroughOptions, pedalActionCyclesLooperSync. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -530,6 +530,15 @@ struct LooperPedalTests {
|
||||
} }
|
||||
}
|
||||
|
||||
@Test func cycleSyncModeOscillatesThroughOptions() throws {
|
||||
let pedal: LooperPedal = LooperPedal()
|
||||
#expect(pedal.syncToBeat == 1.0) // Sync by default
|
||||
pedal.cycleSyncMode()
|
||||
#expect(pedal.syncToBeat == 0.0, "cycle → Free")
|
||||
pedal.cycleSyncMode()
|
||||
#expect(pedal.syncToBeat == 1.0, "cycle wraps back → Sync")
|
||||
}
|
||||
|
||||
@Test func stopResumeAndCueStop() throws {
|
||||
let (engine, clock, pedal): (SynthesisEngine, LyrebirdClock, LooperPedal) =
|
||||
try makeQuantizedFixture(bpm: 120.0, sampleRate: 44100.0)
|
||||
|
||||
Reference in New Issue
Block a user