Next: , Previous: Bar numbers, Up: Preparing parts


8.2.5 Instrument names

In an orchestral score, instrument names are printed at the left side of the staves.

This can be achieved by setting Staff.instrumentName and Staff.shortInstrumentName, or PianoStaff.instrumentName and PianoStaff.shortInstrumentName. This will print text before the start of the staff. For the first staff, instrumentName is used, for the following ones, shortInstrumentName is used.

     
     \set Staff.instrumentName = "Ploink "
     \set Staff.shortInstrumentName = "Plk "
     c1
     \break
     c''

[image of music]

You can also use markup texts to construct more complicated instrument names, for example

     
     \set Staff.instrumentName = \markup {
       \column { "Clarinetti"
                 \line { "in B" \smaller \flat } } }
     c''1

[image of music]

If you wish to center the instrument names, you must center all of them

     
     { <<
     \new Staff {
       \set Staff.instrumentName = \markup {
         \center-align { "Clarinetti"
           \line { "in B" \smaller \flat } } }
       c''1
     }
     \new Staff {
       \set Staff.instrumentName = \markup{ \center-align { Vibraphone }}
       c''1
     }
     >>
     }

[image of music]

For longer instrument names, it may be useful to increase the indent setting in the \layout block.

To center instrument names while leaving extra space to the right,

     
     \new StaffGroup \relative
     <<
       \new Staff {
         \set Staff.instrumentName = \markup { \hcenter-in #10 "blabla" }
         c1 c1
       }
       \new Staff {
         \set Staff.instrumentName = \markup { \hcenter-in #10 "blo" }
         c1 c1
       }
     >>

[image of music]

To add instrument names to other contexts (such as GrandStaff, ChoirStaff, or StaffGroup), the engraver must be added to that context.

\layout{
  \context {\GrandStaff \consists "Instrument_name_engraver"}
}

More information about adding and removing engravers can be found in Modifying context plug-ins.

Instrument names may be changed in the middle of a piece,

     
     \set Staff.instrumentName = "First"
     \set Staff.shortInstrumentName = "one"
     c1 c c c \break
     c1 c c c \break
     \set Staff.instrumentName = "Second"
     \set Staff.shortInstrumentName = "two"
     c1 c c c \break
     c1 c c c \break

[image of music]

See also

Program reference: InstrumentName.


Next: , Previous: Bar numbers, Up: Preparing parts

This page is for LilyPond-2.10.33 (stable-branch).

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