RPE Chart Utils
    Preparing search index...

    Function getNotePosition

    • Compute the position of a specific note relative to its line at a given beat.

      Replicates the RPE player's note position logic including:

      • Speed integral for the approach distance
      • posControl and yControl node evaluation
      • Incline offset
      • Chart-flipping and above flag
      • Parent line chain resolution (via getLineState)

      Returns both local coordinates (before line rotation) and absolute scene coordinates (after rotation and translation).

      Parameters

      • chart: RpeJson

        The parsed RPE chart.

      • lineIndex: number

        Index of the line in judgeLineList.

      • noteIndex: number

        Index of the note in the line's notes array.

      • beat: number

        Current beat (the "camera" time).

      • chartFlipping: number = 0

        Chart flipping flags (0–3).

      Returns NotePosition | null

      The NotePosition, or null if indices are invalid.

      const pos = getNotePosition(chart, 0, 2, 4.0);
      if (pos) {
      console.log(`Note is at (${pos.sceneX.toFixed(1)}, ${pos.sceneY.toFixed(1)}) in scene space`);
      console.log(`Distance from line: ${pos.dist.toFixed(1)}px`);
      }