From 362f862da4fb5d9c666c8ca7b0dc329d4b8d1f7e Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 18 Feb 2026 12:13:09 +0100 Subject: feat(mq_editor): global r/gain overrides for Resonator (all) mode Add r (pole) and gain sliders with force r/gain checkbox in Synthesis panel, visible when Resonator (all) is active. Restrict r range to [0.75, 0.9999] for both global and per-partial sliders. handoff(Claude): global resonator r/gain override controls added Co-Authored-By: Claude Sonnet 4.6 --- tools/mq_editor/mq_synth.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools/mq_editor/mq_synth.js') diff --git a/tools/mq_editor/mq_synth.js b/tools/mq_editor/mq_synth.js index d85c890..2d4cf1b 100644 --- a/tools/mq_editor/mq_synth.js +++ b/tools/mq_editor/mq_synth.js @@ -56,8 +56,10 @@ function synthesizeMQ(partials, sampleRate, duration, integratePhase = true, opt // r controls pole radius (bandwidth): r→1 = narrow, r→0 = wide. // gainNorm = sqrt(1 - r²) normalises steady-state output power to ~A. const res = partial.resonator || {}; - const r = res.r != null ? Math.min(0.9999, Math.max(0, res.r)) : 0.995; - const gainComp = res.gainComp != null ? res.gainComp : 1.0; + const r = options.forceRGain ? Math.min(0.9999, Math.max(0, options.globalR)) + : (res.r != null ? Math.min(0.9999, Math.max(0, res.r)) : 0.995); + const gainComp = options.forceRGain ? options.globalGain + : (res.gainComp != null ? res.gainComp : 1.0); const gainNorm = Math.sqrt(Math.max(0, 1.0 - r * r)); configs.push({ mode: 'resonator', -- cgit v1.2.3