From 958d1e069079380c7a6cdc118f6b5b4e4a88239e Mon Sep 17 00:00:00 2001 From: Keith OHara Date: Mon, 21 Jul 2014 23:40:52 -0700 Subject: [PATCH] Simplify the NullVoice context issues 3834 3825 3734 --- input/regression/lyric-combine-nullvoice.ly | 15 ++++++ ly/engraver-init.ly | 55 ++++++++------------- 2 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 input/regression/lyric-combine-nullvoice.ly diff --git a/input/regression/lyric-combine-nullvoice.ly b/input/regression/lyric-combine-nullvoice.ly new file mode 100644 index 0000000000..13e7c4f23a --- /dev/null +++ b/input/regression/lyric-combine-nullvoice.ly @@ -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 } +>> } diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index ec34cd64c3..06248161d6 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -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 { -- 2.39.5