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

    Function metricWeight

    • Metric weight of a position within its bar, on a 0–3 scale: 3 the downbeat, 2 a secondary strong pulse, 1 any other main pulse, and 0 an off-pulse subdivision.

      The secondary strong pulse is the bar's midpoint in even simple/compound meters. For an additive/irregular meter with TimeSignature.grouping set (e.g. [2, 2, 3] for 7/8), each group's head pulse other than the downbeat is the secondary strong pulse instead; without a grouping every non-downbeat main pulse of such a meter weighs 1 (flat, evenly divided pulses).

      Parameters

      • beatInQuarters: number

        Absolute or in-bar quarter-note position.

      • ts: TimeSignature

        The time signature.

      Returns number

      The metric weight (0–3).

      If ts.grouping is present but is not a positive-integer list summing to pulsesPerBar.

      import { parseTimeSignature, metricWeight } from '@libraz/libcantus';
      const ts = parseTimeSignature('4/4');
      metricWeight(0, ts); // 3 (the downbeat)