RPE Chart Utils
    Preparing search index...

    Function getTimeSec

    • Convert a beat number to time in seconds using the BPM list.

      Finds the latest BPM change that starts at or before beat, then interpolates linearly from that change's reference time.

      Parameters

      • bpmList: Bpm[]

        Sorted array of BPM entries (must have been initialized with initBpmList).

      • beat: number

        Beat number.

      Returns number

      Time in seconds.

      // At 120 BPM, beat 4 takes exactly 2 seconds
      const bpmList = [{ bpm: 120, startBeat: 0, startTimeSec: 0, startTime: [0,0,1] }];
      getTimeSec(bpmList, 4); // 2.0