diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-18 10:51:25 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-18 10:51:25 +0100 |
| commit | f8f664964594a341884b2e9947f64feea4b925a6 (patch) | |
| tree | 4ac77ce036b188d5a374267c886a17f3366e1455 /tools/mq_editor/index.html | |
| parent | 78faa77b208d20c01c242a942a1ddf9278f4ef17 (diff) | |
feat(mq_editor): spread autodetection, 50% drop-off line, mini-spectrum peak fix
- autodetectSpread(): measures half-power (-3dB) peak width in spectrogram
to infer spread_above/below (replaces near-zero bezier residual approach)
- 'Auto' button per partial + 'Auto Spread All' toolbar button
- Spread panel inputs now trigger viewer refresh on change
- 50% drop-off dotted reference lines on spread band (selected partial only)
- Mini-spectrum: use max() instead of mean() over bins per pixel column,
fixing high-frequency amplitude mismatch between original and synthesis
handoff(Gemini): spread autodetection and mini-spectrum fixes done
Diffstat (limited to 'tools/mq_editor/index.html')
| -rw-r--r-- | tools/mq_editor/index.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/mq_editor/index.html b/tools/mq_editor/index.html index 8f36314..5e1e5c4 100644 --- a/tools/mq_editor/index.html +++ b/tools/mq_editor/index.html @@ -212,6 +212,7 @@ <button id="chooseFileBtn">📂 Open WAV</button> <button id="testWavBtn">⚗ Test WAV</button> <button id="extractBtn" disabled>Extract Partials</button> + <button id="autoSpreadAllBtn" disabled>Auto Spread All</button> <button id="playBtn" disabled>▶ Play</button> <button id="stopBtn" disabled>■ Stop</button> @@ -464,6 +465,7 @@ console.error(err); } extractBtn.disabled = false; + autoSpreadAllBtn.disabled = false; }, 50); } @@ -473,6 +475,23 @@ runExtraction(); }); + // Auto-spread all partials + const autoSpreadAllBtn = document.getElementById('autoSpreadAllBtn'); + autoSpreadAllBtn.addEventListener('click', () => { + if (!extractedPartials || !stftCache) return; + const fs = stftCache.fftSize; + const sr = audioBuffer.sampleRate; + const defaults = { decay_alpha: 0.1, jitter: 0.05, spread_above: 0.02, spread_below: 0.02 }; + for (const p of extractedPartials) { + const {spread_above, spread_below} = autodetectSpread(p, stftCache, fs, sr); + if (!p.replicas) p.replicas = { ...defaults }; + p.replicas.spread_above = spread_above; + p.replicas.spread_below = spread_below; + } + if (viewer) viewer.render(); + setStatus(`Auto-spread applied to ${extractedPartials.length} partials`, 'info'); + }); + threshold.addEventListener('change', () => { if (stftCache) runExtraction(); }); |
