### 1.6.1 Displaying staves

This section describes the different methods of creating and grouping staves.

#### Instantiating new staves

Staves (singular: staff) are created with the `\new` or `\context` commands. For details, see Creating and referencing contexts.

The basic staff context is `Staff`:

>     \new Staff { c4 d e f }

The `DrumStaff` context creates a five-line staff set up for a typical drum set. Each instrument is shown with a different symbol. The instruments are entered in drum mode following a `\drummode` command, with each instrument specified by name. For details, see Percussion staves.

>     \new DrumStaff {
>       \drummode { cymc hh ss tomh }
>     }

`RhythmicStaff` creates a single-line staff that only displays the rhythmic values of the input. Real durations are preserved. For details, see Showing melody rhythms.

>     \new RhythmicStaff { c4 d e f }

`TabStaff` creates a tablature with six strings in standard guitar tuning. For details, see Default tablatures.

>     \new TabStaff { c4 d e f }

There are two staff contexts specific for the notation of ancient music: `MensuralStaff` and `VaticanaStaff`. They are described in Pre-defined contexts.

The `GregorianTranscriptionStaff` context creates a staff to notate modern Gregorian chant. It does not show bar lines.

>     \new GregorianTranscriptionStaff { c4 d e f e d }

New single staff contexts may be defined. For details, see Defining new contexts.

#### See also

Music Glossary: staff, staves.

Notation Reference: Creating and referencing contexts, Percussion staves, Showing melody rhythms, Default tablatures, Pre-defined contexts, Staff symbol, Gregorian chant contexts, Mensural contexts, Defining new contexts.

Snippets: Staff notation.

Internals Reference: Staff, DrumStaff, GregorianTranscriptionStaff, RhythmicStaff, TabStaff, MensuralStaff, VaticanaStaff, StaffSymbol.

#### 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 }
>     >>

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 }
>     >>

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 }
>     >>

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 }
>     >>

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 }
>     >>

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.

New staff group contexts may be defined. For details, see Defining new contexts.

#### 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 `ChoirStaff` context.

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

Display bracket with only one staff in a system

If there is only one staff in one of the staff types `ChoirStaff` or `StaffGroup`, by default the bracket and the starting bar line will not be displayed. This can be changed by overriding `collapse-height` to set its value to be less than the number of staff lines in the staff.

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.

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

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 = {
>       \hide Staff.BarLine
>       s1 s
>       % the final bar line is not interrupted
>       \undo \hide Staff.BarLine
>       \bar "|."
>     }
>     \new StaffGroup \relative c'' {
>       <<
>         \new Staff { << \global { c1 c } >> }
>         \new Staff { << \global { c c } >> }
>       >>
>     }

#### See also

Music Glossary: brace, bracket, grand staff.

Notation Reference: Instrument names, Defining new contexts.

Snippets: Staff notation.

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

#### Known issues and warnings

`PianoStaff` does not, by default, accept `ChordNames`.

#### Nested staff groups

Staff-group contexts can be nested to arbitrary depths. In this case, each child context creates a new bracket adjacent to the bracket of its parent group.

>     \new StaffGroup <<
>       \new Staff { c2 c | c2 c }
>       \new StaffGroup <<
>         \new Staff { g2 g | g2 g }
>         \new StaffGroup \with {
>           systemStartDelimiter = #'SystemStartSquare
>         }
>         <<
>           \new Staff { e2 e | e2 e }
>           \new Staff { c2 c | c2 c }
>         >>
>       >>
>     >>

New nested staff group contexts can be defined. For details, see Defining new contexts.

#### Selected Snippets

Nesting staves

The property `systemStartDelimiterHierarchy` can be used to make more complex nested staff groups. The command `\set StaffGroup.systemStartDelimiterHierarchy` takes an alphabetical list of the number of staves produced. Before each staff a system start delimiter can be given. It has to be enclosed in brackets and takes as much staves as the brackets enclose. Elements in the list can be omitted, but the first bracket takes always the complete number of staves. The possibilities are `SystemStartBar`, `SystemStartBracket`, `SystemStartBrace`, and `SystemStartSquare`.

>     \new StaffGroup
>     \relative c'' <<
>       \set StaffGroup.systemStartDelimiterHierarchy
>         = #'(SystemStartSquare (SystemStartBrace (SystemStartBracket a
>                                  (SystemStartSquare b)  ) c ) d)
>       \new Staff { c1 }
>       \new Staff { c1 }
>       \new Staff { c1 }
>       \new Staff { c1 }
>       \new Staff { c1 }
>     >>

#### See also

Notation Reference: Grouping staves, Instrument names, Defining new contexts.

Snippets: Staff notation.

Internals Reference: StaffGroup, ChoirStaff, SystemStartBar, SystemStartBrace, SystemStartBracket, SystemStartSquare.

#### Separating systems

If the number of systems per page changes from page to page it is customary to separate the systems by placing a system separator mark between them. By default the system separator is blank, but can be turned on with a `\paper` option.

>     \book {
>       \score {
>         \new StaffGroup <<
>           \new Staff {
>             \relative c'' {
>               c4 c c c
>               \break
>               c4 c c c
>             }
>           }
>           \new Staff {
>             \relative c'' {
>               c4 c c c
>               \break
>               c4 c c c
>             }
>           }
>         >>
>       }
>       \paper {
>         system-separator-markup = \slashSeparator
>         % following commands are needed only to format this documentation
>         paper-width = 100\mm
>         paper-height = 100\mm
>         tagline = ##f
>       }
>     }

#### See also

Notation Reference: Page layout.

Snippets: Staff notation.

其他语言：deutsch, español, français, italiano, 日本語。
About automatic language selection.

#### LilyPond — Notation Reference v2.18.2 (稳定分支).