]> git.donarmstrong.com Git - lilypond.git/commitdiff
move NullVoice back to Staff
authorKeith OHara <k-ohara5a5a@oco.net>
Sat, 6 Sep 2014 07:38:27 +0000 (00:38 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Mon, 24 Nov 2014 06:17:36 +0000 (22:17 -0800)
Uses of NullVoice have been established that depend on it producing
note-heads with pitch associated with a Staff.

lily/accidental-engraver.cc
ly/engraver-init.ly
ly/performer-init.ly
scm/define-context-properties.scm

index dde27348f8a501c2c4289aaaef00eee28f3954ad..9aa20975d9d0376694e0467579b02d5bf4f55186 100644 (file)
@@ -464,22 +464,20 @@ Accidental_engraver::acknowledge_rhythmic_head (Grob_info info)
   Stream_event *note = info.event_cause ();
   if (note
       && (note->in_event_class ("note-event")
-          || note->in_event_class ("trill-span-event")))
+          || note->in_event_class ("trill-span-event"))
+      // option to skip accidentals on string harmonics
+      && (to_boolean (get_property ("harmonicAccidentals"))
+          || info.grob ()->get_property ("style") != ly_symbol2scm ("harmonic"))
+      // ignore accidentals in non-printing voices like NullVoice
+      && !to_boolean (info.context ()->get_property ("nullAccidentals")))
     {
-      /*
-        string harmonics usually don't have accidentals.
-      */
-      if (info.grob ()->get_property ("style") != ly_symbol2scm ("harmonic")
-          || to_boolean (get_property ("harmonicAccidentals")))
-        {
-          Accidental_entry entry;
-          entry.head_ = info.grob ();
-          entry.origin_engraver_ = dynamic_cast<Engraver *> (info.origin_translator ());
-          entry.origin_ = entry.origin_engraver_->context ();
-          entry.melodic_ = note;
+      Accidental_entry entry;
+      entry.head_ = info.grob ();
+      entry.origin_engraver_ = dynamic_cast<Engraver *> (info.origin_translator ());
+      entry.origin_ = entry.origin_engraver_->context ();
+      entry.melodic_ = note;
 
-          accidentals_.push_back (entry);
-        }
+      accidentals_.push_back (entry);
     }
 }
 
index b904935f43ce3769f7cd62a89bd14d89c14ae1c8..18cc463f9fd75a8a6fcb457502e8e1e7250cbaa0 100644 (file)
@@ -99,6 +99,7 @@
   \defaultchild "Voice"
   \accepts "Voice"
   \accepts "CueVoice"
+  \accepts "NullVoice"
 
   \description "Handles clefs, bar lines, keys, accidentals.  It can contain
 @code{Voice} contexts."
@@ -785,9 +786,12 @@ context."
   \override NoteHead.X-extent = #(lambda (g)
     (ly:stencil-extent (ly:note-head::print g) X))
 
-  \omit Accidental
-  \omit AccidentalCautionary
-  \omit AccidentalSuggestion
+  % generate no accidentals
+  nullAccidentals = ##t
+
+  %% keep noteheads inside the staff
+  \consists "Pitch_squash_engraver"
+  squashedPosition = 0
 
   % the engravers that control the 'busy' flags for note-onsets and melismata
   \consists "Grob_pq_engraver"
index 297a40d2f5f867f868c7e4c147163ed91d4c51f6..5eb2572b70372ba121d694c923fcde10438ff666 100644 (file)
@@ -26,6 +26,7 @@
   \name Staff
   \accepts Voice
   \accepts CueVoice
+  \accepts NullVoice
   \defaultchild Voice
 
   \consists "Staff_performer"
index d630629228a6743560e2952e2c39e6458a75d210..498b8b2d02f3f150378edc00ff42b7584314b28d 100644 (file)
@@ -487,7 +487,10 @@ ChordNames context.")
 defined strings to full list of strings and fret numbers.
 Parameters: The context, a list of note events, a list of
 tabstring events, and the fretboard grob if a fretboard is desired.")
-
+     (nullAccidentals ,boolean? "The @code{Accidental_engraver}
+generates no accidentals for notes in contexts were this is set.
+In addition to supressing the printed accidental, this option removes
+any effect the note would have had on accidentals in other voices.")
 
      (ottavation ,markup? "If set, the text for an ottava spanner.
 Changing this creates a new text spanner.")