Here is a simple piano staff.
\version "2.4.0" upper = \relative c'' { \clef treble \key c \major \time 4/4 a b c d } lower = \relative c { \clef bass \key c \major \time 4/4 a2 c } \score { \context PianoStaff << \set PianoStaff.instrument = "Piano " \context Staff = upper \upper \context Staff = lower \lower >> \layout { } \midi { \tempo 4=60 } }
Here is a typical song format: one staff with the melody and lyrics, with piano accompaniment underneath.
\version "2.4.0" melody = \relative c'' { \clef treble \key c \major \time 4/4 a b c d } text = \lyricmode { Aaa Bee Cee Dee } upper = \relative c'' { \clef treble \key c \major \time 4/4 a b c d } lower = \relative c { \clef bass \key c \major \time 4/4 a2 c } \score { << \context Voice = mel { \autoBeamOff \melody } \lyricsto mel \new Lyrics \text \context PianoStaff << \context Staff = upper \upper \context Staff = lower \lower >> >> \layout { \context { \RemoveEmptyStaffContext } } \midi { \tempo 4=60 } }
Instead of having a full staff for the melody and lyrics, you can place the lyrics between the piano staff (and omit the separate melody staff).
\version "2.4.0" upper = \relative c'' { \clef treble \key c \major \time 4/4 a b c d } lower = \relative c { \clef bass \key c \major \time 4/4 a2 c } text = \lyricmode { Aaa Bee Cee Dee } \score { \context GrandStaff << \context Staff = upper { \context Voice = singer \upper } \lyricsto "singer" \new Lyrics \text \context Staff = lower << \clef bass \lower >> >> \layout { \context { \GrandStaff \accepts "Lyrics" } \context { \Lyrics \consists "Bar_engraver" } } \midi { \tempo 4=60 } }
Many piano scores have the dynamics centered between the two staffs. This requires a bit of tweaking to implement, but since the template is right here, you don't have to do the tweaking yourself.
\version "2.4.0" upper = \relative c'' { \clef treble \key c \major \time 4/4 a b c d } lower = \relative c { \clef bass \key c \major \time 4/4 a2 c } dynamics = { s2\fff\> s4 s\!\pp } pedal = { s2\sustainDown s2\sustainUp } \score { \context PianoStaff << \context Staff=upper \upper \context Dynamics=dynamics \dynamics \context Staff=lower << \clef bass \lower >> \context Dynamics=pedal \pedal >> \layout { \context { \type "Engraver_group_engraver" \name Dynamics \alias Voice % So that \cresc works, for example. \consists "Output_property_engraver" minimumVerticalExtent = #'(-1 . 1) pedalSustainStrings = #'("Ped." "*Ped." "*") pedalUnaCordaStrings = #'("una corda" "" "tre corde") \consists "Piano_pedal_engraver" \consists "Script_engraver" \consists "Dynamic_engraver" \consists "Text_engraver" \override TextScript #'font-size = #2 \override TextScript #'font-shape = #'italic \override DynamicText #'extra-offset = #'(0 . 2.5) \override Hairpin #'extra-offset = #'(0 . 2.5) \consists "Skip_event_swallow_translator" \consists "Axis_group_engraver" } \context { \PianoStaff \accepts Dynamics \override VerticalAlignment #'forced-distance = #7 } } \midi { \context { \type "Performer_group_performer" \name Dynamics \consists "Piano_pedal_performer" \consists "Span_dynamic_performer" \consists "Dynamic_performer" } \context { \PianoStaff \accepts Dynamics } } }
This page is for LilyPond-2.5.11 (development-branch).