]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/snippets/new/centered-measure-numbers.ly
Imported Upstream version 2.18.0
[lilypond.git] / Documentation / snippets / new / centered-measure-numbers.ly
diff --git a/Documentation/snippets/new/centered-measure-numbers.ly b/Documentation/snippets/new/centered-measure-numbers.ly
new file mode 100644 (file)
index 0000000..6fa6ee9
--- /dev/null
@@ -0,0 +1,48 @@
+\version "2.17.7"
+
+\header {
+  lsrtags = "contexts-and-engravers, repeats, staff-notation"
+
+  texidoc = "
+Scores of large ensemble works often have bar numbers placed beneath the
+system, centered horizontally on the measure's extent.  This snippet shows
+how the @code{Measure_counter_engraver} may be used to simulate this
+notational practice.  Here, the engraver has been added to a @code{Dynamics}
+context.
+
+"
+
+  doctitle = "Centered measure numbers"
+}
+
+\layout {
+  \context {
+    \Dynamics
+    \consists #Measure_counter_engraver
+    \override MeasureCounter.direction = #DOWN
+    \override MeasureCounter.font-encoding = #'latin1
+    \override MeasureCounter.font-shape = #'italic
+    % to control the distance of the Dynamics context from the staff:
+    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = #2
+  }
+  \context {
+    \Score
+    \remove "Bar_number_engraver"
+  }
+}
+
+pattern = \repeat unfold 7 { c'4 d' e' f' }
+
+\new StaffGroup <<
+  \new Staff {
+    \pattern
+  }
+  \new Staff {
+    \pattern
+  }
+  \new Dynamics {
+    \startMeasureCount
+    s1*7
+    \stopMeasureCount
+  }
+>>