\new PianoDynamics = "dynamics" \dynamics
". For the Schubert score, this looks like:
\new PianoStaff \with { instrumentName = "Piano" } << \new Staff = "right" \right \new PianoDynamics = "dynamics" \dynamics \new Staff = "left" { \clef bass \left } >>
% Everything below here is for the piano dynamics. % Define "PianoDynamics" context. \context { \type "Engraver_group" \name PianoDynamics \alias Voice \consists "Output_property_engraver" \consists "Script_engraver" \consists "New_dynamic_engraver" \consists "Dynamic_align_engraver" \consists "Text_engraver" \consists "Skip_event_swallow_translator" \consists "Axis_group_engraver" \override DynamicLineSpanner #'Y-offset = #0 \override TextScript #'font-size = #2 \override TextScript #'font-shape = #'italic \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1) } % Modify "PianoStaff" context to accept Dynamics context. \context { \PianoStaff \accepts PianoDynamics } % End of PianoDynamics code.This creates a "PianoDynamics" context, and modifies the "PianoStaff" context so that it will accept a "PianoDynamics" context.
dynamics = { % Dynamics go here. }This is where you will input the dynamics.