summaryrefslogtreecommitdiff
path: root/src/tests/test_tracker.cc
AgeCommit message (Collapse)Author
31 hoursfeat(audio): Trigger pattern events individually for tempo scalingskal
Refactored tracker system to trigger individual events as separate voices instead of compositing patterns into single spectrograms. This enables notes within patterns to respect tempo scaling dynamically. Key Changes: - Added ActivePattern tracking with start_music_time and next_event_idx - Individual events trigger when their beat time is reached - Elapsed beats calculated dynamically: (music_time - start_time) / beat_duration - Removed pattern compositing logic (paste_spectrogram) - Each note now triggers as separate voice with volume/pan parameters Behavior: - Tempo scaling (via music_time) now affects note spacing within patterns - At 2.0x tempo: patterns trigger 2x faster AND notes within play 2x faster - At 0.5x tempo: patterns trigger 2x slower AND notes within play 2x slower Testing: - Updated test_tracker to verify event-based triggering at specific beat times - All 17 tests pass (100%) - WAV dump confirms tempo scaling works correctly: * 0-10s: steady 1.00x tempo * 10-15s: acceleration to 2.00x tempo * 15-20s: reset to 1.00x tempo * 20-25s: deceleration to 0.50x tempo * 25s+: return to normal Result: Music time advances at variable rates (61.24s in 60s physical time), and notes within patterns correctly accelerate/decelerate with tempo changes. handoff(Claude): Tempo scaling now affects notes within patterns Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
32 hoursfeat(audio): Simplified demo track with tempo scaling testsskal
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>
2 daysrefactor: Task #20 - Platform & Code Hygieneskal
- Consolidated all WebGPU shims and platform-specific logic into src/platform.h. - Refactored platform_init to return PlatformState by value and platform_poll to automatically refresh time and aspect_ratio. - Removed STL dependencies (std::map, std::vector, std::string) from AssetManager and Procedural subsystems. - Fixed Windows cross-compilation by adjusting include paths and linker flags in CMakeLists.txt and updating build_win.sh. - Removed redundant direct inclusions of GLFW/glfw3.h and WebGPU headers across the project. - Applied clang-format and updated documentation. handoff(Gemini): Completed Task #20 and 20.1. Platform abstraction is now unified, and core paths are STL-free. Windows build is stable.
3 daysfeat: Finalize tracker asset-sample integration with unified pasting strategyskal
3 daysfeat: Complete audio tracker system integration and testsskal