4 lsrtags = "expressive-marks,keyboards,template"
6 Many piano scores have the dynamics centered between the two staves.
7 This requires a bit of tweaking to implement, but since the template is
8 right here, you don't have to do the tweaking yourself.
10 doctitle = "Piano template with centered dynamics"
18 upper = \relative c'' {
33 s2\sustainOn s\sustainOff
37 \new PianoStaff = "PianoStaff_pf" <<
38 \new Staff = "Staff_pfUpper" \upper
39 \new Dynamics = "Dynamics_pf" \dynamics
40 \new Staff = "Staff_pfLower" << \lower >>
41 \new Dynamics = "pedal" \pedal
45 % define Dynamics context
47 \type "Engraver_group"
50 \consists "Output_property_engraver"
51 \consists "Piano_pedal_engraver"
52 \consists "Script_engraver"
53 \consists "New_dynamic_engraver"
54 \consists "Dynamic_align_engraver"
55 \consists "Text_engraver"
56 \consists "Skip_event_swallow_translator"
57 \consists "Axis_group_engraver"
59 pedalSustainStrings = #'("Ped." "*Ped." "*")
60 pedalUnaCordaStrings = #'("una corda" "" "tre corde")
61 \override DynamicLineSpanner #'Y-offset = #0
62 \override TextScript #'font-size = #2
63 \override TextScript #'font-shape = #'italic
64 \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
66 % modify PianoStaff context to accept Dynamics context
75 \new PianoStaff = "PianoStaff_pf" <<
76 \new Staff = "Staff_pfUpper" << \global \upper \dynamics \pedal >>
77 \new Staff = "Staff_pfLower" << \global \lower \dynamics \pedal >>