 * 2^(d/1200) where |f| is the
        // oscillator frequency and |d| is the detune value.  Thus,
        // find |d| such that Nyquist = f*2^(d/1200). That is, d =
        // 1200*log2(Nyquist/f)
        const nyquist = context.sampleRate / 2;
        const criticalDetune = 1200 * Math.log2(nyquist / baseFrequency);
        // Now figure out at what point on the linear ramp does the
        // detune value reach this critical value.  For a linear ramp:
        //
        //   v(t) = V0+(V1-V0)*(t-T0)/(T1-