]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/centered-measure-numbers.ly
Imported Upstream version 2.18.2
[lilypond.git] / Documentation / snippets / new / centered-measure-numbers.ly
1 \version "2.17.7"
2
3 \header {
4   lsrtags = "contexts-and-engravers, repeats, staff-notation"
5
6   texidoc = "
7 Scores of large ensemble works often have bar numbers placed beneath the
8 system, centered horizontally on the measure's extent.  This snippet shows
9 how the @code{Measure_counter_engraver} may be used to simulate this
10 notational practice.  Here, the engraver has been added to a @code{Dynamics}
11 context.
12
13 "
14
15   doctitle = "Centered measure numbers"
16 }
17
18 \layout {
19   \context {
20     \Dynamics
21     \consists #Measure_counter_engraver
22     \override MeasureCounter.direction = #DOWN
23     \override MeasureCounter.font-encoding = #'latin1
24     \override MeasureCounter.font-shape = #'italic
25     % to control the distance of the Dynamics context from the staff:
26     \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = #2
27   }
28   \context {
29     \Score
30     \remove "Bar_number_engraver"
31   }
32 }
33
34 pattern = \repeat unfold 7 { c'4 d' e' f' }
35
36 \new StaffGroup <<
37   \new Staff {
38     \pattern
39   }
40   \new Staff {
41     \pattern
42   }
43   \new Dynamics {
44     \startMeasureCount
45     s1*7
46     \stopMeasureCount
47   }
48 >>