Bar index of a beat: 0 for the first full bar, negative inside a pickup.
Bars accumulate across meter changes, so the bar after a 4/4-to-3/4 change is the next bar and not the first bar of a new count.
Absolute position in quarter-note beats.
A single signature, or the piece's meter map.
The 0-based bar index.
import { barIndexAt, parseTimeSignature } from '@libraz/libcantus';const meters = [ { startBeat: 0, ts: parseTimeSignature('4/4') }, { startBeat: 8, ts: parseTimeSignature('3/4') },];barIndexAt(11, meters); // 3 Copy
import { barIndexAt, parseTimeSignature } from '@libraz/libcantus';const meters = [ { startBeat: 0, ts: parseTimeSignature('4/4') }, { startBeat: 8, ts: parseTimeSignature('3/4') },];barIndexAt(11, meters); // 3
Bar index of a beat: 0 for the first full bar, negative inside a pickup.
Bars accumulate across meter changes, so the bar after a 4/4-to-3/4 change is the next bar and not the first bar of a new count.