RPE Chart Utils
    Preparing search index...

    Module prototype

    Prototype-style chainable wrappers around RPE chart objects.

    Instead of calling free functions like:

    addMoveXEvent(chart, 0, 0, 0, 4, -100, 100);
    addNote(chart, 0, 2, { type: 1 });

    You can use the wrapper classes for a fluent, self-documenting API:

    const line = new LineBuilder(chart, 0);
    line.moveX(0, 4, -100, 100).rotate(0, 4, 0, 90).addNote(2);

    All wrappers are thin value-objects — they hold a reference to the underlying chart (and target line / note) and delegate to the chart-utils functions. Nothing is copied; changes are made in place.

    Entry points

    • ChartBuilder.from(chart) — wrap an existing chart
    • ChartBuilder.empty(bpm?, name?) — create and wrap a new chart
    • new LineBuilder(chart, lineIndex) — wrap a specific line
    • new NoteBuilder(chart, lineIndex, noteIndex) — wrap a specific note
    import { ChartBuilder } from './prototype';

    const chart = ChartBuilder.empty(140, 'Example')
    .setCharter('Me')
    .setComposer('Artist');

    // Add two judge lines
    const main = chart.line({ name: 'Main' });
    const bg = chart.line({ name: 'BG', texture: 'bg.png' });

    // Animate the main line: slide X 0→675 over beats 0Ⅎ4
    main.moveX(0, 4, 0, 675, 'cubicOut');

    // Add a tap note at beat 2 and a hold from beat 4–6
    main.addNote(2, { type: 1 })
    .addNote(4, { type: 2, endBeat: 6 });

    // BPM change at beat 32
    chart.bpm(32, 160);

    // Get stats and serialize
    const stats = chart.stats();
    const issues = chart.validate();
    const json = chart.serialize();

    Classes

    ChartBuilder
    LineBuilder
    EventLayerBuilder
    NoteBuilder
    EventBuilder

    Functions

    wrap
    createChart

    References

    noteIterator → noteIterator
    lineIterator → lineIterator
    eventIterator → eventIterator
    NoteIterator → NoteIterator
    LineIterator → LineIterator
    EventIterator → EventIterator