diff options
Diffstat (limited to 'tools/mq_editor/index.html')
| -rw-r--r-- | tools/mq_editor/index.html | 12 |
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> |
