diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-04 16:23:29 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-04 16:23:29 +0100 |
| commit | d94e8ca1df4f6cf366afd33be43a7eed8d766560 (patch) | |
| tree | bda3e4c605b91949e632107474b19ed46c5ff359 /cmake | |
| parent | 77eb218e7c33676da19a695b8307149a2f8ebc13 (diff) | |
fix(audio): Render audio in small chunks to fix timing gaps
Fixed issue where drum patterns had silence gaps between cycles. The problem
was that audio_render_ahead was rendering audio in large chunks (up to 200ms),
causing the synth internal time to become desynchronized from tracker events.
Problem:
- audio_render_ahead checked buffer fullness, then rendered large chunk
- First call: buffer empty, render 200ms, synth advances by 200ms
- Next 12 calls: buffer > 100ms, do not render, synth state frozen
- Call 13: buffer < 100ms, render more, but tracker triggered events in between
- Events triggered between render calls ended up at wrong synth time position
- Result: Silence gaps between patterns
Solution:
- Changed audio_render_ahead to render in small incremental chunks
- Chunk size: one frame worth of audio (~16.6ms @ 60fps)
- Loop until buffer reaches target lookahead (200ms)
- Synth now advances gradually, staying synchronized with tracker
Result: Synth time stays synchronized with tracker event timing, no gaps.
Testing: All 17 tests pass (100%)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'cmake')
0 files changed, 0 insertions, 0 deletions
