On Sat, Oct 22, 2011 at 8:26 AM, Thomas Morley <
[email protected]> wrote:
>
>
> Hi Mike,
>
> your function doesn't work for me. I get a wrong output (with "2.14.2" and
> "2.15.13")
> ->attached png
>
>
Hi all,
The numbers fed into control-points should not be the absolute
X-coordinates. (The X of the left bound of the slur should be 0, rather
than the X reckoned against the system grob.)
So this will get you closer to a good result:
\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 0 (car pos))
(cons (/ (interval-length x-pos) 3) (+ (car pos) 0.5))
(cons (* (interval-length x-pos) 2/3) (+ (cdr pos) 0.5))
(cons (interval-length x-pos) (cdr pos)))))
\repeat unfold 10 \times 2/3 { a4 b4 c }
}
Best,
David
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user