code: function sCurve(length, rotation) {
      var curve = new Float32Array(length),
          i,
          phase = rotation > 0 ? Math.PI / 2 : -(Math.PI / 2);
  
      for (i = 0; i < length; ++i) {
          curve[i] = Math.sin(Math.PI * i / length - phase) / 2 + 0.5;
      }
      return curve;
  }
docs: creating a curve to simulate an S-curve with setValueCurveAtTime.