mirror of
https://github.com/smittix/intercept.git
synced 2026-04-27 16:20:02 -07:00
debug: Add signal level logging to synthesizer
Adds console logging and on-canvas display of signal level values to help diagnose why synthesizer isn't responding to signals. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1531,6 +1531,9 @@ function initSynthesizer() {
|
||||
drawSynthesizer();
|
||||
}
|
||||
|
||||
// Debug: log signal level periodically
|
||||
let lastSynthDebugLog = 0;
|
||||
|
||||
function drawSynthesizer() {
|
||||
if (!synthCtx || !synthCanvas) return;
|
||||
|
||||
@@ -1546,6 +1549,19 @@ function drawSynthesizer() {
|
||||
let activityLevel = 0;
|
||||
let signalIntensity = 0;
|
||||
|
||||
// Debug logging every 2 seconds
|
||||
const now = Date.now();
|
||||
if (now - lastSynthDebugLog > 2000) {
|
||||
console.log('[SYNTH] State:', {
|
||||
isScannerRunning,
|
||||
isDirectListening,
|
||||
scannerSignalActive,
|
||||
currentSignalLevel,
|
||||
visualizerAnalyser: !!visualizerAnalyser
|
||||
});
|
||||
lastSynthDebugLog = now;
|
||||
}
|
||||
|
||||
if (isScannerRunning && !isScannerPaused) {
|
||||
// Use actual signal level data (0-5000 range, normalize to 0-1)
|
||||
signalIntensity = Math.min(1, currentSignalLevel / 3000);
|
||||
@@ -1637,6 +1653,13 @@ function drawSynthesizer() {
|
||||
synthCtx.lineTo(width, height / 2);
|
||||
synthCtx.stroke();
|
||||
|
||||
// Debug: show signal level value
|
||||
if (isScannerRunning || isDirectListening) {
|
||||
synthCtx.fillStyle = 'rgba(255, 255, 255, 0.5)';
|
||||
synthCtx.font = '9px monospace';
|
||||
synthCtx.fillText(`lvl:${Math.round(currentSignalLevel)}`, 4, 10);
|
||||
}
|
||||
|
||||
synthAnimationId = requestAnimationFrame(drawSynthesizer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user