summaryrefslogtreecommitdiff
path: root/tools/mq_editor/index.html
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-18 05:11:12 +0100
committerskal <pascal.massimino@gmail.com>2026-02-18 05:11:12 +0100
commit35ebfac6c860cc7de7db447b57158a7a3a27daaa (patch)
treea94a5f670a3087b6d5e3a9048ee0c2a96c194129 /tools/mq_editor/index.html
parente1f12a5a7eafbb5f4cc7b0da5f563850347fc84c (diff)
fix(mq_editor): Catmull-Rom bezier fit, NaN guard, synth FFT toggle
- evalBezier: guard dt<=0 to avoid NaN on degenerate curves - fitBezier: replace nearest-neighbor control points with Catmull-Rom tangents (Hermite->Bezier), curve now passes through endpoints - key 'a': toggle mini-spectrum between original and synth FFT handoff(Claude): bezier fix + synth FFT comparison Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'tools/mq_editor/index.html')
-rw-r--r--tools/mq_editor/index.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/mq_editor/index.html b/tools/mq_editor/index.html
index e8386c2..d7cec6a 100644
--- a/tools/mq_editor/index.html
+++ b/tools/mq_editor/index.html
@@ -315,6 +315,12 @@
setStatus(`Synthesizing ${keepCount}/${extractedPartials.length} partials (${keepPct.value}%)...`, 'info');
const pcm = synthesizeMQ(partialsToUse, sampleRate, duration);
+ // Build STFT cache for synth signal (for FFT comparison via key 'a')
+ if (viewer) {
+ const synthStft = new STFTCache(pcm, sampleRate, fftSize, parseInt(hopSize.value));
+ viewer.setSynthStftCache(synthStft);
+ }
+
// Create audio buffer
const synthBuffer = audioContext.createBuffer(1, pcm.length, sampleRate);
synthBuffer.getChannelData(0).set(pcm);
@@ -360,6 +366,12 @@
} else if (e.code === 'KeyP') {
e.preventDefault();
if (viewer) viewer.togglePeaks();
+ } else if (e.code === 'KeyA') {
+ e.preventDefault();
+ if (viewer) {
+ viewer.showSynthFFT = !viewer.showSynthFFT;
+ viewer.renderSpectrum();
+ }
}
});
</script>