Time administration - GNU LilyPond
Description: GNU LilyPond

Next: Proportional notation, Previous: Polymetric notation, Up: Contemporary notation

#### 8.4.2 Time administration

Time is administered by the Time_signature_engraver, which usually lives in the Score context. The bookkeeping deals with the following variables

`currentBarNumber`
  The measure number.
`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.
`measurePosition`
  The point within the measure where we currently are. This quantity is reset to 0 whenever it exceeds `measureLength`. When that happens, `currentBarNumber` is incremented.
`timing`
  If set to true, the above variables are updated for every time step. When set to false, the engraver stays in the current measure indefinitely.

Timing can be changed by setting any of these variables explicitly. In the next example, the 4/4 time signature is printed, but `measureLength` is set to 5/4. After a while, the measure is shortened by 1/8, by setting `measurePosition` to 7/8 at 2/4 in the measure, so the next bar line will fall at 2/4 + 3/8. The 3/8 arises because 5/4 normally has 10/8, but we have manually set the measure position to be 7/8 and 10/8 - 7/8 = 3/8.

>          \set Score.measureLength = #(ly:make-moment 5 4)
>          c1 c4
>          c1 c4
>          c4 c4
>          \set Score.measurePosition = #(ly:make-moment 7 8)
>          b8 b b
>          c4 c1

As the example illustrates, `ly:make-moment n m` constructs a duration of n/m of a whole note. For example, `ly:make-moment 1 8` is an eighth note duration and `ly:make-moment 7 16` is the duration of seven sixteenths notes.

This page is for LilyPond-2.8.8 (stable-branch).

Other languages: English.
Using automatic language selection.