RPE Chart Utils
    Preparing search index...

    Function preprocess

    • Pre-process a chart in-place: initialize BPM timings, synchronize event beat fields, ensure control node arrays are populated, and validate basic numeric fields.

      Call this after loading a chart with parseChart() before using any position or iterator functions. It is safe to call multiple times.

      Operations performed:

      1. Validates META.RPEVersion.
      2. Calls initBpmList to compute startTimeSec for every BPM entry.
      3. For each line: sets default control nodes, fixes NaN fields.
      4. For each event layer: normalises bezier params, sorts and syncs beats.
      5. For each extended event: sorts and syncs beats.
      6. For each note: syncs startBeat / endBeat from their time tuples.

      Parameters

      • chart: RpeJson

        The RPE chart to process (mutated in place).

      Returns RpeJson

      The same chart reference.

      const chart = parseChart(jsonString);
      preprocess(chart);
      // Now safe to call getLineState(), getChartStats(), etc.