]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/numbering-groups-of-measures.ly
Imported Upstream version 2.19.45
[lilypond.git] / Documentation / snippets / numbering-groups-of-measures.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.di.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.18.0"
8
9 \header {
10   lsrtags = "contexts-and-engravers, editorial-annotations, repeats, staff-notation"
11
12   texidoc = "
13 This snippet demonstrates the use of the
14 @code{Measure_counter_engraver} to number groups of successive
15 measures.  Any stretch of measures may be numbered, whether consisting
16 of repetitions or not.
17
18
19 The engraver must be added to the appropriate context.  Here, a
20 @code{Staff} context is used; another possibility is a @code{Dynamics}
21 context.
22
23
24 The counter is begun with @code{\\startMeasureCount} and ended with
25 @code{\\stopMeasureCount}.  Numbering will start by default with
26 @code{1}, but this behavior may be modified by overriding the
27 @code{count-from} property.
28
29
30 When a measure extends across a line break, the number will appear
31 twice, the second time in parentheses.
32
33 "
34   doctitle = "Numbering groups of measures"
35 } % begin verbatim
36
37 \layout {
38   \context {
39     \Staff
40     \consists #Measure_counter_engraver
41   }
42 }
43
44 \new Staff {
45   \startMeasureCount
46   \repeat unfold 7 {
47     c'4 d' e' f'
48   }
49   \stopMeasureCount
50   \bar "||"
51   g'4 f' e' d'
52   \override Staff.MeasureCounter.count-from = #2
53   \startMeasureCount
54   \repeat unfold 5 {
55     g'4 f' e' d'
56   }
57   g'4 f'
58   \bar ""
59   \break
60   e'4 d'
61   \repeat unfold 7 {
62     g'4 f' e' d'
63   }
64   \stopMeasureCount
65 }