diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-04 13:48:44 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-04 13:48:44 +0100 |
| commit | 6375468ea8d48a57f44e2d8bffd948e6a87ead89 (patch) | |
| tree | df300c446cc24648c02206778c0e0bb0418613b5 /src/tests | |
| parent | 645b396ef9509257a896f0df5610e846f54b79a5 (diff) | |
feat(audio): Simplified demo track with tempo scaling tests
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 <noreply@anthropic.com>
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/test_tracker.cc | 8 |
1 files changed, 4 insertions, 4 deletions
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); |
