Am Montag, 25. Februar 2008 schrieb Reinhold Kainhofer:
> Am Sonntag, 23. Dezember 2007 schrieb Reinhold Kainhofer:
> > Hi,
> > Schubert's Stabat Mater (D.383) contains lots of measures (3/4 time),
> > where each beat is a eighth-tremolo using an additional triplet, ie. in
> > lilypond notation:
> > \times 2/3 { a4.:8 } \times 4/6 {a2.:8} | ....
> >
> > If I use this in lilypond, it gets the timing correct, but unfortunately
> > the tuplet (which appears only on a single printed note) does NOT display
> > any tuplet number...
>
> Okay, I now took a look at the code and in Tuplet_number::print, there is a
> hardcoded check that kills the tuplet number if the tuplet "does not take
> up any time". In my eyes, this is wrong, since then there is no visual
> indication of a tuplet and the timing appears totally wrong (e.g. three
> dotted quarter notes in a e/4 measure!).
>
> Attached is a patch, which fixes this problem by removing the check for
> zero-length in the tuplet number (but of course the tuplet bracket should
> not be shown for single-note tuplets).
Since I didn't get any response whether I could commit or not, here it is
again (with one small fix: Instead of killing the bracket for single-note
tuplets -- which also kills the number -- is simply need to hide the
bracket).
So, once again: Can I commit this to git or not?
Thanks,
Reinhold
--
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
* K Desktop Environment, http://www.kde.org, KOrganizer maintainer
* Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc
index cfae0b9..09d336b 100644
--- a/lily/tuplet-bracket.cc
+++ b/lily/tuplet-bracket.cc
@@ -280,12 +280,20 @@ Tuplet_bracket::print (SCM smob)
else if (bracket == ly_symbol2scm ("if-no-beam"))
bracket_visibility = !par_beam;
+ /* Don't print a tuplet bracket and number if no control-points were calculated */
SCM cpoints = me->get_property ("control-points");
if (scm_ilength (cpoints) < 2)
{
me->suicide ();
return SCM_EOL;
}
+ /* if the tuplet does not span any time, i.e. a single-note tuplet, hide
+ the bracket, but still let the number be displayed */
+ if (robust_scm2moment (me->get_bound (LEFT)->get_column ()->get_property ("when"), Moment (0))
+ == robust_scm2moment (me->get_bound (RIGHT)->get_column ()->get_property ("when"), Moment (0)))
+ {
+ bracket_visibility = false;
+ }
Drul_array<Offset> points;
points[LEFT] = ly_scm2offset (scm_car (cpoints));
@@ -686,16 +694,6 @@ Tuplet_bracket::calc_positions (SCM smob)
{
Spanner *me = unsmob_spanner (smob);
- /*
- Don't print if it doesn't span time.
- */
- if (robust_scm2moment (me->get_bound (LEFT)->get_column ()->get_property ("when"), Moment (0))
- == robust_scm2moment (me->get_bound (RIGHT)->get_column ()->get_property ("when"), Moment (0)))
- {
- me->suicide ();
- return SCM_EOL;
- }
-
Real dy = 0.0;
Real offset = 0.0;
calc_position_and_height (me, &offset, &dy);
diff --git a/lily/tuplet-number.cc b/lily/tuplet-number.cc
index 22d857b..78697ca 100644
--- a/lily/tuplet-number.cc
+++ b/lily/tuplet-number.cc
@@ -35,16 +35,6 @@ Tuplet_number::print (SCM smob)
return SCM_EOL;
}
- /*
- Don't print if it doesn't span time.
- */
- if (robust_scm2moment (tuplet->get_bound (LEFT)->get_column ()->get_property ("when"), Moment (0))
- == robust_scm2moment (tuplet->get_bound (RIGHT)->get_column ()->get_property ("when"), Moment (0)))
- {
- me->suicide ();
- return SCM_EOL;
- }
-
SCM stc_scm = Text_interface::print (smob);
Stencil *stc = unsmob_stencil (stc_scm);
_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel