diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-18 12:13:09 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-18 12:13:09 +0100 |
| commit | 362f862da4fb5d9c666c8ca7b0dc329d4b8d1f7e (patch) | |
| tree | 9c8c3e7ce50c0bbc49b391aeac527ea0e5cec53e /tools/mq_editor/mq_synth.js | |
| parent | ce218b7459314dc9b7a5faf26139b8954a417b97 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'tools/mq_editor/mq_synth.js')
| -rw-r--r-- | tools/mq_editor/mq_synth.js | 6 |
1 files changed, 4 insertions, 2 deletions
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', |
