r[risingEdge++] - 128 < edgeThreshold && risingEdge <= width);
            if (risingEdge >= width) risingEdge = 0;

            for (var x = risingEdge; x < buffer.length && x - risingEdge < width; x++)
              ctx.lineTo(x - risingEdge, height - buffer[x] * scaling);

            ctx.stroke();
          }

          const draw = () => {
            drawSpectrum();
            drawWaveform();
            let loop = requestAnimationFrame(draw);
          }
          draw();
        })();

        (fun