 height = canvas.height;

            const dx = Math.max(1, 1.0*canvas.width / bufferLength);
            analyser.getByteFrequencyData(buffer);

            // clear canvas
            ctx.fillStyle = 'rgba(0, 20, 0, 0.1)';
            ctx.lineWidth = 1;
            ctx.fillRect(0, 0, canvas.width, height);
            // draw trigger markers
            frequencies.forEach((f, i) => {
              let binIndex = frequencyBinIndex(f);
              ctx.fillStyle = buffer[binIndex] > 124 ? `rgb(0, 255, 0)