bug-lilypond
[Top][All Lists]
Advanced

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

Two smarter tuplet defaults concerning fraction-tuplet-formatter


From: Trevor Bača
Subject: Two smarter tuplet defaults concerning fraction-tuplet-formatter
Date: Sun, 19 Feb 2006 16:05:51 -0600

Hi folks,

2.7.35 looks great so far. I haven't found any additional
release-critical bugs that haven't already been reported and fixed.

So I thought I'd introduce two engraving standards that Lily doesn't
yet implement, but maybe should for 2.8. Both defaults should be very
straightforward to change (I think) and both cause actual engraving
errors. The conventions concern when to use #fraction-tuplet-formatter
as tupletNumberFormatFunction.

TUPLET CONVENTION 1. Consider the following:

%%% EXAMPLE 1A - notation impossible to rhythmically disambiguate %%%
\new Score <<
   \new RhythmicStaff {
      \time 7/8
      \times 5/3 {c'8 c'8 c'8}
      \times 2/3 {c'8 c'8 c'8}
   }
>>
%%% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Make sure to actually take a look at the resulting notation, because
the input is harmless.

Lily renders both "triplets" by default with a lone tuplet number "3".
This is an engraving error, but one that we're only likely recognize
if we work with a lot of tuplet. The primary convention for
interpreting tuplets (and the only one with which a larger number of
players are familiar) is something like "a lone number p is
interpreted as the ratio p:q where q is *the next integer power of 2
just less that p*". This is what causes us to interpret a lone "3" as
"3:2" instead of, say, "3:4" or "3:5".

That convention -- the "how to read a lone tuplet number" convention
-- works fine for the second "triplet" in 1a, but fails completely for
the first "triplet".

Why?

Because of that first convention (which covers tuplet denominators
that are integer powers of 2), there's an implicit second convention
that says "whenever you've got a tuplet ratio in the for p:q where q
is *NOT* an integer power of 2, make sure you print p:q as an explicit
fraction, (unless explicitly overriden the user)."

Here's the fix:

%%%%% EXAMPLE 1b - correct %%%%%%%%%%%%%%%%%%
\new Score <<
   \new RhythmicStaff {
      \time 7/8
      \once \set tupletNumberFormatFunction = #fraction-tuplet-formatter
      \times 5/3 {c'8 c'8 c'8}
      \times 2/3 {c'8 c'8 c'8}
   }
>>
%%%%% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%

So, very easy solution:

SMART TUPLET DEFAULT 1: by default, Lily should render tuplets of the
form p:q (with q *NOT* an integer power of 2) using
tupletNumberFormatFunction set equal to #fraction-tuplet-formatter.


Next up:

TUPLET CONVENTION 2. Consider the following different, but related, snippet:

%%% EXAMPLE 2A - notation impossible to rhythmically disambiguate %%%%
\new Score <<
   \new RhythmicStaff {
      \time 6/8
      \times 4/3 {c'8[ c'8 c'8]}
      \times 2/3 {c'8[ c'8 c'8]}
   }
>>
%%% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Once again, make sure to look at the actual resulting notation.

Here again it's impossible to tell the rhythm of any single note in
the measure, but this time for a different reason.

Here, the tuplet ratios are "3:4" and "3:2" which, happily, both have
tuplet denominators that are integer powers of 2 (ie, 2 and 4) ...
which is what makes this example different than the "3:5" in examples
1a and 1b.

So what's breaking? Well, there's another convention on the engraving
of tuplets that says something like "if you've got a tuplet ratio p:q
where p < q then make sure to engraver p:q as an explicit fraction
*even if q is an integer power of 2*." The reason is clear enough: the
usual interpretation for a missing q reads q as the first integer
power of 2 just *less* than p ... which is the opposite of our "3:4"
example where 4 is in the integer power of 2 just *more* than p.

The fix is once again to set tupletNumberFormatFunction to
#fraction-tuplet-formatter:

%%%% EXAMPLE 2B - correct %%%%%%%%%%%%%%%%%%%%%%%%
\new Score <<
   \new RhythmicStaff {
      \time 6/8
      \once \set tupletNumberFormatFunction = #fraction-tuplet-formatter
      \times 4/3 {c'8[ c'8 c'8]}
      \times 2/3 {c'8[ c'8 c'8]}
   }
>>
%%%% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

So another simple default:

SMART TUPLET DEFAULT 2: by default, Lily should render tuplets of the
for p:q (with p < q) using tupletNumberFormatFunction set equal to
#fraction-tuplet-formatter.


Anyway, that was a lot of writing to say "Lily should use
#fraction-tuplet-formatter when either q is *not* an integer power of
2 or when p < q, for any tuplet p:q." Maybe even more concise to say
"if you've got a tuplet ratio where q is *anything other than* the
integer power of 2 just *less* than p, you need to explicitly print
p:q with #fraction-tuplet-formatter".

Probably low priority since the workaround of setting
#fraction-tuplet-formatter is clear to folks who work with a lot of
tuplets. Nonetheless, hope this helps.


--
Trevor Bača
address@hidden

Attachment: 1a.png
Description: PNG image

Attachment: 1b.png
Description: PNG image

Attachment: 2a.png
Description: PNG image

Attachment: 2b.png
Description: PNG image


reply via email to

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