On Thu, 9 Feb 2012 19:50:24 +0100
jakob lund <jakob.be...@gmail.com> wrote:

> 9. feb. 2012 19.25 skrev Pavel Roskin <pro...@gnu.org>:
> > On Thu, 9 Feb 2012 17:15:50 +0100
> > Nils <l...@nilsgey.de> wrote:
> >
> >> Hello,
> >>
> >> I like to work with full tuplet numbers because it makes it clear
> >> which version of quintuplet is meant (2:5 or 4:5).
> >>
> >> Since I don't like errors, however 'traditional' they may have
> >> become, I would like to change the "3:2" of a triplet in a more
> >> correct "2/3".
> >>
> >> How can I get this format into
> >>
> >> \override TupletNumber #'text = [...]   %old:
> >> #tuplet-number::calc-fraction-text
> 
> The original function is defined in scm/output-lib.scm, and can be
> modified easily:

Once I sent my reply, I realized that the poster was asking for
something more automatic.  So I started with
tuplet-number::calc-fraction-text and
tuplet-number::append-note-wrapper and reduced them to this:

{
  #(define ((tuplet-fraction) grob)
    (let ((ev (event-cause grob)))
      (markup
        (format #f "~a/~a"
          (ly:event-property ev 'numerator)
          (ly:event-property ev 'denominator)))))
  \override TupletNumber #'text = #(tuplet-fraction)
  \times 2/3 { c'4 e' g' }
}

-- 
Regards,
Pavel Roskin

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

Reply via email to