lilypond-devel
[Top][All Lists]
Advanced

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

Adds StemTremolo to the note column's element list. (issue 5067041)


From: mtsolo
Subject: Adds StemTremolo to the note column's element list. (issue 5067041)
Date: Mon, 19 Sep 2011 05:45:04 +0000

Reviewers: ,

Message:
Hey all,

While working on flags, I noticed that horizontal spacing changes when a
grob is part of a NoteColumn's element list.

I went back to StemTremolos and tested this out: run the code below with
and without this patch:

\relative c'' {
  \time 8/4
  \autoBeamOff
  \override NoteHead #'stencil = #(ly:make-stencil '() '(0 . 0) '(0 .
0))
  \override Score . PaperColumn #'stencil = #ly:paper-column::print
  \repeat unfold 8 { b4:32 }
}

You'll see that StemTremolos, when part of note columns, lead to more
space.

I'm still not sure why this is the case, but it seems that all things
that "look" like they're part of the note column should work similarly
in the spacing.

Cheers,
MS

Description:
Adds StemTremolo to the note column's element list.

Please review this at http://codereview.appspot.com/5067041/

Affected files:
  M lily/rhythmic-column-engraver.cc


Index: lily/rhythmic-column-engraver.cc
diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index ca767cc7af5bbfd68468dc7adb41d6eb73b9b423..ae8886675566c74ab3343688c8f99750c9b02273 100644
--- a/lily/rhythmic-column-engraver.cc
+++ b/lily/rhythmic-column-engraver.cc
@@ -56,6 +56,7 @@ class Rhythmic_column_engraver : public Engraver
   vector<Grob *> rheads_;
   Grob *stem_;
   Grob *flag_;
+  Grob *stem_tremolo_;
   Grob *note_column_;
   Grob *arpeggio_;

@@ -64,6 +65,7 @@ protected:

   DECLARE_ACKNOWLEDGER (stem);
   DECLARE_ACKNOWLEDGER (flag);
+  DECLARE_ACKNOWLEDGER (stem_tremolo);
   DECLARE_ACKNOWLEDGER (rhythmic_head);
   DECLARE_ACKNOWLEDGER (arpeggio);
   void process_acknowledged ();
@@ -75,6 +77,7 @@ Rhythmic_column_engraver::Rhythmic_column_engraver ()

   stem_ = 0;
   flag_ = 0;
+  stem_tremolo_ = 0;
   note_column_ = 0;
   arpeggio_ = 0;
 }
@@ -110,6 +113,8 @@ Rhythmic_column_engraver::process_acknowledged ()
         }
       if (flag_)
Pointer_group_interface::add_grob (note_column_, ly_symbol2scm ("elements"), flag_);
+//      if (stem_tremolo_)
+// Pointer_group_interface::add_grob (note_column_, ly_symbol2scm ("elements"), stem_tremolo_);
     }
 }

@@ -126,6 +131,12 @@ Rhythmic_column_engraver::acknowledge_flag (Grob_info i)
 }

 void
+Rhythmic_column_engraver::acknowledge_stem_tremolo (Grob_info i)
+{
+  stem_tremolo_ = i.grob ();
+}
+
+void
 Rhythmic_column_engraver::acknowledge_rhythmic_head (Grob_info i)
 {
   rheads_.push_back (i.grob ());
@@ -144,10 +155,12 @@ Rhythmic_column_engraver::stop_translation_timestep ()
   stem_ = 0;
   arpeggio_ = 0;
   flag_ = 0;
+  stem_tremolo_ = 0;
 }

 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, stem);
 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, flag);
+ADD_ACKNOWLEDGER (Rhythmic_column_engraver, stem_tremolo);
 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, rhythmic_head);
 ADD_ACKNOWLEDGER (Rhythmic_column_engraver, arpeggio);






reply via email to

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