Previous: Aligning to cadenzas, Up: Special rhythmic concerns


1.2.6.3 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.

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
The point within the measure where we currently are. This quantity is reset by subtracting measureLength whenever measureLength is reached or exceeded. 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 default 4/4 time signature is printed, but measureLength is set to 5/4. At 4/8 through the third measure, the measurePosition is advanced by 1/8 to 5/8, shortening that bar by 1/8. The next bar line then falls at 9/8 rather than 5/4.

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

[image of music]

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.

See also

This manual: Bar numbers, Unmetered music

Snippets: Rhythms.

Internals Reference: Timing_translator, Score

This page is for LilyPond-2.11.58 (development-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.

Your suggestions for the documentation are welcome.

Other languages: français, español.