summaryrefslogtreecommitdiff
path: root/tools/mq_editor/mq_extract.js
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-18 15:46:59 +0100
committerskal <pascal.massimino@gmail.com>2026-02-18 15:46:59 +0100
commit7a054e8ee8566eea9d06ff1ff9c1ce48c39fe659 (patch)
tree30ee1013f398cc565139d67c2613200dbbebca6f /tools/mq_editor/mq_extract.js
parent02dd7799396ebe3b5c3764796cfa3cbc72b72110 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'tools/mq_editor/mq_extract.js')
-rw-r--r--tools/mq_editor/mq_extract.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/mq_editor/mq_extract.js b/tools/mq_editor/mq_extract.js
index c084b43..3f7490d 100644
--- a/tools/mq_editor/mq_extract.js
+++ b/tools/mq_editor/mq_extract.js
@@ -104,20 +104,19 @@ function normalizeAngle(angle) {
// Track partials across frames using phase coherence for robust matching.
function trackPartials(frames, params) {
- const { sampleRate, hopSize } = params;
+ const {
+ sampleRate, hopSize,
+ birthPersistence = 3,
+ deathAge = 5,
+ minLength = 10,
+ phaseErrorWeight = 2.0
+ } = params;
const partials = [];
const activePartials = [];
const candidates = []; // pre-birth
const trackingRatio = 0.05; // 5% frequency tolerance
const minTrackingHz = 20;
- const birthPersistence = 3; // frames before partial is born
- const deathAge = 5; // frames without match before death
- const minLength = 10; // frames required to keep partial
-
- // Weight phase error heavily in cost function, scaled by frequency.
- // This makes phase deviation more significant for high-frequency partials.
- const phaseErrorWeight = 2.0;
for (const frame of frames) {
const matched = new Set();