summaryrefslogtreecommitdiff
path: root/scripts/gen_spectrograms.sh
AgeCommit message (Collapse)Author
24 hoursfeat(audio): Add RMS normalization to spectool for consistent sample loudnessskal
IMPLEMENTATION: - Added --normalize flag to spectool analyze command - Default target RMS: 0.15 (customizable via --normalize [rms]) - Two-pass processing: load all PCM → calculate RMS/peak → normalize → DCT - Peak-limiting safety: prevents clipping by limiting scale factor if peak > 1.0 - Updated gen_spectrograms.sh to use --normalize by default ALGORITHM: 1. Calculate original RMS and peak of input audio 2. Compute scale factor to reach target RMS (default 0.15) 3. Check if scaled peak would exceed 1.0 (after windowing + IDCT) 4. If yes, reduce scale factor to keep peak ≤ 1.0 (prevents clipping) 5. Apply scale factor to all PCM samples before windowing/DCT RESULTS: Before normalization: - RMS range: 0.054 - 0.248 (4.6x variation, ~13 dB) - Some peaks > 1.0 (clipping) After normalization: - RMS range: 0.049 - 0.097 (2.0x variation, ~6 dB) ✅ 2.3x improvement - All peaks < 1.0 (no clipping) ✅ SAMPLES REGENERATED: - All 14 .spec files regenerated with normalization - High dynamic range samples (SNARE_808, CRASH_DMX, HIHAT_CLOSED_DMX) were peak-limited to prevent clipping - Consistent loudness across all drum and bass samples GITIGNORE CHANGE: - Removed *.spec from .gitignore to track normalized spectrograms - This ensures reproducibility and prevents drift from source files handoff(Claude): RMS normalization implemented and working. All samples now have consistent loudness with no clipping.
4 daysfeat(assets): Add new drum samples and improve conversion scriptskal
Created a new script, scripts/gen_spectrograms.sh, to robustly convert all audio files in assets/originals to .spec format. The new script is more portable and provides better feedback. Added the newly generated drum and bass samples to the asset list, organizing them by type for clarity. This completes the requested sub-task.