]> git.donarmstrong.com Git - lilypond.git/commitdiff
Simplify the NullVoice context
authorKeith OHara <k-ohara5a5a@oco.net>
Tue, 22 Jul 2014 06:40:52 +0000 (23:40 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Fri, 29 Aug 2014 05:10:22 +0000 (22:10 -0700)
issues 3834 3825 3734

input/regression/lyric-combine-nullvoice.ly [new file with mode: 0644]
ly/engraver-init.ly

diff --git a/input/regression/lyric-combine-nullvoice.ly b/input/regression/lyric-combine-nullvoice.ly
new file mode 100644 (file)
index 0000000..13e7c4f
--- /dev/null
@@ -0,0 +1,15 @@
+\version "2.19.11"
+\header {
+  texidoc ="Lyrics can be aligned to a @code{NullVoice} context,
+  which prints no notes, with the usual mechanisms for melismata."
+}
+
+\score { <<
+  \new Staff <<
+    { c''4. g'8 c''2 | g'4( f' g'2) } \\
+    { c'4 b c'8 e' g' e' | c'1 }
+    \new NullVoice = "nv" {
+      \autoBeamOff c4 r16 b,16~ b,8 c8[ e8 g8 e8] | g4( f4) g2 }
+  >>
+  \new Lyrics \lyricsto "nv" { free a -- lign -- ment }
+>> }
index ec34cd64c33fa1187504bfc9ebd02f5a14ec4768..06248161d6b3258e93ef47ef38ea76979a78827d 100644 (file)
@@ -772,54 +772,39 @@ context."
 \context {
   \name "NullVoice"
   \type "Engraver_group"
-
-  \description "Non-printing context, typically used for aligning
-lyrics in polyphonic situations, or with @code{\partcombine}."
+  \description "For aligning lyrics without printing notes"
 
   %% don't route anything out of here
   \alias "Staff"
   \alias "Voice"
 
-  %% all three are needed for ties to work with lyrics
+  % provide non-printing NoteHeads with proper extents for lyric alignment
   \consists "Note_heads_engraver"
-  \consists "Rhythmic_column_engraver"
-  \consists "Tie_engraver"
-
-  %% both are needed for melismas to work with \autoBeamOff
-  \consists "Beam_engraver"
-  \consists "Stem_engraver"
-
-  %% needed for slurs to work with lyrics
-  \consists "Slur_engraver"
-
+  \omit NoteHead
+  \override NoteHead.X-extent = #(lambda (g)
+    (ly:stencil-extent (ly:note-head::print g) X))
+  % rhythmic-head-interface needs Rhythmic_column_engraver, which we don't want
+  \override NoteHead.meta.interfaces = #(delete 'rhythmic-head-interface
+           (assoc-get 'interfaces
+                      (assoc-get 'meta
+                                 (assoc-get 'NoteHead
+                                            all-grob-descriptions))))
   %% keep noteheads inside the staff
   \consists "Pitch_squash_engraver"
   squashedPosition = 0
 
-  %% `\omit NoteHead' would give slur attachment errors
   \omit Accidental
+  \omit AccidentalCautionary
+  \omit AccidentalSuggestion
+
+  % the engravers that control the 'busy' flags for note-onsets and melismata
+  \consists "Grob_pq_engraver"
+  \consists "Tie_engraver"
+  \omit Tie
+  \consists "Beam_engraver"
   \omit Beam
-  \omit Dots
-  \omit Flag
-  \omit Rest
+  \consists "Slur_engraver"
   \omit Slur
-  \omit Stem
-  \omit Tie
-
-  %% let these take up space (for lyric extenders, etc.)
-  \override NoteHead.transparent = ##t
-  \override TabNoteHead.transparent = ##t
-
-  %% don't let notes shift
-  \override NoteHead.X-offset = 0
-  \override NoteColumn.ignore-collision = ##t
-
-  %% keep beams and stems inside the staff
-  \override Beam.positions = #'(1 . 1)
-  \override Stem.length = 0
-
-  %% prevent "weird stem size" warnings
-  \override Stem.direction = #UP
 }
 
 \context {