diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-18 16:01:13 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-18 16:01:13 +0100 |
| commit | 00ce97d64b8bf7e1dcbdb5151bdf2033132ffbc3 (patch) | |
| tree | 0a5d4a7860ee12a4ba75bea9fa0eb0687e2a91b9 /tools/mq_editor/mq_synth.js | |
| parent | 7a054e8ee8566eea9d06ff1ff9c1ce48c39fe659 (diff) | |
refactor(mq_editor): consolidate duplicates, extract utils.js and app.js
- utils.js (new): evalBezier (robust), getCanvasCoords, buildBandPoints
- app.js (new): extract ~450-line inline script from index.html
- editor.js: generalize _makeJogSlider(inp, options) with onUpdate cb,
eliminate 50-line inline resonator jog duplication, use getCanvasCoords
- mq_extract.js: extract findBestPeak(), replace two identical loop bodies
- viewer.js: remove duplicate evalBezier, use getCanvasCoords/buildBandPoints
- mq_synth.js: remove duplicate evalBezier
- index.html: inline script removed, load order: utils→fft→extract→synth→viewer→editor→app
handoff(Claude): mq_editor refactor complete — no logic changes, browser-ready.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'tools/mq_editor/mq_synth.js')
| -rw-r--r-- | tools/mq_editor/mq_synth.js | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/tools/mq_editor/mq_synth.js b/tools/mq_editor/mq_synth.js index 2d4cf1b..4c68056 100644 --- a/tools/mq_editor/mq_synth.js +++ b/tools/mq_editor/mq_synth.js @@ -1,19 +1,6 @@ // MQ Synthesizer // Replica oscillator bank for sinusoidal synthesis, plus two-pole resonator mode -// Evaluate cubic bezier curve at time t -function evalBezier(curve, t) { - const dt = curve.t3 - curve.t0; - if (dt <= 0) return curve.v0; - let u = (t - curve.t0) / dt; - u = Math.max(0, Math.min(1, u)); - const u1 = 1.0 - u; - return u1*u1*u1 * curve.v0 + - 3*u1*u1*u * curve.v1 + - 3*u1*u*u * curve.v2 + - u*u*u * curve.v3; -} - // Deterministic LCG PRNG function randFloat(seed, min, max) { seed = (1664525 * seed + 1013904223) % 0x100000000; |
