Time administration

Time is administered by the Timing_translator, which by default is to be found in the Score context. An alias, Timing, is added to the context in which the Timing_translator is placed. To ensure that the Timing alias is available, you may need to explicitly instantiate the containing context (such as Voice or Staff).

The following properties of Timing are used to keep track of timing within the score.

currentBarNumber

The current measure number. For an example showing the use of this property see Bar numbers.

measureLength

The length of the measures in the current time signature. For a 4/4 time this is 1, and for 6/8 it is 3/4. Its value determines when bar lines are inserted and how automatic beams should be generated.

measurePosition

This internal property is the current point in the current measure. When it reaches measureLength, it is reset to zero and currentBarNumber is incremented. measurePosition should not be set explicitly, but may be changed with the \partial command.

timing

If set to #t, the above variables are updated for every time step. When set to #f, the above variables keep their current values indefinitely.

Timing can be changed by setting any of these variables. In the next example, the default 4/4 time signature is printed, but measureLength is set to 5/4. At 4/8 through the third measure, the \partial command advances the measure position to leave only 5/8 remaining, which shortens that bar by 1/8. The next bar line then falls at 9/8 rather than 5/4.

\fixed c' {
  \override Score.BarNumber.break-visibility = #all-visible
  \set Timing.measureLength = #5/4
  c1 c4
  c1 c4
  c4 c \partial 8*5 b4 b b8
  c4 c1
}

[image of music]

As the example illustrates, \musicLength music computes the musical length of the given music. For example, \musicLength 8 is the length of an eighth note and \musicLength {8. 8 8} is the length of seven sixteenth notes.

See also

Notation Reference: Bar numbers, Unmetered music.

Snippets: Rhythms.

Internals Reference: Timing_translator, Score.


LilyPond Notation Reference v2.25.23 (development-branch).