On 10/08/2012 01:03 AM, Reinhold Kainhofer wrote:
Actually, thinking of it, it would actually be quite simple to calculate the
displayed fraction with durations from the given durations and the tuplet
fraction (except that there is no way to distinguish 3:2 and 4:6).

(m*dur1):(n*dur2) = tuplet fraction

can be easily solved as
m/n = (tuplet fraction)*dur2/dur1

and then reduced to minimal m and n. This could then be displayed as
   m{dur1}:n{dur2}

Do you need to reduce to minimal m and n? If you have m and n as given, then you can say, "OK, what's the total 'interior' duration of this tuplet divided by m, what's the total 'exterior' duration of this tuplet divided by n?"

In both cases that should come out as a "standard" note (1, 2, 4, 8, 16, ... or their dotted equivalents). If we take the simple case, it should be identical for both divisions, and you could throw a warning or error if it's not.

That probably covers most use-cases, since I don't think there's really a lot of m{dur1}:n{dur2} about in reality; m{dur1}:{dur2}, maybe.


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to