diff options
author | Reinhold Kainhofer <reinhold@kainhofer.com> | 2011-01-25 17:59:02 +0100 |
---|---|---|
committer | Reinhold Kainhofer <reinhold@kainhofer.com> | 2011-01-28 14:46:54 +0100 |
commit | 8656e359d629aed6990bb8d8d3da8eac2d2c311e (patch) | |
tree | 47df82bd9673634c9f9a2105dd87a21f6e4e8616 | |
parent | a2eb9d0a93abab905d4d88c33921ee1b8b8cb67c (diff) |
Add the Instrument_name_engraver also to all group contexts
Also, make sure it is not inherited from the parent (in particular
in nested staff groups).
-rw-r--r-- | Documentation/notation/staff.itely | 5 | ||||
-rw-r--r-- | input/regression/instrument-name-groups.ly | 39 | ||||
-rw-r--r-- | ly/engraver-init.ly | 29 |
3 files changed, 67 insertions, 6 deletions
diff --git a/Documentation/notation/staff.itely b/Documentation/notation/staff.itely index 01861c2a14..5d718aa1fd 100644 --- a/Documentation/notation/staff.itely +++ b/Documentation/notation/staff.itely @@ -857,7 +857,8 @@ format cue notes are also described. @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. @@ -935,7 +936,7 @@ these settings, see @ref{\paper variables for shifts and indents}. @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}. diff --git a/input/regression/instrument-name-groups.ly b/input/regression/instrument-name-groups.ly new file mode 100644 index 0000000000..e5f8cfc4cc --- /dev/null +++ b/input/regression/instrument-name-groups.ly @@ -0,0 +1,39 @@ +\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 } + >> + >> +>> diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 5f3383ce12..7de70d3732 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -40,6 +40,10 @@ \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 } @@ -84,7 +88,6 @@ %% explicitly set instrument, so we don't get %% weird effects when doing instrument names for %% piano staves - instrumentName = #'() shortInstrumentName = #'() @@ -126,8 +129,12 @@ \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 = #'() @@ -175,6 +182,10 @@ contained staves are not connected vertically." \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" @@ -296,11 +307,15 @@ multiple voices on the same staff." 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" @@ -314,10 +329,9 @@ contained staves are connected vertically." \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 @@ -333,10 +347,14 @@ instrument names at the start of each system." \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" @@ -404,6 +422,9 @@ printing of a single line of lyrics." \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 |