From 83eec3cece795f56f4edc1298a008216cb9511a0 Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 19 Feb 2026 06:46:57 +0100 Subject: feat(mq_editor): UI revamp — params panel, layout, partial spectrum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move Synthesis controls (integratePhase, jitter, spread, resonator, LP/HP filters) and Auto Spread All into the ⚙ Params dropdown - Group Extract Partials / +Partial / ✕ Clear All in one toolbar group - Add per-partial Sine/Res mode toggle in the property panel (Mode row) - Move partial mini-spectrum below the right panel (right-col layout) - Partial mini-spectrum: dynamic dB range scanned across full duration (8 samples, [peak−60, peak]), cached on partial select - Print bezier amplitude A= in red at top-right of partial spectrum - Status/info messages set to 80% gray (#ccc) handoff(Claude): UI revamp complete, TODO items implemented. Co-Authored-By: Claude Sonnet 4.6 --- tools/mq_editor/TODO.md | 17 +++++ tools/mq_editor/editor.js | 32 ++++++++++ tools/mq_editor/index.html | 154 +++++++++++++++++++++++---------------------- tools/mq_editor/style.css | 24 ++++--- tools/mq_editor/viewer.js | 36 ++++++++++- 5 files changed, 178 insertions(+), 85 deletions(-) create mode 100644 tools/mq_editor/TODO.md (limited to 'tools/mq_editor') diff --git a/tools/mq_editor/TODO.md b/tools/mq_editor/TODO.md new file mode 100644 index 0000000..d85aa84 --- /dev/null +++ b/tools/mq_editor/TODO.md @@ -0,0 +1,17 @@ +# UI revamp + +- the Synthesis panel (Integrate Phase, etc, LP, MP) contains global parameters -> Should go under the top "Params" button + +- 'Auto Spread All' should go under the 'Params' button too. It's a global action. + +- group 'Extract Partials' button with '+Partial' and 'x Clear All' ones. + +- add a sine / resonator toggle per partial to toggle between sine-based synth and resonator. 'Resonator (all)' takes precedence. + +- the partial's mini-spectrum should go under the right panel, since it's related + +- the partial's mini-spectrum should have a fixed dB range ([-40dB,10dB]?) instead of a dynamic one, to see the impact of amplitude modulation per partial + +- the messages' color is too dark, make them 80% gray when appropriate + +- streamline the CSS and styling, if possible diff --git a/tools/mq_editor/editor.js b/tools/mq_editor/editor.js index 98c92e5..07312d5 100644 --- a/tools/mq_editor/editor.js +++ b/tools/mq_editor/editor.js @@ -86,6 +86,38 @@ class PartialEditor { muteBtn.textContent = partial.muted ? 'Unmute' : 'Mute'; muteBtn.style.color = partial.muted ? '#fa4' : ''; + // Mode toggle (quick sine/resonator switch, no tab required) + const modeToggle = document.getElementById('synthModeToggle'); + if (modeToggle) { + modeToggle.innerHTML = ''; + const isRes = !!(partial.resonator && partial.resonator.enabled); + const resDefaults = { r: 0.995, gainComp: 1.0 }; + const btnS = document.createElement('button'); + btnS.textContent = 'Sine'; + btnS.className = 'tab-btn' + (isRes ? '' : ' active'); + btnS.style.cssText = 'padding:2px 8px;font-size:11px;margin:0;'; + const btnR = document.createElement('button'); + btnR.textContent = 'Res'; + btnR.className = 'tab-btn' + (isRes ? ' active' : ''); + btnR.style.cssText = 'padding:2px 8px;font-size:11px;margin:0;'; + btnS.onclick = () => { + if (!this.partials || !this.partials[index]) return; + if (!this.partials[index].resonator) this.partials[index].resonator = {...resDefaults}; + this.partials[index].resonator.enabled = false; + this._updatePropPanel(index); + if (this.viewer) this.viewer.render(); + }; + btnR.onclick = () => { + if (!this.partials || !this.partials[index]) return; + if (!this.partials[index].resonator) this.partials[index].resonator = {...resDefaults}; + this.partials[index].resonator.enabled = true; + this._updatePropPanel(index); + if (this.viewer) this.viewer.render(); + }; + modeToggle.appendChild(btnS); + modeToggle.appendChild(btnR); + } + this._buildCurveGrid(this._freqGrid, partial, 'freqCurve', 'f', index); this._buildCurveGrid(this._ampGrid, partial, 'freqCurve', 'a', index, 'a'); this._buildSynthGrid(partial, index); diff --git a/tools/mq_editor/index.html b/tools/mq_editor/index.html index efbd73d..a03ab35 100644 --- a/tools/mq_editor/index.html +++ b/tools/mq_editor/index.html @@ -19,7 +19,8 @@ - + + @@ -27,11 +28,6 @@ - - - - - @@ -71,6 +67,39 @@ +
+ Synthesis + + + + + + + +
+ +
+
@@ -82,10 +111,6 @@ - -
- -
@@ -109,75 +134,52 @@
-
- -