  // source -> waveshaper -> destination
        const source = new AudioBufferSourceNode(context);
        const waveshaper = new WaveShaperNode(context);
        source.connect(waveshaper);
        waveshaper.connect(context.destination);

        // Create an input test vector.
        inputBuffer = generateInputBuffer();
        source.buffer = inputBuffer;

        // We'll apply non-linear distortion according to this shaping curve.
        waveShapingCurve = generateWaveShapingCurve();
        wavesh