@cindex instrument names, short
Instrument names can be printed on the left side of staves in the
-@code{Staff} and @code{PianoStaff} contexts. The value of
+@code{Staff}, @code{PianoStaff}, @code{StaffGroup}, @code{GrandStaff}
+and @code{ChoirStaff} contexts. The value of
@code{instrumentName} is used for the first staff, and the value
of @code{shortInstrumentName} is used for all succeeding staves.
@cindex instrument names, adding to other contexts
To add instrument names to other contexts (such as
-@code{GrandStaff}, @code{ChoirStaff}, or @code{StaffGroup}),
+@code{ChordNames} or @code{FiguredBass}),
@code{Instrument_name_engraver} must be added to that context.
For details, see @ref{Modifying context plug-ins}.
--- /dev/null
+\version "2.13.47"
+\header {
+ texidoc="
+Instrument names can also be attached to staff groups.
+"
+}
+
+\paper {
+ left-margin = 3\cm
+}
+\layout {
+ ragged-right = ##t
+}
+
+
+\new StaffGroup \with { instrumentName = #"StaffGroup" } <<
+ \new PianoStaff \with { instrumentName = #"PianoStaff" } <<
+ \new Staff \with { instrumentName = #"Right" } { c''4 }
+ \new Staff \with { instrumentName = #"Left" } { \clef bass c4 }
+ >>
+
+ \new ChoirStaff \with { instrumentName = #"ChoirStaff" } <<
+ \new Staff { c''4 }
+ \new Staff { c''4 }
+ \new Staff { c''4 }
+ >>
+ \new GrandStaff \with { instrumentName = #"GrandStaff" } <<
+ \new Staff \with { instrumentName = #"I" } { c''4 }
+ \new Staff \with { instrumentName = #"II" } { \clef bass c4 }
+ >>
+ % Nested groups should not inherit the instrument name from the parent group
+ \new StaffGroup \with { instrumentName = #"nested group" } <<
+ \new Staff { c''4 }
+ \new StaffGroup <<
+ \new Staff { c''4 }
+ \new Staff { c''4 }
+ >>
+ >>
+>>
\consists "Font_size_engraver"
\consists "Instrument_name_engraver"
+ %% explicitly set instrument, so it is not inherited from the parent
+ instrumentName = #'()
+ shortInstrumentName = #'()
+
predefinedDiagramTable = #default-fret-table
}
%% explicitly set instrument, so we don't get
%% weird effects when doing instrument names for
%% piano staves
-
instrumentName = #'()
shortInstrumentName = #'()
\consists "Vertical_align_engraver"
topLevelAlignment = ##f
+ \consists "Instrument_name_engraver"
\consists "System_start_delimiter_engraver"
systemStartDelimiter = #'SystemStartBracket
+ %% explicitly set instrument, so it is not inherited from the parent
+ instrumentName = #'()
+ shortInstrumentName = #'()
vocalName = #'()
shortVocalName = #'()
\consists "Axis_group_engraver"
\consists "Ledger_line_engraver"
+ %% explicitly set instrument, so it is not inherited from the parent
+ instrumentName = #'()
+ shortInstrumentName = #'()
+
\accepts "Voice"
\accepts "CueVoice"
\defaultchild "Voice"
side, grouping the staves together. The bar lines of the
contained staves are connected vertically."
+ \consists "Instrument_name_engraver"
\consists "Span_bar_engraver"
\consists "Span_arpeggio_engraver"
\consists "System_start_delimiter_engraver"
systemStartDelimiter = #'SystemStartBrace
topLevelAlignment = ##f
+ %% explicitly set instrument, so it is not inherited from the parent
+ instrumentName = #'()
+ shortInstrumentName = #'()
\defaultchild "Staff"
\accepts "Staff"
\name "PianoStaff"
\alias "GrandStaff"
- \description "Just like @code{GrandStaff} but with support for
-instrument names at the start of each system."
+ \description "Just like @code{GrandStaff}, but the staves are only removed
+together, never separately."
- \consists "Instrument_name_engraver"
\consists "Vertical_align_engraver"
\consists "Keep_alive_together_engraver"
topLevelAlignment = ##f
\consists "Vertical_align_engraver"
topLevelAlignment = ##f
+ \consists "Instrument_name_engraver"
\consists "Span_bar_engraver"
\consists "Span_arpeggio_engraver"
\consists "Output_property_engraver"
systemStartDelimiter = #'SystemStartBracket
+ %% explicitly set instrument, so it is not inherited from the parent
+ instrumentName = #'()
+ shortInstrumentName = #'()
\consists "System_start_delimiter_engraver"
\consists "Instrument_name_engraver"
\consists "Font_size_engraver"
\consists "Hara_kiri_engraver"
+ %% explicitly set instrument, so it is not inherited from the parent
+ instrumentName = #'()
+ shortInstrumentName = #'()
\override VerticalAxisGroup #'remove-first = ##t
\override VerticalAxisGroup #'remove-empty = ##t