lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simplify the NullVoice context (issue 117050043 by address@hidden)


From: k-ohara5a5a
Subject: Re: Simplify the NullVoice context (issue 117050043 by address@hidden)
Date: Sun, 27 Jul 2014 21:17:40 +0000

Reviewers: janek, dak,

Message:
On 2014/07/27 11:25:41, janek wrote:

https://codereview.appspot.com/117050043/diff/40001/input/regression/lyric-combine-nullvoice.ly#newcode15
input/regression/lyric-combine-nullvoice.ly:15: >> }
This regtest is nice, but as far as i can see it doesn't check whether
issue
3825 has been fixed - i.e. the output looks the same before and after
the change
in the code.

Oops. Putting the tie into the rhythm covered up the problem of issue
3825.
I have extended the test a little so that it demonstrates each of the
reported issues.


https://codereview.appspot.com/117050043/diff/40001/ly/engraver-init.ly#newcode787
ly/engraver-init.ly:787: \override NoteHead.meta.interfaces = #(delete
'rhythmic-head-interface
What about making NullVoice \accepted not by \Staff, but by \Score
(like
Devnull)?  From my test it seems that it would work and we wouldn't
have to care
about Rhythmic_column_engraver.

That works, unless people setting Lyrics move engravers around in ways
that I haven't considered.

It seems we need to make NoteHead objects with the proper extent so they
are fully equivalent to notes for Lyrics alignment, but invisible and
non-interacting with the rest of the layout.  Putting these NoteHeads in
the Score, where no other layout is looking for them, is simpler than
having the NoteHeads tell every other engraver "I am not the kind of
NoteHead that you are looking for."


https://codereview.appspot.com/117050043/diff/40001/ly/engraver-init.ly#newcode798
ly/engraver-init.ly:798: \omit AccidentalSuggestion
I think these are unneeded anyway.

So long as Accidental_engraver stays out of \Score.
We could keep some of these overrides just in the engravers are moved
around, but ket's test and review it without the defensive \overrides.

Description:
Simplify the NullVoice context

issues 3834 3825 3734

Please review this at https://codereview.appspot.com/117050043/

Affected files (+29, -62 lines):
  M Documentation/notation/vocal.itely
  A input/regression/lyric-combine-nullvoice.ly
  M ly/engraver-init.ly
  M ly/performer-init.ly


Index: Documentation/notation/vocal.itely
diff --git a/Documentation/notation/vocal.itely b/Documentation/notation/vocal.itely index 187e10566f2970b358bce44a92f543ae645e25b5..2a3f89d7eccb2c3f6d7ab3d79c1a6ce87d6b1077 100644
--- a/Documentation/notation/vocal.itely
+++ b/Documentation/notation/vocal.itely
@@ -1682,13 +1682,6 @@ words = \lyricmode { la __ la __ }
 >>
 @end lilypond

-The @code{NullVoice} context must be placed within a @code{Staff}
-context and contain notes that are already being displayed in that staff and that are also in the same octave. Otherwise the
address@hidden may interact with the printed voices in
-unexpected ways.  For example, arbitrary notes in the
address@hidden may cause accidentals to appear (or disappear) on
-the staff.
-
 This method also can be used with the @code{\partcombine}
 function, which does not allow lyrics on its own:

@@ -1724,23 +1717,13 @@ aligner = \relative { b'8( c d c) d( d d d) }
 words = \lyricmode { la __ la __ }

 \new ChoirStaff <<
-  \new Staff <<
-    \soprano
-    \new NullVoice = "aligner" \aligner
-  >>
+  \new Staff \soprano
+  \new NullVoice = "aligner" \aligner
   \new Lyrics \lyricsto "aligner" \words
   \new Staff \partcombine \altoOne \altoTwo
 >>
 @end lilypond

-However, note that in the second half of the measure above, the
-notes in the @code{NullVoice} context reflect the rhythm of the
-lower staff, but they do not deviate from the single pitch being
-displayed in the staff to which the @code{NullVoice} belongs.
-While not actually required in this particular example, it is a
-good idea in general to enter the notes in this way.
-
-
 @node Stanzas
 @subsection Stanzas

Index: 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 0000000000000000000000000000000000000000..0592dc4e409a1461fd1821b7773ccf963228a656
--- /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."
+}
+\paper { ragged-right = ##f }
+\score { <<
+  \new Staff <<
+    { c''4. g'8 c''2 | g'8( f' g'4)~ g'2 } \\
+    { c'4 b c'8 e' g' e' | c'1 }
+    \new NullVoice = "nv" {
+      \autoBeamOff c4 r16 b,8. c8[ e8 g8 e8] | g8( f g4)~ g2 }
+  >>
+  \new Lyrics \lyricsto "nv" { free a -- lign -- ment }
+>> }
Index: ly/engraver-init.ly
diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index ec34cd64c33fa1187504bfc9ebd02f5a14ec4768..e386ee45e91f4eb0a64d6c61190b2ff852ba6edd 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -99,7 +99,6 @@
   \defaultchild "Voice"
   \accepts "Voice"
   \accepts "CueVoice"
-  \accepts "NullVoice"

\description "Handles clefs, bar lines, keys, accidentals. It can contain
 @code{Voice} contexts."
@@ -578,6 +577,7 @@ automatically when an output definition (a @code{\\score} or
   \accepts "ChoirStaff"
   \accepts "PianoStaff"
   \accepts "Devnull"
+  \accepts "NullVoice"
   \accepts "NoteNames"
   \accepts "FiguredBass"

@@ -772,54 +772,26 @@ 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"
+  \omit NoteHead
+  \override NoteHead.X-extent = #(lambda (g)
+    (ly:stencil-extent (ly:note-head::print g) X))

-  %% both are needed for melismas to work with \autoBeamOff
+ % the engravers that control the 'busy' flags for note-onsets and melismata
+  \consists "Grob_pq_engraver"
+  \consists "Tie_engraver"
+  \omit Tie
   \consists "Beam_engraver"
-  \consists "Stem_engraver"
-
-  %% needed for slurs to work with lyrics
-  \consists "Slur_engraver"
-
-  %% keep noteheads inside the staff
-  \consists "Pitch_squash_engraver"
-  squashedPosition = 0
-
-  %% `\omit NoteHead' would give slur attachment errors
-  \omit Accidental
   \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 {
Index: ly/performer-init.ly
diff --git a/ly/performer-init.ly b/ly/performer-init.ly
index ecc97aedb72d9004dc6fbe0e84b96e6f1ffa95d6..297a40d2f5f867f868c7e4c147163ed91d4c51f6 100644
--- a/ly/performer-init.ly
+++ b/ly/performer-init.ly
@@ -26,7 +26,6 @@
   \name Staff
   \accepts Voice
   \accepts CueVoice
-  \accepts NullVoice
   \defaultchild Voice

   \consists "Staff_performer"
@@ -188,9 +187,6 @@
   \alias Staff
   \alias Voice
   %% needed for melismata
-  %% TODO: at least the tie performer likely does not work without the
-  %% Note_performer, but I don't know how to shut note output off in
-  %% MIDI.
   \consists "Tie_performer"
   \consists "Beam_performer"
   \consists "Slur_performer"
@@ -225,6 +221,7 @@
   \accepts TabStaff
   \accepts StaffGroup
   \accepts Devnull
+  \accepts NullVoice
   \accepts ChoirStaff
   \accepts RhythmicStaff
   \accepts ChordNames





reply via email to

[Prev in Thread] Current Thread [Next in Thread]