summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-19 07:26:26 +0100
committerskal <pascal.massimino@gmail.com>2026-02-19 07:26:26 +0100
commit07538091b1fac417104c273bd9dc117af8afdb9e (patch)
tree8b41d28ccca7df56418a54cdfa110ad2d9ccb198 /tools
parent83eec3cece795f56f4edc1298a008216cb9511a0 (diff)
fix(mq_editor): remove duplicate mode toggle, add SINE badge, fix mini-spectrum invalidation
- Remove redundant synthModeToggle from _updatePropPanel + index.html - Add SINE badge (grey) to panel title, matching existing RES badge (blue) - Invalidate mini-spectrum (viewer.render) on sinusoid/resonator switch handoff(Claude): mq_editor partial panel polish
Diffstat (limited to 'tools')
-rw-r--r--tools/mq_editor/editor.js38
-rw-r--r--tools/mq_editor/index.html4
-rw-r--r--tools/mq_editor/style.css1
3 files changed, 6 insertions, 37 deletions
diff --git a/tools/mq_editor/editor.js b/tools/mq_editor/editor.js
index 07312d5..81f571c 100644
--- a/tools/mq_editor/editor.js
+++ b/tools/mq_editor/editor.js
@@ -65,8 +65,9 @@ class PartialEditor {
const color = this.viewer ? this.viewer.partialColor(index) : '#888';
const titleEl = document.getElementById('propTitle');
- const badge = partial.resonator && partial.resonator.enabled
- ? ' <span class="res-badge">RES</span>' : '';
+ const badge = (partial.resonator && partial.resonator.enabled)
+ ? ' <span class="res-badge">RES</span>'
+ : ' <span class="res-badge sine-badge">SINE</span>';
titleEl.innerHTML = 'Partial #' + index + badge;
document.getElementById('propSwatch').style.background = color;
@@ -86,37 +87,6 @@ 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');
@@ -326,12 +296,14 @@ class PartialEditor {
if (!this.partials[index].resonator) this.partials[index].resonator = { ...resDefaults };
this.partials[index].resonator.enabled = false;
applyMode(false);
+ if (this.viewer) this.viewer.render();
});
btnRes.addEventListener('click', () => {
if (!this.partials) return;
if (!this.partials[index].resonator) this.partials[index].resonator = { ...resDefaults };
this.partials[index].resonator.enabled = true;
applyMode(true);
+ if (this.viewer) this.viewer.render();
});
}
diff --git a/tools/mq_editor/index.html b/tools/mq_editor/index.html
index a03ab35..0639c8d 100644
--- a/tools/mq_editor/index.html
+++ b/tools/mq_editor/index.html
@@ -150,10 +150,6 @@
<span class="prop-label">Time</span>
<span id="propTime">—</span>
</div>
- <div class="prop-row">
- <span class="prop-label">Mode</span>
- <span id="synthModeToggle" style="display:flex;gap:3px;"></span>
- </div>
<div class="curve-tabs">
<button class="tab-btn active" data-tab="Freq">Freq</button>
<button class="tab-btn" data-tab="Amp">Amp</button>
diff --git a/tools/mq_editor/style.css b/tools/mq_editor/style.css
index 2a9b5b7..399746c 100644
--- a/tools/mq_editor/style.css
+++ b/tools/mq_editor/style.css
@@ -104,6 +104,7 @@ kbd { font-size: 10px; opacity: 0.55; }
/* === Resonator badge === */
.res-badge { font-size: 9px; color: #8cf; border: 1px solid #8cf; border-radius: 2px; padding: 0 3px; vertical-align: middle; margin-left: 4px; opacity: .8; }
+.sine-badge { color: #aaa; border-color: #aaa; }
/* === Status & tooltip === */
#fileLabel { font-size: 13px; color: #8af; opacity: .8; }