summaryrefslogtreecommitdiff
path: root/src/test_demo.cc
AgeCommit message (Collapse)Author
25 hoursrefactor: Move platform files to src/platform/ subdirectoryskal
Reorganized platform windowing code into dedicated subdirectory for better organization and consistency with other subsystems (audio/, gpu/, 3d/). Changes: - Created src/platform/ directory - Moved src/platform.{h,cc} → src/platform/platform.{h,cc} - Updated 11 include paths: "platform.h" → "platform/platform.h" - src/main.cc, src/test_demo.cc - src/gpu/gpu.{h,cc} - src/platform/platform.cc (self-include) - 6 test files - Updated CMakeLists.txt PLATFORM_SOURCES variable Verification: ✓ All targets build successfully (demo64k, test_demo, test_platform) ✓ test_platform passes (70% coverage maintained) ✓ demo64k smoke test passed This completes the platform code reorganization side quest. No functional changes, purely organizational.
26 hoursfeat(test_demo): Add validation for command-line optionsskal
Adds error handling for unknown or invalid command-line options: - Unknown options (e.g., --invalid) print error and help, then exit(1) - Missing arguments (e.g., --resolution without WxH) print error and help - Invalid format (e.g., --resolution abc) print error and help Error handling: - Prints specific error message to stderr - Shows full help text for reference - Exits with status code 1 (error) - --help still exits with status code 0 (success) Examples of new behavior: $ test_demo --unknown Error: Unknown option '--unknown' [help text displayed] $ test_demo --resolution Error: --resolution requires an argument (e.g., 1024x768) [help text displayed] $ test_demo --resolution abc Error: Invalid resolution format 'abc' (expected WxH, e.g., 1024x768) [help text displayed] This prevents silent failures and helps users discover correct usage. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
26 hoursfeat(test_demo): Add beat_number column to fine-grained peak logskal
Adds beat_number as 4th column in fine-grained logging mode to enable easy correlation between frame-level data and beat boundaries. File format change: - Before: frame_number clock_time raw_peak - After: frame_number clock_time raw_peak beat_number Benefits: - Correlate frame-level peaks with specific beats - Filter or group data by beat in analysis scripts - Easier comparison between beat-aligned and fine-grained logs - Identify which frames belong to each beat interval Example output: 0 0.000000 0.850000 0 1 0.016667 0.845231 0 ... 30 0.500000 0.720000 1 31 0.516667 0.715234 1 This allows filtering like: awk '$4 == 0' peaks_fine.txt to extract all frames from beat 0. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
26 hoursfeat(test_demo): Add fine-grained peak logging at frame resolutionskal
Adds --log-peaks-fine option to log audio peaks at every frame (~60 Hz) instead of just at beat boundaries, enabling millisecond-resolution synchronization analysis. Features: - --log-peaks-fine flag for per-frame logging - Logs ~960 samples over 16 seconds (vs 32 for beat-aligned) - Header indicates logging mode (beat-aligned vs fine) - Frame number instead of beat number in fine mode - Updated gnuplot command (using column 2 for time) Use cases: - Millisecond-resolution synchronization debugging - Frame-level timing jitter detection - Audio envelope analysis (attack/decay characteristics) - Sub-beat artifact identification Example usage: build/test_demo --log-peaks peaks.txt --log-peaks-fine The fine mode provides approximately 16.67ms resolution (60 Hz) compared to 500ms resolution (beat boundaries at 120 BPM). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
26 hoursfeat(test_demo): Add audio/visual sync debug tool with tempo testingskal
Implements minimal standalone executable for debugging audio/visual synchronization and variable tempo system without full demo complexity. Key Features: - Simple drum beat (kick-snare) with crash landmarks at bars 3 and 7 - NOTE_A4 (440 Hz) reference tone at start of each bar for testing - Screen flash effect synchronized to audio peaks - 16 second duration (8 bars at 120 BPM) - Variable tempo mode (--tempo) alternating acceleration/deceleration - Peak logging (--log-peaks) for gnuplot visualization Command-line options: - --help: Show usage information - --fullscreen: Run in fullscreen mode - --resolution WxH: Set window resolution - --tempo: Enable tempo variation test (1.0x ↔ 1.5x and 1.0x ↔ 0.66x) - --log-peaks FILE: Export audio peaks with beat timing for analysis Files: - src/test_demo.cc: Main executable (~220 lines) - assets/test_demo.track: Drum pattern with NOTE_A4 - assets/test_demo.seq: Visual timeline (FlashEffect) - test_demo_README.md: Comprehensive documentation Build: cmake --build build --target test_demo Usage: build/test_demo [--help] [--tempo] [--log-peaks peaks.txt] Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>