Looper: per-track mute via the A/B/C/D dots
Each track player now runs through a smoothed per-track mute gate. Tapping a track dot selects it (as before); tapping the already-selected, recorded track toggles its mute (tapTrack). Muted dots dim and show a slash. Mutes clear on reset and don't survive a rebuild. Covered by tapTrackSelectsThenMutesRecordedTrack. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -530,6 +530,35 @@ struct LooperPedalTests {
|
||||
} }
|
||||
}
|
||||
|
||||
@Test func tapTrackSelectsThenMutesRecordedTrack() throws {
|
||||
let (engine, clock, pedal): (SynthesisEngine, LyrebirdClock, LooperPedal) =
|
||||
try makeQuantizedFixture(bpm: 120.0, sampleRate: 44100.0)
|
||||
withExtendedLifetime(engine) { withExtendedLifetime(clock) {
|
||||
pedal.clock = nil
|
||||
pedal.pressLoop() // record A
|
||||
pedal.pressLoop() // playing, A selected + has content
|
||||
pedal.pressLoop() // end auto-overdub, just playing
|
||||
#expect(pedal.selectedTrackIndex == 0)
|
||||
#expect(pedal.trackHasContent(0))
|
||||
#expect(!pedal.isTrackMuted(0))
|
||||
|
||||
// Second tap on the selected, recorded track A mutes it; third un-mutes.
|
||||
pedal.tapTrack(0)
|
||||
#expect(pedal.isTrackMuted(0), "tapping the selected recorded track mutes it")
|
||||
pedal.tapTrack(0)
|
||||
#expect(!pedal.isTrackMuted(0), "tapping again un-mutes it")
|
||||
|
||||
// Tapping a different track selects it (doesn't mute), leaving A audible.
|
||||
pedal.tapTrack(1)
|
||||
#expect(pedal.selectedTrackIndex == 1)
|
||||
#expect(!pedal.isTrackMuted(0))
|
||||
#expect(!pedal.isTrackMuted(1))
|
||||
|
||||
pedal.resetLoop()
|
||||
#expect(!pedal.isTrackMuted(0), "reset un-mutes all tracks")
|
||||
} }
|
||||
}
|
||||
|
||||
@Test func cycleSyncModeOscillatesThroughOptions() throws {
|
||||
let pedal: LooperPedal = LooperPedal()
|
||||
#expect(pedal.syncToBeat == 1.0) // Sync by default
|
||||
|
||||
Reference in New Issue
Block a user