RPE Chart Utils
    Preparing search index...

    Function createEvent

    • Create a standard RPE event with all required fields.

      Accepts both fractional beat numbers and beat tuples for startBeat/endBeat. The easingType can be a number (1–28) or a name string (see resolveEasingType).

      Parameters

      • startBeat: number | [number, number, number]

        Start beat as [measure, num, den] tuple or fractional number.

      • endBeat: number | [number, number, number]

        End beat as [measure, num, den] tuple or fractional number.

      • start: number

        Start value.

      • end: number

        End value.

      • easingType:
            | number
            | "linear"
            | "sineOut"
            | "sineIn"
            | "quadOut"
            | "quadIn"
            | "sineInOut"
            | "quadInOut"
            | "cubicOut"
            | "cubicIn"
            | "quartOut"
            | "quartIn"
            | "cubicInOut"
            | "quartInOut"
            | "quintOut"
            | "quintIn"
            | "expoOut"
            | "expoIn"
            | "circOut"
            | "circIn"
            | "backOut"
            | "backIn"
            | "circInOut"
            | "backInOut"
            | "elasticOut"
            | "elasticIn"
            | "bounceOut"
            | "bounceIn"
            | "bounceInOut" = 1

        Easing type or name (default: 1 = linear).

      • options: EventOptions = {}

        Optional fields: bezier, bezierPoints, easingLeft, easingRight, linkgroup.

      Returns Event

      A fully initialized Event object.

      // Line moves from x=0 to x=675 over beats 0–4 with CubicOut easing
      const ev = createEvent(0, 4, 0, 675, 'cubicOut');

      // Use a beat tuple for musical precision (beat 1, 3/8)
      const ev2 = createEvent([1, 3, 8], [2, 0, 1], 0, 255);

      // Custom bezier
      const ev3 = createEvent(0, 4, 0, 1, 1, {
      bezier: 1,
      bezierPoints: [0.4, 0, 0.2, 1],
      });