Position computation utilities for RPE charts.
Replicates the coordinate system used by the player at a fixed scene size of 1350×900. Provides functions to compute:
Use p / o / d / w / h to convert between chart space and scene pixels (mirroring the game's Game.p/o/d/w/h helpers).
Game.p/o/d/w/h
import { getLineState, getNotePosition, preprocess } from './chart-utils';preprocess(chart);// Where is line 0 at beat 8?const state = getLineState(chart, 0, 8);console.log(state.sceneX, state.sceneY, state.rotationRad);// Where is note 3 on line 0 at beat 8?const pos = getNotePosition(chart, 0, 3, 8);if (pos) console.log(pos.sceneX, pos.sceneY);// Find the note closest to clicked pixel (700, 450)const closest = findClosestNote(chart, { x: 700, y: 450 }, 8, 0, 50); Copy
import { getLineState, getNotePosition, preprocess } from './chart-utils';preprocess(chart);// Where is line 0 at beat 8?const state = getLineState(chart, 0, 8);console.log(state.sceneX, state.sceneY, state.rotationRad);// Where is note 3 on line 0 at beat 8?const pos = getNotePosition(chart, 0, 3, 8);if (pos) console.log(pos.sceneX, pos.sceneY);// Find the note closest to clicked pixel (700, 450)const closest = findClosestNote(chart, { x: 700, y: 450 }, 8, 0, 50);
Position computation utilities for RPE charts.
Replicates the coordinate system used by the player at a fixed scene size of 1350×900. Provides functions to compute:
Coordinate system
Use p / o / d / w / h to convert between chart space and scene pixels (mirroring the game's
Game.p/o/d/w/hhelpers).Usage