Compute the position of a specific note relative to its line at a given beat.
Replicates the RPE player's note position logic including:
posControl
yControl
above
getLineState
Returns both local coordinates (before line rotation) and absolute scene coordinates (after rotation and translation).
The parsed RPE chart.
Index of the line in judgeLineList.
judgeLineList
Index of the note in the line's notes array.
notes
Current beat (the "camera" time).
Chart flipping flags (0–3).
The NotePosition, or null if indices are invalid.
null
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`);} Copy
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`);}
Compute the position of a specific note relative to its line at a given beat.
Replicates the RPE player's note position logic including:
posControlandyControlnode evaluationaboveflaggetLineState)Returns both local coordinates (before line rotation) and absolute scene coordinates (after rotation and translation).