]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stem-engraver.cc
* VERSION (MY_PATCH_LEVEL): make 1.7.0
[lilypond.git] / lily / stem-engraver.cc
index 07ff23e07eafa14633e9da1fe9276265cc0b8059..b1f3eb4b9957c5a26ba92dd7ce005b53fbb640c3 100644 (file)
@@ -79,14 +79,21 @@ Stem_engraver::acknowledge_grob (Grob_info i)
                the first and last (quarter) note bothe get one tremolo flag.
               */
              int requested_type = gh_scm2int (tremolo_req_->get_mus_property ("tremolo-type"));
-             
              SCM f = get_property ("tremoloFlags");
              if (!requested_type && gh_number_p (f))
                requested_type = gh_scm2int (f);
              else
                daddy_trans_->set_property ("tremoloFlags", gh_int2scm (requested_type));
 
-             if (requested_type)
+             int tremolo_flags = intlog2 (requested_type) - 2
+               - (duration_log > 2 ? duration_log - 2 : 0);
+             if (tremolo_flags <= 0)
+               {
+                 tremolo_req_->origin()->warning (_("tremolo duration is too long"));
+                 tremolo_flags = 0;
+               }
+
+             if (tremolo_flags)
                {
                  tremolo_ = new Item (get_property ("StemTremolo"));
                  announce_grob(tremolo_, tremolo_req_->self_scm());
@@ -96,11 +103,7 @@ Stem_engraver::acknowledge_grob (Grob_info i)
                    the tremolo-type minus the number of flags of the note
                    itself.
                   */
-                 int tremolo_flags = intlog2 (requested_type) - 2
-                   - (duration_log > 2 ? duration_log - 2 : 0);
-                 if (tremolo_flags < 0)
-                   tremolo_flags = 0;
-                 tremolo_->set_grob_property ("flag-count",
+                         tremolo_->set_grob_property ("flag-count",
                                                gh_int2scm (tremolo_flags));
                  tremolo_->set_parent (stem_, X_AXIS);
                }