lilypond-user
[Top][All Lists]
Advanced

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

Re: Slur as TupletBracket


From: Thomas Morley
Subject: Re: Slur as TupletBracket
Date: Sat, 22 Oct 2011 15:26:24 +0200

2011/10/22 address@hidden <address@hidden>

Hey Harm,
I compiled it against current master.  If your version of LilyPond doesn't have an X-positions property, you can assemble something that works like X-positions by getting the two spanner bonuds via ly:spanner-bound and then getting their relative coordinates.

\version "2.14.0"
\relative c'' {
 \override TupletBracket #'stencil = #ly:slur::print
 \override TupletBracket #'direction = #UP
 \override TupletNumber #'whiteout = ##t
 \override TupletNumber #'layer = #2
 \override TupletBracket #'layer = #1
 \override TupletBracket #'control-points =
#(lambda (grob)
  (let* ((b-l (ly:spanner-bound grob LEFT))
         (b-r (ly:spanner-bound grob RIGHT))
         (crf (ly:grob-common-refpoint b-l b-r X))
         (x-pos (cons (ly:grob-relative-coordinate b-l crf X) (ly:grob-relative-coordinate b-r crf X)))
         (pos (ly:grob-property grob 'positions)))
    (list (cons (car x-pos) (car pos))
          (cons (+ (car x-pos) (/ (interval-length x-pos) 3)) (+ (car pos) 0.5))
          (cons (+ (car x-pos) (* (interval-length x-pos) 2/3)) (+ (cdr pos) 0.5))
          (cons (cdr x-pos) (cdr pos)))))
\repeat unfold 10 \times 2/3 { a4 b4 c }
}

In 2.14.0 the TupletNumber Y-offset callback doesn't exist, so I've nixed it.  This messes with the tuplet number positioning, but you can write a positioning fixed based on the coordinates of the bracket.  To get the bracket, if the TupletNumber is `grob' in a function, use (ly:grob-object grob 'bracket).

Cheers,
MS

Hi Mike,

your function doesn't work for me. I get a wrong output (with "2.14.2" and "2.15.13")
->attached png

And I'm still puzzled why I can't find the 'X-positions-property in "2.15.13" define-grob-properties.scm. But it is described in http://kainhofer.com/~lilypond/Documentation/internals-big-page.html#user-backend-properties.

Cheers,
  Harm

Attachment: atest.png
Description: PNG image


reply via email to

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