Skip to main content

Module time_signature

Module time_signature 

Source
Expand description

Time-signature representation and bars/beats/ticks conversion.

A TimeSignature is numerator/denominator (e.g. 4/4, 6/8). The sequencer measures absolute time in PPQ ticks (ticks per quarter note); this module maps an absolute tick position to a musical BarBeatTick address and back.

One “beat” is one note of the denominator’s value: a quarter note in 4/4, an eighth note in 6/8. Since PPQ counts ticks per quarter note, a beat spans ppq * 4 / denominator ticks. All fields are 0-indexed (bar 0, beat 0, tick 0 is the downbeat of the first bar); add 1 for musician-facing display.

Structs§

BarBeatTick
A musical position as (bar, beat, tick), all 0-indexed.
TimeSignature
A musical time signature numerator/denominator.