From f48397c58248ca338c258b1de762314926fe681f Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 18 Feb 2026 21:36:07 +0100 Subject: feat(mq_editor): movable inner bezier control points + clamp() refactor - P1/P2 in amp editor now draggable horizontally; t0 --- tools/mq_editor/mq_extract.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/mq_editor/mq_extract.js') diff --git a/tools/mq_editor/mq_extract.js b/tools/mq_editor/mq_extract.js index 18897fb..42215d3 100644 --- a/tools/mq_editor/mq_extract.js +++ b/tools/mq_editor/mq_extract.js @@ -451,7 +451,7 @@ function trackIsoContour(stftCache, seedTime, seedFreq, params) { } const seedFrame = stftCache.getFrameAtIndex(seedFrameIdx); - const seedBin = Math.max(1, Math.min(halfBins - 2, Math.round(seedFreq / binHz))); + const seedBin = clamp(Math.round(seedFreq / binHz), 1, halfBins - 2); const targetSq = seedFrame.squaredAmplitude[seedBin]; if (targetSq <= 0) return null; const targetDB = 10 * Math.log10(targetSq); -- cgit v1.2.3