From 48d8a9fe8af83fd1c8ef029a3c5fb8d87421a46e Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 18 Feb 2026 11:21:12 +0100 Subject: feat(mq_editor): f·Power checkbox, deselect on extract, panel refresh after auto-spread MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add 'f·Power' checkbox: weights spectrum by f before peak detection (f·FFT_Power(f)) to accentuate high-frequency peaks; re-runs extraction on toggle - Deselect partial after Extract Partials run - Fix right panel not refreshing after Auto Spread All: re-call editor.onPartialSelect handoff(Claude): mq_editor UX polish Co-Authored-By: Claude Sonnet 4.6 --- tools/mq_editor/index.html | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'tools/mq_editor/index.html') diff --git a/tools/mq_editor/index.html b/tools/mq_editor/index.html index f6d052b..aab603b 100644 --- a/tools/mq_editor/index.html +++ b/tools/mq_editor/index.html @@ -261,6 +261,10 @@ + + 100% @@ -366,6 +370,7 @@ const hopSize = document.getElementById('hopSize'); const threshold = document.getElementById('threshold'); + const freqWeightCb = document.getElementById('freqWeight'); const keepPct = document.getElementById('keepPct'); const keepPctLabel = document.getElementById('keepPctLabel'); const fftSize = 1024; // Fixed @@ -483,6 +488,7 @@ fftSize: fftSize, hopSize: parseInt(hopSize.value), threshold: parseFloat(threshold.value), + freqWeight: freqWeightCb.checked, sampleRate: audioBuffer.sampleRate }; @@ -501,9 +507,7 @@ setStatus(`Extracted ${result.partials.length} partials`, 'info'); viewer.setPartials(result.partials); viewer.setKeepCount(getKeepCount()); - // Refresh panels: re-select if index still valid, else clear - const prevSel = viewer.selectedPartial; - viewer.selectPartial(prevSel >= 0 && prevSel < result.partials.length ? prevSel : -1); + viewer.selectPartial(-1); } catch (err) { setStatus('Extraction error: ' + err.message, 'error'); @@ -531,6 +535,8 @@ p.replicas.spread_below = spread_below; } if (viewer) viewer.render(); + const sel = viewer ? viewer.selectedPartial : -1; + if (sel >= 0) editor.onPartialSelect(sel); setStatus(`Auto-spread applied to ${extractedPartials.length} partials`, 'info'); }); @@ -538,6 +544,10 @@ if (stftCache) runExtraction(); }); + freqWeightCb.addEventListener('change', () => { + if (stftCache) runExtraction(); + }); + function playAudioBuffer(buffer, statusMsg) { const startTime = audioContext.currentTime; currentSource = audioContext.createBufferSource(); -- cgit v1.2.3