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

    Function extractGrooveTemplate

    • Extract a groove template from a set of note events: for each grid slot, the average timing deviation from the quantized grid and the average velocity of events landing on it. Slots with no velocity-carrying event record velocity: null (the "unrecorded" sentinel); empty slots default to { timingOffset: 0, velocity: null }. The time signature is stored on the template so applyGrooveTemplate can verify the meter matches.

      Parameters

      • events: NoteEvent[]

        The (typically "groovy", human-played) events to analyze.

      • ts: TimeSignature

        The time signature, used to compute the bar length.

      • subdivision: number

        Grid resolution: equal grid steps per quarter-note beat.

      Returns GrooveTemplate

      The extracted groove template.