diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-04 14:38:04 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-04 14:38:04 +0100 |
| commit | af4b27dfb0862bc4a76d716dacd24acf73ee059a (patch) | |
| tree | 2d17b230ef69d6567b85e8bf31970e4490af1bad /assets/final/shaders/sdf_primitives.wgsl | |
| parent | 02336d13cbb5c3109583cd258696e88afe7cf9bb (diff) | |
feat(audio): Trigger pattern events individually for tempo scaling
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>
Diffstat (limited to 'assets/final/shaders/sdf_primitives.wgsl')
0 files changed, 0 insertions, 0 deletions
