bug-lilypond
[Top][All Lists]
Advanced

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

Re: Chord tremolo bugs


From: Mats Bengtsson
Subject: Re: Chord tremolo bugs
Date: Sat, 04 May 2002 13:12:40 +0200

Hi,

I made a patch for the second of the bugs (chord tremolos
with a total duration of 2. (or 4. or 2.. or ...).

I have to finish some orchestral parts within a few weeks
where I'd really like to have nice looking chord tremolos, 
without the displaced flags and preferably with better
note spacing. Is it possible to fix it?

   /Mats

> Hi,
> 
> This example illustrates two bugs in the chord tremolo
> implementation. At least the flags misplacement is a new
> bug since 1.5.52.
> 
> \score{\notes\relative c'{
>   c1:32 | % Flags too far to the left
>   \repeat tremolo 16 {c32 e} g4 | % Flags too far to the left
>   \repeat tremolo 12 {c32 e} g4 | % Wrong note head, missing dot on c,e
> }}
> 
> Also, how difficult would it be to get the note spacing correct
> also for chord tremolos? 
> 
>   /Mats
> 
> 
> 
> _______________________________________________
> Bug-lilypond mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-lilypond

Generated by (address unknown),
>From = lilypond-1.5.54.mb1, To = lilypond-1.5.54.mb2

usage 

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.5.54.mb2.diff

Patches do not contain automatically generated files 
or (urg) empty directories, 
i.e., you should rerun autoconf, configure

diff -purN ../lilypond-1.5.54.mb1/ChangeLog ./ChangeLog
--- ../lilypond-1.5.54.mb1/ChangeLog    Wed Apr 24 20:00:32 2002
+++ ./ChangeLog Fri May  3 23:26:43 2002
@@ -1,3 +1,8 @@
+2002-05-03  Mats Bengtsson  <address@hidden>
+
+       * lily/chord-tremolo-engraver.cc (try_music): Handle chord
+       tremolos of dotted duration.
+
 2002-04-24  Mats Bengtsson  <address@hidden>
 
        * scripts/lilypond-book.py: Don't import pre for Python >= 2.2
diff -purN ../lilypond-1.5.54.mb1/VERSION ./VERSION
--- ../lilypond-1.5.54.mb1/VERSION      Wed Apr 24 20:00:39 2002
+++ ./VERSION   Fri May  3 23:16:47 2002
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
 PATCH_LEVEL=54
-MY_PATCH_LEVEL=mb1
+MY_PATCH_LEVEL=mb2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff -purN ../lilypond-1.5.54.mb1/lily/chord-tremolo-engraver.cc 
./lily/chord-tremolo-engraver.cc
--- ../lilypond-1.5.54.mb1/lily/chord-tremolo-engraver.cc       Tue Apr  2 
13:55:56 2002
+++ ./lily/chord-tremolo-engraver.cc    Fri May  3 23:25:20 2002
@@ -22,6 +22,7 @@
 #include "chord-tremolo-iterator.hh"
 #include "stem-tremolo.hh"
 #include "music-list.hh"
+#include "math.h"           // ceil
 
 /**
   This acknowledges repeated music with "tremolo" style.  It typesets
@@ -52,6 +53,7 @@ protected:
   Moment beam_start_location_;
 
   int note_head_i_;
+  int dots_i_;
 
   bool sequential_body_b_;
   Spanner * beam_p_;
@@ -71,6 +73,7 @@ Chord_tremolo_engraver::Chord_tremolo_en
   beam_p_  = finished_beam_p_ = 0;
   repeat_ =0;
   note_head_i_ = 0;
+  dots_i_ = 0;
   stem_tremolo_ = 0;
   sequential_body_b_ = false;
 }
@@ -89,8 +92,10 @@ Chord_tremolo_engraver::try_music (Music
       stop_mom_ = start_mom_ + l;
       sequential_body_b_ = dynamic_cast<Sequential_music*> (rp->body ());
 
-      // ugh. should generate dots, triplet beams.      
-      note_head_i_ = l.den () <? 4; 
+      // ugh. should generate triplet beams.
+      note_head_i_ = int (ceil (double(l.den ()) / l.num ()));
+      dots_i_ = intlog2 (1+l.num ()) -1 ; // 1->0, 3->1, 7->2
+      note_head_i_ = note_head_i_ <? 4; 
       return true;
     }
 
@@ -207,6 +212,17 @@ Chord_tremolo_engraver::acknowledge_grob
   if (repeat_ && Note_head::has_interface (info.grob_l_))
     {
       info.grob_l_->set_grob_property ("duration-log", gh_int2scm (intlog2 
(note_head_i_)));
+      if (dots_i_ > 0) 
+       {
+          Item * d = new Item (get_property ("Dots"));
+          Rhythmic_head::set_dots (info.grob_l_, d);
+          
+         d->set_grob_property ("dot-count", gh_int2scm (dots_i_));
+
+          d->set_parent (info.grob_l_, Y_AXIS);
+          announce_grob (d, SCM_EOL);
+         
+       }
     }
 }
 

reply via email to

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