On Thu, 30 Mar 2006 10:55, Han-Wen Nienhuys wrote:
> Joe Neeman wrote:
> I've just realised that I caused a regression for tremolos 
> > on whole notes. I'll fix that today.
>
> Please do.
Here we are:

2006-03-30  Joe Neeman  <[EMAIL PROTECTED]>
    * lily/stem-tremolo.cc (print): for whole notes (and breves, etc.)
    position the tremolo based on the position of the notehead.

    * input/regression/stem-tremolo.ly: add example of unbeamed eighth
    notes and update the texidoc line with the new positioning rules.
>
> >> Can you look at the regtests
> >> stem-tremolos.ly and stem-tremolo-position.ly (your file), and refactor
> >> them so they don't have overlaps?
> >
> > For some reason I didn't find the stem-tremolos.ly test when I first went
> > looking for regressions... maybe I can just combine them into one file?
> > There are only one or two examples that are in the new regression test
> > and not in the old one.
>
> Suer. Don't forget to copy the relevant descriptions.
Index: lily/stem-tremolo.cc
===================================================================
RCS file: /sources/lilypond/lilypond/lily/stem-tremolo.cc,v
retrieving revision 1.100
diff -u -r1.100 stem-tremolo.cc
--- lily/stem-tremolo.cc	29 Mar 2006 15:41:44 -0000	1.100
+++ lily/stem-tremolo.cc	30 Mar 2006 07:18:47 -0000
@@ -175,6 +175,7 @@
 
   Spanner *beam = Stem::get_beam (stem);
   Direction stemdir = get_grob_direction (stem);
+  bool whole_note = Stem::duration_log (stem) <= 0;
   if (stemdir == 0)
     stemdir = UP;
 
@@ -183,8 +184,11 @@
     ? Beam::get_beam_translation (beam)
     : 0.81;
 
+  /* for a whole note, we position relative to the notehead, so we want the
+     stencil aligned on the flag closest to the head */
+  Direction stencil_dir = whole_note ? -stemdir : stemdir;
   Stencil mol = raw_stencil (me, robust_scm2double (me->get_property ("slope"),
-						    0.25), stemdir);
+						    0.25), stencil_dir);
 
   Interval mol_ext = mol.extent (Y_AXIS);
   Real ss = Staff_symbol_referencer::staff_space (me);
@@ -207,6 +211,14 @@
       if (stemdir == UP)
         end_y -= stemdir * beam_translation * 0.5;
     }
+  if (whole_note)
+    {
+      /* we shouldn't position relative to the end of the stem since the stem
+         is invisible */
+      vector<int> nhp = Stem::note_head_positions (stem);
+      Real note_head = (stemdir == UP ? nhp.back () : nhp[0]);
+      end_y = note_head + stemdir * 2.0;
+    }
   mol.translate_axis (end_y, Y_AXIS);
 
   return mol.smobbed_copy ();
Index: input/regression/stem-tremolo.ly
===================================================================
RCS file: /sources/lilypond/lilypond/input/regression/stem-tremolo.ly,v
retrieving revision 1.35
diff -u -r1.35 stem-tremolo.ly
--- input/regression/stem-tremolo.ly	16 Mar 2006 14:53:03 -0000	1.35
+++ input/regression/stem-tremolo.ly	30 Mar 2006 07:18:47 -0000
@@ -5,7 +5,13 @@
 Stem tremolos or rolls are tremolo signs that look like beam segments
 crossing stems.  If the stem is in a beam, the tremolo must be parallel
 to the beam.  If the stem is invisible (e.g. on a whole note), the
-tremolo must be centered on the note.
+tremolo must be centered on the note. If the note has a flag (eg. an
+unbeamed 8th note), the tremolo should be shortened if the stem is up
+and tilted extra if the stem is down.
+
+The tremolos should be positioned a fixed distance from the end of the
+stems unless there is no stem, in which case they should be positioned
+a fixed distance from the note head.
 "
 }
 
@@ -27,7 +33,7 @@
   c,16:32 c: c c a16:32 a: a a
   c8:16 g: d: a:
   c8:32 f: b: e:
-  \transpose c c { f''8:256[ f'8: f'':] }
+  f8:256[ f,8: f':] f: \noBeam f,,: \noBeam c16:32 \noBeam c'':
 }
 
 
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to