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