diff options
Diffstat (limited to 'doc/COMPLETED.md')
| -rw-r--r-- | doc/COMPLETED.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/COMPLETED.md b/doc/COMPLETED.md index 9b9f549..d72591f 100644 --- a/doc/COMPLETED.md +++ b/doc/COMPLETED.md @@ -33,9 +33,11 @@ Use `read @doc/archive/FILENAME.md` to access archived documents. - [x] **OLA-IDCT Synthesis — click-free .spec decoding** - **Goal**: Eliminate frame-boundary clicks in spectrogram→PCM synthesis. - - **Implementation**: Added v2 spectrogram format (`SPEC_VERSION_V2_OLA`). Synthesis uses Hann-windowed IDCT with 50% overlap-add (hop=256, overlap=256). Per-voice `overlap_buf[256]` accumulates the tail from the previous IDCT frame. V1 path (raw DCT-512) preserved for generated notes. Hann window precomputed at `synth_init()`. `SpecHeader.version` field propagated through `Spectrogram.version` to the voice's `ola_mode` flag at trigger time. + - **Implementation**: Added v2 spectrogram format (`SPEC_VERSION_V2_OLA`). Analysis uses Hann window (FDCT), synthesis uses IDCT-OLA with rectangular synthesis window (no synthesis window — Hann at 50% overlap satisfies w[n]+w[n+H]=1, giving perfect reconstruction). Hop=256, overlap=256. Per-voice `overlap_buf[256]` accumulates the tail from the previous IDCT frame. V1 path (raw DCT-512) preserved for generated notes. `SpecHeader.version` field propagated through `Spectrogram.version` to the voice's `ola_mode` flag at trigger time. - **Bug fix (2026-03-05)**: Two bugs prevented OLA from ever activating: (1) `SpectrogramResourceManager::load_asset()` never set `resource->spec.version` from `header->version` — all loaded assets got `version=0`, OLA path silently skipped. (2) `spectool analyze_audio()` used non-overlapping frames (`chunk_idx * DCT_SIZE` stride), `hamming_window_512`, and hardcoded `header.version = 1` — the OLA encoder was never implemented. Fixed both; `.spec` files regenerated. - - **Files**: `src/audio/spectrogram_resource_manager.cc`, `tools/spectool.cc`, `workspaces/main/music/*.spec` + - **Bug fix (2026-03-05)**: `synth.cc` incorrectly applied a Hann synthesis window post-IDCT (`tmp[j] *= g_hann[j]`), effectively squaring the window and preventing perfect reconstruction. Removed synthesis window and dead `g_hann` array. `spectool` and the test were already correct. + - **Refactor (2026-03-05)**: Extracted `ola_encode()` / `ola_decode()` / `ola_num_frames()` into `src/audio/ola.h` + `ola.cc`. `spectool` and `test_wav_roundtrip` now use the shared functions; `synth.cc` inline path unchanged (lazy frame decode; see TODO). + - **Files**: `src/audio/spectrogram_resource_manager.cc`, `tools/spectool.cc`, `src/audio/synth.cc`, `src/audio/ola.h`, `src/audio/ola.cc`, `workspaces/main/music/*.spec` - **Tests**: 34/34 passing ## Recently Completed (February 21, 2026) |
