summaryrefslogtreecommitdiff
path: root/tools/mq_editor/app.js
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-18 23:55:02 +0100
committerskal <pascal.massimino@gmail.com>2026-02-18 23:55:02 +0100
commit618bd1dc9af4beb98584ed817772951007017f79 (patch)
treedaa3c71762dee6f53fcf232669873f1531b14777 /tools/mq_editor/app.js
parente63f885c7caaf7496d01e37f8ed2769190f8a51e (diff)
fix(mq_editor): partial mini-spectrum — correct FFT, time selection, resonator sync
- Fix: fftRadix2 called without bitReversePermute → noisy spectrum (use fftForward) - specTime = mouse pos if inside partial [t0,t3], else center of partial interval - Cache check moved before canvas clear to keep spectrum visible outside [t0,t3] - viewer.synthOpts forwarded to synthesizeMQ so forceResonator/globalR/gain apply - invalidatePartialSpectrum() wired to forceResonator/forceRGain/globalR/globalGain handoff(Gemini): mini-spectrum now correct; fft bug fixed, resonator mode synced
Diffstat (limited to 'tools/mq_editor/app.js')
-rw-r--r--tools/mq_editor/app.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/mq_editor/app.js b/tools/mq_editor/app.js
index 9df00fb..d54e5f3 100644
--- a/tools/mq_editor/app.js
+++ b/tools/mq_editor/app.js
@@ -46,16 +46,28 @@ document.getElementById('hpK2').addEventListener('input', function() {
document.getElementById('hpK2Val').textContent = k >= 1.0 ? 'bypass' : fmtHz(f);
});
+function invalidatePartialSpectrum() {
+ if (!viewer) return;
+ viewer.synthOpts = getSynthParams().opts;
+ viewer._partialSpecCache = null;
+ viewer.renderPartialSpectrum(viewer.spectrumTime, true);
+}
+
// Show/hide global resonator params when forceResonator toggled
document.getElementById('forceResonator').addEventListener('change', function() {
document.getElementById('globalResParams').style.display = this.checked ? '' : 'none';
+ invalidatePartialSpectrum();
});
document.getElementById('globalR').addEventListener('input', function() {
document.getElementById('globalRVal').textContent = parseFloat(this.value).toFixed(4);
+ invalidatePartialSpectrum();
});
document.getElementById('globalGain').addEventListener('input', function() {
document.getElementById('globalGainVal').textContent = parseFloat(this.value).toFixed(2);
+ invalidatePartialSpectrum();
});
+document.getElementById('forceRGain').addEventListener('change', invalidatePartialSpectrum);
+
let audioBuffer = null;
let viewer = null;
let audioContext = null;