summaryrefslogtreecommitdiff
path: root/tools/mq_editor/mq_extract.js
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-18 21:36:07 +0100
committerskal <pascal.massimino@gmail.com>2026-02-18 21:36:07 +0100
commitf48397c58248ca338c258b1de762314926fe681f (patch)
tree219ddcc63f1600ae5604d655bb4c6faabd91ca33 /tools/mq_editor/mq_extract.js
parenteeecb76eef15f684b7909ff22fd054680c2a3498 (diff)
feat(mq_editor): movable inner bezier control points + clamp() refactor
- P1/P2 in amp editor now draggable horizontally; t0<t1<t2<t3 enforced - Add clamp() to utils.js; replace all Math.max/min clamping patterns - Cursor hints: move for P1/P2, ns-resize for P0/P3 - Remove test_fft.html - Docs: Delete key, style.css/utils.js in architecture, bezier editor section handoff(Claude): inner control points done, clamp() adopted everywhere 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.js2
1 files changed, 1 insertions, 1 deletions
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);