RPE Chart Utils
    Preparing search index...

    Function keyframesToEvents

    • Generate a sequence of events that form a linear keyframe animation.

      Each consecutive pair of keyframes produces one Event with the specified easing applied between them. Use this for compact multi-segment animations.

      Parameters

      • keyframes: [number, number][]

        Array of [beat, value] pairs sorted by beat.

      • 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 applied between every pair of keyframes (default: linear).

      Returns Event[]

      Array of Event objects ready to push into an event channel.

      // X oscillates 0 → 675 → 0 over 4 beats
      const evs = keyframesToEvents([[0, 0], [2, 675], [4, 0]], 'sineInOut');
      layer.moveXEvents = evs;

      // Create a 3-step alpha fade: in, hold, out
      const alpha = keyframesToEvents([[0, 0], [1, 255], [3, 255], [4, 0]]);