RPE Chart Utils
    Preparing search index...

    Class NoteIterator

    Fluent iterator that filters and transforms notes in an RPE chart.

    Conditions (filters) are AND-ed together. All registered process functions are run on every note that passes all conditions.

    Call .run(chart) to execute. Call .collect(chart) to get an array of matching notes without mutating them.

    .between(), .before(), .after(), .approximately(), .onlyType(), .onlyTaps(), .onlyHolds(), .onlyFlicks(), .onlyDrags(), .realOnly(), .filterFake(), .betweenX(), .onLines(), .onLineIndices(), .onLineNamed(), .onSide(), .withSpeed()

    .setSpeed(), .scaleSpeed(), .setX(), .moveX(), .mirrorX(), .setAlpha(), .setSize(), .scaleSize(), .setYOffset(), .setFake(), .setVisibleTime(), .setTint()

    // Speed up the tail of the chart
    noteIterator()
    .after(64)
    .realOnly()
    .scaleSpeed(1.5)
    .run(chart);

    // Collect all holds for inspection
    const holds = noteIterator().onlyHolds().collect(chart);
    Index

    Constructors

    Methods

    • Only process notes whose start beat is in [start, end).

      Parameters

      • start: number
      • end: number

      Returns this

    • Only process notes whose start beat is strictly before beat.

      Parameters

      • beat: number

      Returns this

    • Only process notes whose start beat is strictly after beat.

      Parameters

      • beat: number

      Returns this

    • Only process notes at approximately beat (within epsilon).

      Parameters

      • beat: number
      • epsilon: number = 0.01

      Returns this

    • Only process notes of the given type(s).

      Parameters

      • ...types: NoteTypeValue[]

        One or more NoteType values (1=Tap, 2=Hold, 3=Flick, 4=Drag).

      Returns this

    • Shorthand: only Tap notes.

      Returns this

    • Shorthand: only Hold notes.

      Returns this

    • Shorthand: only Flick notes.

      Returns this

    • Shorthand: only Drag notes.

      Returns this

    • Control whether fake notes are included (default: true).

      Parameters

      • includeFake: boolean

      Returns this

    • Exclude fake notes from processing.

      Returns this

    • Only process notes whose positionX is in [minX, maxX].

      Parameters

      • minX: number
      • maxX: number

      Returns this

    • Only process notes on lines matching a predicate.

      Parameters

      • predicate: (line: JudgeLine, index: number) => boolean

      Returns this

    • Only process notes on the given line indices.

      Parameters

      • ...indices: number[]

      Returns this

    • Only process notes on lines whose name matches nameOrPattern. Accepts a string (exact match) or a RegExp.

      Parameters

      • nameOrPattern: string | RegExp

      Returns this

    • Only process notes whose above value equals side (1 = above, 2 = below).

      Parameters

      • side: 1 | 2

      Returns this

    • Only process notes whose speed satisfies the predicate.

      Parameters

      • predicate: (speed: number) => boolean

      Returns this

    • Set the speed of all matched notes.

      Parameters

      • speed: number

      Returns this

    • Scale the speed of all matched notes by a factor.

      Parameters

      • factor: number

      Returns this

    • Set the positionX of all matched notes.

      Parameters

      • x: number

      Returns this

    • Translate notes along X by dx.

      Parameters

      • dx: number

      Returns this

    • Mirror notes horizontally (flip positionX sign).

      Returns this

    • Set the alpha of all matched notes (0–255).

      Parameters

      • alpha: number

      Returns this

    • Set the size of all matched notes.

      Parameters

      • size: number

      Returns this

    • Scale the size of all matched notes by a factor.

      Parameters

      • factor: number

      Returns this

    • Set the yOffset of all matched notes.

      Parameters

      • y: number

      Returns this

    • Set the isFake flag on all matched notes.

      Parameters

      • fake: boolean

      Returns this

    • Set the visible time for all matched notes.

      Parameters

      • time: number

      Returns this

    • Set a tint color [r, g, b] on all matched notes.

      Parameters

      • color: [number, number, number] | null

      Returns this

    • Set a hit effect tint [r, g, b] on all matched notes.

      Parameters

      • color: [number, number, number] | null

      Returns this

    • Assign a hitsound to all matched notes.

      Parameters

      • hitsound: string

      Returns this

    • Set judgeArea on all matched notes.

      Parameters

      • size: number

      Returns this

    • Set the above side (1 = above, 2 = below) on all matched notes.

      Parameters

      • side: 1 | 2

      Returns this

    • Offset the start (and optionally end) beat of all matched notes by beatOffset.

      Parameters

      • beatOffset: number

      Returns this

    • Apply a user-supplied callback to each note's index within its line. Useful for stagger, sequential effects, etc.

      The callback receives (note, line, chart, noteIndex, lineIndex, globalIndex).

      Parameters

      • fn: (
            note: Note,
            line: JudgeLine,
            chart: RpeJson,
            noteIndex: number,
            lineIndex: number,
            globalIndex: number,
        ) => void

      Returns this

    • Run the iterator over all notes in the provided chart.

      Parameters

      Returns number

      The number of notes that were processed.

    • Run the iterator over a provided array of notes (without chart context). line and chart context will be null casts — prefer run when a chart is available.

      Parameters

      Returns number

      The number of notes that were processed.

    • Delete all notes that match the current conditions from the chart. Process functions are NOT called — only conditions are evaluated.

      Parameters

      Returns number

      The number of notes deleted.