Main entry point for RPE chart utilities.
Re-exports everything from the sub-modules and provides chart-level operations: creation, validation, statistics, BPM manipulation, line creation, note factories, shader helpers, and import/export.
chart-utils
events
math
easing
position
iterators
NoteIterator
LineIterator
EventIterator
prototype
ChartBuilder
LineBuilder
NoteBuilder
wrap()
createChart()
extra
ExtraBuilder
EffectBuilder
extra.json
types
import { wrap, createChart, ExtraBuilder } from './chart-utils';// ── Build from scratch ─────────────────────────────────────────────────const chart = createChart(140, 'My Chart');chart.addLine({ name: 'Main' }) .moveX(0, 4, -675, 675, 'cubicOut') .addNote(2) .addNote(4, { type: 2, endBeat: 6 });// ── Load an existing chart ─────────────────────────────────────────────const raw = JSON.parse(fs.readFileSync('chart.json', 'utf8'));const chart = wrap(raw); // attaches fluent methods to the existing datachart.getLine(0).moveX(8, 12, 0, 200);// ── Serialize ─────────────────────────────────────────────────────────const json = chart.serialize();// ── Extra / shader effects ─────────────────────────────────────────────import { readFileSync } from 'fs';const glsl = readFileSync('shaders/glow.glsl', 'utf8');const extra = new ExtraBuilder(140);extra.addShader('/glow.glsl', glsl, 0, 32) // auto-loads defaults .animate('intensity', 0, 1, { easing: 'cubicOut' }) .setRange(100, 101);fs.writeFileSync('extra.json', extra.serialize()); Copy
import { wrap, createChart, ExtraBuilder } from './chart-utils';// ── Build from scratch ─────────────────────────────────────────────────const chart = createChart(140, 'My Chart');chart.addLine({ name: 'Main' }) .moveX(0, 4, -675, 675, 'cubicOut') .addNote(2) .addNote(4, { type: 2, endBeat: 6 });// ── Load an existing chart ─────────────────────────────────────────────const raw = JSON.parse(fs.readFileSync('chart.json', 'utf8'));const chart = wrap(raw); // attaches fluent methods to the existing datachart.getLine(0).moveX(8, 12, 0, 200);// ── Serialize ─────────────────────────────────────────────────────────const json = chart.serialize();// ── Extra / shader effects ─────────────────────────────────────────────import { readFileSync } from 'fs';const glsl = readFileSync('shaders/glow.glsl', 'utf8');const extra = new ExtraBuilder(140);extra.addShader('/glow.glsl', glsl, 0, 32) // auto-loads defaults .animate('intensity', 0, 1, { easing: 'cubicOut' }) .setRange(100, 101);fs.writeFileSync('extra.json', extra.serialize());
import { createEmptyChart, addLine, addNote, addMoveXEvent, serializeChart } from './chart-utils';const chart = createEmptyChart(140, 'My Chart');const li = addLine(chart, { name: 'Main' });addMoveXEvent(chart, li, 0, 0, 4, -675, 675, 8);addNote(chart, li, 2, { type: 1 });const json = serializeChart(chart); Copy
import { createEmptyChart, addLine, addNote, addMoveXEvent, serializeChart } from './chart-utils';const chart = createEmptyChart(140, 'My Chart');const li = addLine(chart, { name: 'Main' });addMoveXEvent(chart, li, 0, 0, 4, -675, 675, 8);addNote(chart, li, 2, { type: 1 });const json = serializeChart(chart);
Main entry point for RPE chart utilities.
Re-exports everything from the sub-modules and provides chart-level operations: creation, validation, statistics, BPM manipulation, line creation, note factories, shader helpers, and import/export.
Module map
chart-utils(this file)eventsmatheasingpositioniteratorsNoteIterator/LineIterator/EventIteratorprototypeChartBuilder/LineBuilder/NoteBuilder— fluent chart editing;wrap()/createChart()factoriesextraExtraBuilder/EffectBuilder— fluentextra.jsonediting; shader parsing; animated uniformstypesCommon workflows
Fluent chart API (recommended)
Low-level free-function API (still fully available)