From 7a054e8ee8566eea9d06ff1ff9c1ce48c39fe659 Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 18 Feb 2026 15:46:59 +0100 Subject: feat(mq_editor): expose tracking params in UI with grouped param panel Reorganize extraction parameters into four labeled groups (STFT / Peak Detection / Tracking / Filter). Expose Birth, Death, Phase Wt and Min Len as live controls wired to runExtraction(). All labels carry tooltip descriptions. mq_extract.js now reads these from params instead of hardcoded constants (same defaults preserved). handoff(Claude): tracking params exposed, panel grouped, README updated. Co-Authored-By: Claude Sonnet 4.6 --- tools/mq_editor/index.html | 83 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 67 insertions(+), 16 deletions(-) (limited to 'tools/mq_editor/index.html') diff --git a/tools/mq_editor/index.html b/tools/mq_editor/index.html index a2daff5..5f6af24 100644 --- a/tools/mq_editor/index.html +++ b/tools/mq_editor/index.html @@ -43,11 +43,31 @@ #extractBtn { background: #666; color: #fff; font-weight: bold; border-color: #888; } input[type="file"] { display: none; } .params { - display: inline-block; - margin-left: 20px; + display: flex; + margin-top: 8px; + background: #222; + border: 1px solid #444; + border-radius: 3px; + } + .param-group { + display: flex; + align-items: center; + gap: 6px; + padding: 5px 12px; + border-right: 1px solid #444; + flex-wrap: wrap; + } + .param-group:last-child { border-right: none; } + .group-label { + font-size: 9px; + color: #666; + text-transform: uppercase; + letter-spacing: 1px; + white-space: nowrap; + margin-right: 2px; } label { - margin-right: 8px; + margin-right: 4px; } input[type="number"], select { width: 80px; @@ -266,22 +286,41 @@
- - - - - +
+ STFT + + +
- - +
+ Peak Detection + + + + + +
- +
+ Tracking + + + + + + + + +
- - - 100% +
+ Filter + + + 100% +
@@ -451,6 +490,10 @@ const threshold = document.getElementById('threshold'); const prominence = document.getElementById('prominence'); const freqWeightCb = document.getElementById('freqWeight'); + const birthPersistenceEl = document.getElementById('birthPersistence'); + const deathAgeEl = document.getElementById('deathAge'); + const phaseErrorWeightEl = document.getElementById('phaseErrorWeight'); + const minLengthEl = document.getElementById('minLength'); const keepPct = document.getElementById('keepPct'); const keepPctLabel = document.getElementById('keepPctLabel'); const fftSize = 1024; // Fixed @@ -570,6 +613,10 @@ threshold: parseFloat(threshold.value), prominence: parseFloat(prominence.value), freqWeight: freqWeightCb.checked, + birthPersistence: parseInt(birthPersistenceEl.value), + deathAge: parseInt(deathAgeEl.value), + phaseErrorWeight: parseFloat(phaseErrorWeightEl.value), + minLength: parseInt(minLengthEl.value), sampleRate: audioBuffer.sampleRate }; @@ -629,6 +676,10 @@ if (stftCache) runExtraction(); }); + for (const el of [birthPersistenceEl, deathAgeEl, phaseErrorWeightEl, minLengthEl]) { + el.addEventListener('change', () => { if (stftCache) runExtraction(); }); + } + function playAudioBuffer(buffer, statusMsg) { const startTime = audioContext.currentTime; currentSource = audioContext.createBufferSource(); -- cgit v1.2.3