]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4333: Cue notes should not be included in ambitus
authorDavid Kastrup <dak@gnu.org>
Sat, 11 Apr 2015 16:35:47 +0000 (18:35 +0200)
committerDavid Kastrup <dak@gnu.org>
Sun, 19 Apr 2015 09:43:37 +0000 (11:43 +0200)
This works by adding a boolean `ignore-ambitus' property to the
`note-head-interface'.

input/regression/ambitus-cue.ly
lily/ambitus-engraver.cc
lily/note-head.cc
ly/engraver-init.ly
scm/define-grob-properties.scm
scm/define-grobs.scm

index 83b10e3ac73b6a09e475118dd21ac6df1a7762dc..bf6f6fc990bf7bf353b7947c666b91800a49142d 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.16.0"
+\version "2.19.19"
 
 \header {
   texidoc = "Ambitus for pieces beginning with @code{\\cueDuringWithClef}.
@@ -8,6 +8,9 @@ a cue is frequently in a different clef, so the
 @code{\\cueDuringWithClef} command is handy.  Using this command at
 the beginning of a piece should leave the ambitus displayed based
 on the main clef.
+
+An @code{Ambitus_engraver} should ignore notes in @code{CueVoice}
+contexts.
 "
 }
 
@@ -21,7 +24,7 @@ on the main clef.
 
 \layout {
  \context {
-   \Voice
+   \Staff
    \consists "Ambitus_engraver"
  }
 }
index 0a76267c7edb3c58c36afb2f56a7b611e0ca0fd7..58716c3ccf795a1b9c6e3f6412ac06f4a43b2b67 100644 (file)
@@ -136,7 +136,8 @@ void
 Ambitus_engraver::acknowledge_note_head (Grob_info info)
 {
   Stream_event *nr = info.event_cause ();
-  if (nr && nr->in_event_class ("note-event"))
+  if (nr && nr->in_event_class ("note-event")
+      && !to_boolean (info.grob ()->get_property ("ignore-ambitus")))
     {
       SCM p = nr->get_property ("pitch");
       /*
index 89c0047c0f4f30ce0dfc45da774ca75e3d488fca..3c6dc827631566aa25e3ed4e872d2d36bd61a4fd 100644 (file)
@@ -207,6 +207,7 @@ ADD_INTERFACE (Note_head,
                "duration-log "
                "note-names "
                "accidental-grob "
+               "ignore-ambitus "
                "glyph-name "
                "stem-attachment "
                "style "
index 12a5fcf2ed98c59dacdc742f9d0bc4a4e4fee1ca..5d695ebf5c7b1123977df2d5735c5ff3bd4a1683 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.19.16"
+\version "2.19.19"
 
 \context {
   \name "Global"
@@ -277,6 +277,7 @@ multiple voices on the same staff."
   \name "CueVoice"
   \alias "Voice"
   fontSize = #-4
+  \override NoteHead.ignore-ambitus = ##t
   \override Stem.length-fraction = #(magstep -4)
   \override Beam.length-fraction = #(magstep -4)
   \override Beam.beam-thickness = #0.35
index d0753500aa4b62b25a7db0480455a677cdbfc6d2..e35a05439d3b679901c88361d6c54aad5f1c8ded 100644 (file)
@@ -214,8 +214,9 @@ increments from this initial value.")
 dash structure.  Each @code{dash-element} has a starting t value,
 an ending t-value, a @code{dash-fraction}, and a @code{dash-period}.")
      (dash-fraction ,number? "Size of the dashes, relative to
-@code{dash-period}.  Should be between @code{0.1} and @code{1.0}
-(continuous line).  If set to @code{0.0}, a dotted line is produced")
+@code{dash-period}.  Should be between @code{0.1} and
+@code{1.0} (continuous line).  If set to @code{0.0}, a dotted line is
+produced")
      (dash-period ,number? "The length of one dash together with
 whitespace.  If negative, no line is drawn at all.")
      (default-direction ,ly:dir? "Direction determined by note head
@@ -530,6 +531,8 @@ the string will be assigned to the @code{id} attribute of a group (<g>)
 that encloses the stencils that comprise the grob.  In the Postscript
 backend, as there is no way to group items, the setting of the id property
 will have no effect.")
+     (ignore-ambitus ,boolean? "If set, don't consider this notehead
+for ambitus calculation.")
      (ignore-collision ,boolean? "If set, don't do note collision
 resolution on this @code{NoteColumn}.")
      (implicit ,boolean? "Is this an implicit bass figure?")
index 252733d1668e808660bb716e0c6004b488422ae1..f077c80168125629144f17465eb718bf2e425725 100644 (file)
      . (
         (duration-log . 2)
         (glyph-name . ,note-head::calc-glyph-name)
+        (ignore-ambitus . #t)
         (stencil . ,ly:note-head::print)
         (Y-offset . ,staff-symbol-referencer::callback)
         (Y-extent . ,grob::always-Y-extent-from-stencil)