Next: , Previous: Instantiating new staves, Up: Displaying staves


Grouping staves

Various contexts exist to group single staves together in order to form multi-stave systems. Each grouping context sets the style of the system start delimiter and the behavior of bar lines.

If no context is specified, the default properties will be used: the group is started with a vertical line, and the bar lines are not connected.

     
     <<
       \new Staff { c1 c }
       \new Staff { c1 c }
     >>

[image of music]

In the StaffGroup context, the group is started with a bracket and bar lines are drawn through all the staves.

     
     \new StaffGroup <<
       \new Staff { c1 c }
       \new Staff { c1 c }
     >>

[image of music]

In a ChoirStaff, the group starts with a bracket, but bar lines are not connected.

     
     \new ChoirStaff <<
       \new Staff { c1 c }
       \new Staff { c1 c }
     >>

[image of music]

In a GrandStaff, the group begins with a brace, and bar lines are connected between the staves.

     
     \new GrandStaff <<
       \new Staff { c1 c }
       \new Staff { c1 c }
     >>

[image of music]

The PianoStaff is identical to a GrandStaff, except that it supports printing the instrument name directly. For details, see Instrument names.

     
     \new PianoStaff <<
       \set PianoStaff.instrumentName = "Piano"
       \new Staff { c1 c }
       \new Staff { c1 c }
     >>

[image of music]

Each staff group context sets the property systemStartDelimiter to one of the following values: SystemStartBar, SystemStartBrace, or SystemStartBracket. A fourth delimiter, SystemStartSquare, is also available, but it must be explicitly specified.

Selected Snippets

Use square bracket at the start of a staff group

The system start delimiter SystemStartSquare can be used by setting it explicitly in a StaffGroup or ChoirStaffGroup context.

     
     \score {
       \new StaffGroup { << 
       \set StaffGroup.systemStartDelimiter = #'SystemStartSquare
         \new Staff { c'4 d' e' f' }
         \new Staff { c'4 d' e' f' }
       >> }
     }

[image of music]

Display bracket with only one staff in a system

If there is only one staff in one of the staff types ChoirStaff, InnerChoirStaff, InnerStaffGroup or StaffGroup, the bracket and the starting bar line will not be displayed as standard behavior. This can be changed by overriding the relevant properties, as demonstrated in this example.

Note that in contexts such as PianoStaff and GrandStaff where the systems begin with a brace instead of a bracket, another property has to be set, as shown on the second system in the example.

     
     \markup \column {
       \score {
         \new StaffGroup <<
           % Must be lower than the actual number of staff lines
           \override StaffGroup.SystemStartBracket #'collapse-height = #1
           \override Score.SystemStartBar #'collapse-height = #1
           \new Staff {
             c'1
           }
         >>
         \layout { }
       }
       \score {
         \new PianoStaff <<
           \override PianoStaff.SystemStartBrace #'collapse-height = #1
           \override Score.SystemStartBar #'collapse-height = #1
           \new Staff {
             c'1
           }
         >>
         \layout { }
       }
     }

[image of music]

Mensurstriche layout (bar lines between the staves)

The mensurstriche-layout where the bar lines do not show on the staves but between staves can be achieved with a StaffGroup instead of a ChoirStaff. The bar line on staves is blanked out by setting the transparent property.

     
     global = {
       \override Staff.BarLine #'transparent = ##t
       s1 s
       % the final bar line is not interrupted
       \revert Staff.BarLine #'transparent
       \bar "|."
     }
     \new StaffGroup \relative c'' {
       <<
         \new Staff { << \global { c1 c } >> }
         \new Staff { << \global { c c } >> }
       >>
     }

[image of music]

See also

Music Glossary: brace, bracket, grand staff.

Notation Reference: Instrument names.

Snippets: Staff notation.

Internals Reference: Staff, StaffGroup, ChoirStaff, GrandStaff, PianoStaff, SystemStartBar, SystemStartBrace, SystemStartBracket, SystemStartSquare.

This page is for LilyPond-2.11.58 (development-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.

Your suggestions for the documentation are welcome.

Other languages: français.