@libraz/libcantus - v0.9.3
    Preparing search index...

    Function chordTimelineFromChords

    • Build a chord timeline from placed chords.

      Each chord spans from its startBeat to the next chord's startBeat; the last chord runs to totalBeats. Segments with no positive length (from duplicate onsets or a last chord at or past totalBeats) are dropped. at(beat) returns the covering segment's chord, or null when the beat lies outside every segment.

      Parameters

      • chords: ChordSpan[]

        Placed chords in time order.

      • totalBeats: number

        End of the timeline in beats.

      Returns ChordTimeline

      A queryable chord timeline.