From 6375468ea8d48a57f44e2d8bffd948e6a87ead89 Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 4 Feb 2026 13:48:44 +0100 Subject: feat(audio): Simplified demo track with tempo scaling tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created debuggable drum beat track that tests variable tempo system with clear acceleration and deceleration phases. Music Track Changes (assets/music.track): - Simplified to clear drum patterns (kick, snare, hi-hat, crash) - Light kick syncopation for musicality - Regular crash accents every 4 seconds - Hi-hat stress on beats for clarity - Phase 1 (0-10s): Steady beat at 1.0x tempo - Phase 2 (10-16s): Acceleration test (1.0x → 2.0x, then reset to 1.0x) - Phase 3 (16-20s): Denser patterns after reset (kick_dense, snare_dense) - Phase 4 (20-26s): Slow-down test (1.0x → 0.5x, then reset to 1.0x) - Phase 5 (26-30s): Return to normal tempo - Phase 6 (30s+): Add bass line and E minor melody Tempo Control (src/main.cc): - Implemented phase-based tempo scaling logic - Phase 1 (0-10s physical): tempo = 1.0 (steady) - Phase 2 (10-15s physical): tempo = 1.0 → 2.0 (acceleration) - Phase 3 (15-20s physical): tempo = 1.0 (reset trick) - Phase 4 (20-25s physical): tempo = 1.0 → 0.5 (deceleration) - Phase 5 (25s+ physical): tempo = 1.0 (reset trick) - Added debug output showing tempo changes (!STRIP_ALL) Test Updates (src/tests/test_tracker.cc): - Updated voice count assertions to match new track (3 → 4 voices) - New track triggers 4 patterns at t=0: crash, kick, snare, hi-hat Results: ✓ All 16 tests passing (100%) ✓ Clear, debuggable drum patterns ✓ Tests both acceleration and deceleration reset tricks ✓ Musical: E minor bass and melody after 30s ✓ Debug output shows tempo scaling in action handoff(Claude): Tempo scaling demo track ready for testing Co-Authored-By: Claude Sonnet 4.5 --- src/tests/test_tracker.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/tests/test_tracker.cc') diff --git a/src/tests/test_tracker.cc b/src/tests/test_tracker.cc index 2a9239c..ea1debd 100644 --- a/src/tests/test_tracker.cc +++ b/src/tests/test_tracker.cc @@ -27,13 +27,13 @@ void test_tracker_pattern_triggering() { // Test 1: Trigger patterns at 0.0f tracker_update(0.0f); printf("Actual active voice count: %d\n", synth_get_active_voice_count()); - // Expect 3 voices (one for each pattern triggered at 0.0f: drum_loop, - // hihat_roll, em_melody) - assert(synth_get_active_voice_count() == 3); + // Expect 4 voices (one for each pattern triggered at 0.0f: + // crash, kick_basic, snare_basic, hihat_stressed) + assert(synth_get_active_voice_count() == 4); // Test 2: Advance time slightly tracker_update(0.1f); - assert(synth_get_active_voice_count() == 3); + assert(synth_get_active_voice_count() == 4); // Test 3: Advance further, no new triggers until 4.0f tracker_update(3.0f); -- cgit v1.2.3