summaryrefslogtreecommitdiff
path: root/src/audio/synth.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-26 10:09:34 +0100
committerskal <pascal.massimino@gmail.com>2026-03-26 10:09:34 +0100
commit8c5e41724fdfc3be24e95f48ae4b2be616404074 (patch)
tree052d8512b43ff4d41af66d71f5fa8dc7de0f609a /src/audio/synth.h
parent26627e8b9fee3fb3b2ec6314fc5cf45620769fcb (diff)
fix(audio): P1-P3 fixes from audio code reviewHEADmain
P1 — correctness bugs: - tracker.cc: move delete[] loop before pool reset so guard condition is valid - audio_engine: replace tracker_reset() with tracker_init() in reset()/seek() so synth IDs are re-registered after synth_init() clears spectrogram slots - spectrogram_resource_manager: set spec.version in load_procedural() (was UB) P2 — minor bugs: - synth.cc: move pan clamp unconditionally before debug-only block - gen.cc: remove dead `freq` variable in generate_note_spectrogram() - tracker.cc: remove duplicate g_sample_synth_cache clear loop P3 — cleanup: - Replace hardcoded 32000.0f with RING_BUFFER_SAMPLE_RATE (5 sites) - audio.cc: extract clip_samples() helper, remove duplicated clip loops - audio_engine: inline update_silent(), remove no-op prewarm_for_time_range() - Remove stale comments: stdio.h include, NEW: labels, CACHING block, NOTE: - Move TODO(timing) drift notes from source to TODO.md handoff(Gemini): audio review implemented, 36/36 tests passing
Diffstat (limited to 'src/audio/synth.h')
-rw-r--r--src/audio/synth.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/audio/synth.h b/src/audio/synth.h
index e5a8197..d3bd70e 100644
--- a/src/audio/synth.h
+++ b/src/audio/synth.h
@@ -7,16 +7,6 @@
#include "dct.h"
#include <cstdint>
-// Based on tracker score analysis (see generated/music_data.cc)
-// Max simultaneous patterns: 5, recommended: 10 each
-//
-// CACHING IMPLEMENTATION (COMPLETED):
-// - All asset samples are registered ONCE in tracker_init()
-// - All generated notes are cached by parameters (freq, duration, etc.)
-// - Current track: 14 unique samples (8 assets + 6 generated notes)
-// - With caching: MAX_SPECTROGRAMS = 32 provides 2.3x headroom
-//
-// Memory cost: 32 slots × 48 bytes = 1.5KB (down from 12KB with 256 slots)
#define MAX_VOICES 48 // Per tracker_compiler: required=24, recommended=48
#define MAX_SPECTROGRAMS \
32 // Current track: 14 unique, 32 provides comfortable headroom