diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-18 21:36:07 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-18 21:36:07 +0100 |
| commit | f48397c58248ca338c258b1de762314926fe681f (patch) | |
| tree | 219ddcc63f1600ae5604d655bb4c6faabd91ca33 /tools/mq_editor/README.md | |
| parent | eeecb76eef15f684b7909ff22fd054680c2a3498 (diff) | |
feat(mq_editor): movable inner bezier control points + clamp() refactor
- P1/P2 in amp editor now draggable horizontally; t0<t1<t2<t3 enforced
- Add clamp() to utils.js; replace all Math.max/min clamping patterns
- Cursor hints: move for P1/P2, ns-resize for P0/P3
- Remove test_fft.html
- Docs: Delete key, style.css/utils.js in architecture, bezier editor section
handoff(Claude): inner control points done, clamp() adopted everywhere
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'tools/mq_editor/README.md')
| -rw-r--r-- | tools/mq_editor/README.md | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/mq_editor/README.md b/tools/mq_editor/README.md index 9435883..6f75a52 100644 --- a/tools/mq_editor/README.md +++ b/tools/mq_editor/README.md @@ -95,6 +95,7 @@ Committed partials are prepended to the partial list with full undo support. | `C` | Toggle ≋ Contour mode (iso-energy tracking) | | `P` | Toggle raw peak overlay | | `A` | Toggle mini-spectrum: original ↔ synthesized | +| `Delete` | Delete selected partial | | `Esc` | Exit explore/contour mode · deselect partial | | `Ctrl+Z` | Undo | | `Ctrl+Y` / `Ctrl+Shift+Z` | Redo | @@ -104,10 +105,12 @@ Committed partials are prepended to the partial list with full undo support. ## Architecture - `index.html` — UI, playback, extraction orchestration, keyboard shortcuts +- `style.css` — All UI styles (extracted from inline styles) - `editor.js` — Property panel and amplitude bezier editor for selected partials - `fft.js` — Cooley-Tukey radix-2 FFT + STFT cache - `mq_extract.js` — MQ algorithm: peak detection, forward tracking, backward expansion, bezier fitting - `mq_synth.js` — Oscillator bank + two-pole resonator synthesis from extracted partials +- `utils.js` — Shared helpers: `evalBezier`, `evalBezierAmp`, `clamp`, canvas coordinate utilities - `viewer.js` — Visualization: coordinate API, spectrogram, partials, mini-spectrum, mouse/zoom ### viewer.js coordinate API @@ -123,6 +126,19 @@ Committed partials are prepended to the partial list with full undo support. | `normalizeDB(db, maxDB)` | dB → intensity [0..1] over 80 dB range | | `partialColor(p)` | partial index → display color | +## Amplitude Bezier Editor + +The bottom panel shows the amplitude envelope for the selected partial as a **Lagrange interpolating curve** through four control points P0–P3. + +- **P0, P3** (endpoints): drag vertically to adjust amplitude at the start/end of the partial. Time positions are fixed to `t_start`/`t_end`. +- **P1, P2** (inner points): drag in **both axes** — vertically for amplitude, horizontally for time position. The ordering constraint `t0 < t1 < t2 < t3` is enforced automatically. + +Cursor hints: `ns-resize` for P0/P3, `move` for P1/P2. + +All four time and amplitude values are also editable as numbers in the property panel above. + +--- + ## Post-Synthesis Filters Global LP/HP filters applied after the oscillator bank, before normalization. @@ -200,7 +216,7 @@ For a partial at 440 Hz with `spread = 0.02`: `BW ≈ 8.8 Hz`, `r ≈ exp(−π - [x] Synthesized STFT cache for FFT comparison - [x] Phase 3: Editing UI - [x] Partial selection with property panel (freq/amp/synth tabs) - - [x] Amplitude bezier drag editor + - [x] Amplitude bezier drag editor (P1/P2 horizontally movable, ordering constrained) - [x] Synth params with jog sliders (decay, jitter, spread) - [x] Auto-spread detection per partial and global - [x] Mute / delete partials |
