]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/snippets/new/piano-template-with-centered-dynamics.ly
Imported Upstream version 2.14.2
[lilypond.git] / Documentation / snippets / new / piano-template-with-centered-dynamics.ly
diff --git a/Documentation/snippets/new/piano-template-with-centered-dynamics.ly b/Documentation/snippets/new/piano-template-with-centered-dynamics.ly
new file mode 100644 (file)
index 0000000..70403a7
--- /dev/null
@@ -0,0 +1,53 @@
+\version "2.14.0"
+
+\header {
+  lsrtags = "expressive-marks, keyboards, template"
+  texidoc = "
+Many piano scores have the dynamics centered between the two staves.
+The @code{Dynamics} context, if placed between staves, will
+automatically position dynamics correctly.
+
+"
+  doctitle = "Piano template with centered dynamics"
+}
+
+global = {
+  \key c \major
+  \time 4/4
+}
+
+upper = \relative c'' {
+  \clef treble
+  a4 b c d
+}
+
+lower = \relative c {
+  \clef bass
+  a2 c
+}
+
+dynamics = {
+  s2\fff\> s4 s\!\pp
+}
+
+pedal = {
+  s2\sustainOn s\sustainOff
+}
+
+\score {
+  \new PianoStaff = "PianoStaff_pf" <<
+    \new Staff = "Staff_pfUpper" << \global \upper >>
+    \new Dynamics = "Dynamics_pf" \dynamics
+    \new Staff = "Staff_pfLower" << \global \lower >>
+    \new Dynamics = "pedal" \pedal
+  >>
+  \layout { }
+}
+
+\score {
+  \new PianoStaff = "PianoStaff_pf" <<
+    \new Staff = "Staff_pfUpper" << \global \upper \dynamics \pedal >>
+    \new Staff = "Staff_pfLower" << \global \lower \dynamics \pedal >>
+  >>
+  \midi { }
+}