From: Ian Hulin Date: Mon, 21 Dec 2009 23:17:49 +0000 (+0000) Subject: Fix Tracker 918 X-Git-Tag: release/2.13.10-1~108 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5e9cdc46c2bb17e280ec006781b002cf856aefdb;p=lilypond.git Fix Tracker 918 Add extra RemoveEmpty*StaffContext functions to support "Frenched" scores with DrumStaff, TabStaff and RhythmicStaff staves. Add new definitions in ly/engraver-int.ly and new regression tests. --- diff --git a/input/regression/hara-kiri-drumstaff.ly b/input/regression/hara-kiri-drumstaff.ly new file mode 100644 index 0000000000..478d23e695 --- /dev/null +++ b/input/regression/hara-kiri-drumstaff.ly @@ -0,0 +1,48 @@ +\version "2.13.10" +\header { + texidoc = + + " Hara-kiri staves are suppressed if they are empty. This +example really contains three drum staves, but as it progresses, empty ones +are removed: this example has three staves, but some of them +disappear: note how the 2nd line only has the bar number 2. (That the +bar number is printed might be considered a bug, however, the scenario +of all staves disappearing does not happen in practice.) + +Any staff brackets and braces are removed, both in the single staff +and no staff case. +" + +} + +\layout { + ragged-right = ##t + \context { + \RemoveEmptyDrumStaffContext + } +} + +\transpose c c'' +\context StaffGroup << + \new DrumStaff + \drummode { + sn4 sn sn sn \break + s1 \break + sn4 sn sn sn \break + sn sn sn sn + } + \new DrumStaff + \drummode { + hh4 hh hh hh + s1 + s1 + s1 + } + \new DrumStaff + \drummode { + bd4 bd bd bd + s1 + bd4 bd bd bd + s1 + } +>> diff --git a/input/regression/hara-kiri-percent-repeat.ly b/input/regression/hara-kiri-percent-repeat.ly index d1ce10f1cd..847e93c688 100644 --- a/input/regression/hara-kiri-percent-repeat.ly +++ b/input/regression/hara-kiri-percent-repeat.ly @@ -1,16 +1,22 @@ +\version "2.13.10" + \header { - texidoc = "Staves with percent repeats are not killed." + texidoc = "Staves, RhythmicStaves, TabStaves and DrumStaves + with percent repeats are not suppressed." } -\version "2.12.0" - << - \new Staff { c''1 c'' \break c'' c'' } - \new Staff \repeat percent 4 { c'1 } + \new Staff { c''1 c'' \break c'' c'' } + \new Staff \repeat percent 4 { c'1 } + \new TabStaff \repeat percent 4 { c1 } + \new DrumStaff \drummode { \repeat percent 4 { hh1 } } + \new RhythmicStaff \repeat percent 4 { c'1 } >> \layout { - \context { - \RemoveEmptyStaffContext - } -} + \context { \RemoveEmptyStaffContext } + \context { \RemoveEmptyRhythmicStaffContext } + \context { \RemoveEmptyDrumStaffContext } + \context { \RemoveEmptyTabStaffContext } + } + diff --git a/input/regression/hara-kiri-rhythmicstaff.ly b/input/regression/hara-kiri-rhythmicstaff.ly new file mode 100644 index 0000000000..fd6ccbdd5b --- /dev/null +++ b/input/regression/hara-kiri-rhythmicstaff.ly @@ -0,0 +1,44 @@ +\version "2.13.10" +\header { + texidoc = + + " Hara-kiri staves are suppressed if they are empty. This +example really contains three rhythmic staves, but as it progresses, empty ones +are removed: this example has three staves, but some of them +disappear: note how the 2nd line only has the bar number 2. (That the +bar number is printed might be considered a bug, however, the scenario +of all staves disappearing does not happen in practice.) + +Any staff brackets and braces are removed, both in the single staff +and no staff case. +" + +} + +\layout { + ragged-right= ##t + \context { + \RemoveEmptyRhythmicStaffContext + } +} + +\context StaffGroup << + \new RhythmicStaff { + c4 c c c \break + s1 \break + c4 c c c \break + c c c c + } + \new RhythmicStaff { + c4 c c c + s1 + s1 + s1 + } + \new RhythmicStaff { + c4 c c c + s1 + c4 c c c + s1 + } +>> diff --git a/input/regression/hara-kiri-tabstaff.ly b/input/regression/hara-kiri-tabstaff.ly new file mode 100644 index 0000000000..e5738ab876 --- /dev/null +++ b/input/regression/hara-kiri-tabstaff.ly @@ -0,0 +1,48 @@ +\version "2.13.10" + +\header { + texidoc = + + " Hara-kiri staves are suppressed if they are empty. This +example really contains three tab staves, but as it progresses, empty ones +are removed: this example has three staves, but some of them +disappear: note how the 2nd line only has the bar number 2. (That the +bar number is printed might be considered a bug, however, the scenario +of all staves disappearing does not happen in practice.) + +Any staff brackets and braces are removed, both in the single staff +and no staff case." + +} + +\layout { + ragged-right= ##t + \context { + \RemoveEmptyTabStaffContext + } +} + + +\context PianoStaff << + \new TabStaff { + c4 c c c \break + s1 \break + c4 c c c \break + c c c c + } + \new TabStaff { + d4 d d d + s1 + s1 + s1 + } + \new TabStaff { + e4 e e e + s1 + e4 e e e + s1 + } +>> + + + diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index d9860d9c6c..d5411cbe4f 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -16,7 +16,7 @@ %%%% You should have received a copy of the GNU General Public License %%%% along with LilyPond. If not, see . -\version "2.12.0" +\version "2.13.10" \context { \name "Global" @@ -451,7 +451,7 @@ printing of a single line of lyrics." } -RemoveEmptyStaffContext= \context { +RemoveEmptyStaffContext = \context { \Staff \remove "Axis_group_engraver" \consists "Hara_kiri_engraver" @@ -994,10 +994,24 @@ accommodated for typesetting a piece in mensural style." printKeyCancellation = ##f } +RemoveEmptyDrumStaffContext = \context { + \DrumStaff + \remove "Axis_group_engraver" + \override VerticalAxisGroup #'remove-empty = ##t + \consists "Hara_kiri_engraver" +} -RemoveEmptyRhythmicStaffContext= \context { +RemoveEmptyRhythmicStaffContext = \context { \RhythmicStaff \remove "Axis_group_engraver" \override VerticalAxisGroup #'remove-empty = ##t \consists "Hara_kiri_engraver" } + +RemoveEmptyTabStaffContext = \context { + \TabStaff + \remove "Axis_group_engraver" + \override VerticalAxisGroup #'remove-empty = ##t + \consists "Hara_kiri_engraver" +} +