]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix Tracker 918
authorIan Hulin <ian@hulin.org.uk>
Mon, 21 Dec 2009 23:17:49 +0000 (23:17 +0000)
committerNeil Puttock <n.puttock@gmail.com>
Mon, 21 Dec 2009 23:17:49 +0000 (23:17 +0000)
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.

input/regression/hara-kiri-drumstaff.ly [new file with mode: 0644]
input/regression/hara-kiri-percent-repeat.ly
input/regression/hara-kiri-rhythmicstaff.ly [new file with mode: 0644]
input/regression/hara-kiri-tabstaff.ly [new file with mode: 0644]
ly/engraver-init.ly

diff --git a/input/regression/hara-kiri-drumstaff.ly b/input/regression/hara-kiri-drumstaff.ly
new file mode 100644 (file)
index 0000000..478d23e
--- /dev/null
@@ -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
+  }
+>>
index d1ce10f1cddbc3ceb737057f354c877e961d38c5..847e93c688f0045a735b9af0ebea3f93ae2f584d 100644 (file)
@@ -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 (file)
index 0000000..fd6ccbd
--- /dev/null
@@ -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 (file)
index 0000000..e5738ab
--- /dev/null
@@ -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
+  }
+>>
+
+
+
index d9860d9c6c10731f5ba6aeda034c3004fda34e61..d5411cbe4ffb32493ad20132071f7bc94d860e19 100644 (file)
@@ -16,7 +16,7 @@
 %%%% You should have received a copy of the GNU General Public License
 %%%% along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 
-\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"
+}
+