X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fambitus-engraver.cc;h=2585bd8bc1c0fe00f9f55a85232e97ecb82cc7c1;hb=12f05ebf99e912dd94359f86d503ce8cbf1f9891;hp=a9f1d92f57001726213ea408d25efc7063527f57;hpb=a4ec82597adc902403060da9e85b763fb7f8d810;p=lilypond.git diff --git a/lily/ambitus-engraver.cc b/lily/ambitus-engraver.cc index a9f1d92f57..2585bd8bc1 100644 --- a/lily/ambitus-engraver.cc +++ b/lily/ambitus-engraver.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2002--2007 Juergen Reuter + (c) 2002--2009 Juergen Reuter Han-Wen Nienhuys in_event_class ("note-event")) { - Pitch pitch = *unsmob_pitch (nr->get_property ("pitch")); - Direction expand_dir = pitch_interval_.add_point (pitch); - if (expand_dir) - causes_[expand_dir] = nr; + SCM p = nr->get_property ("pitch"); + /* + If the engraver is added to a percussion context, + filter out unpitched note heads. + */ + if (!unsmob_pitch (p)) + return; + Pitch pitch = *unsmob_pitch (p); + Drul_array expands = pitch_interval_.add_point (pitch); + if (expands[UP]) + causes_[UP] = nr; + if (expands[DOWN]) + causes_[DOWN] = nr; } } @@ -133,7 +144,7 @@ Ambitus_engraver::finalize () { if (ambitus_ && !pitch_interval_.is_empty ()) { - Grob * accidental_placement = + Grob *accidental_placement = make_item ("AccidentalPlacement", accidentals_[DOWN]->self_scm ()); @@ -192,11 +203,19 @@ Ambitus_engraver::finalize () ADD_ACKNOWLEDGER (Ambitus_engraver, note_head); ADD_TRANSLATOR (Ambitus_engraver, - /* doc */ "", + /* doc */ + "", + /* create */ + "AccidentalPlacement " "Ambitus " + "AmbitusAccidental " "AmbitusLine " - "AmbitusNoteHead " - "AmbitusAccidental", - /* read */ "", - /* write */ ""); + "AmbitusNoteHead ", + + /* read */ + "", + + /* write */ + "" + );