|
From: | address@hidden |
Subject: | Re: Slur as TupletBracket |
Date: | Sat, 22 Oct 2011 11:29:14 +0200 |
On Oct 22, 2011, at 1:44 AM, Thomas Morley wrote: Hi Mke 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 |
[Prev in Thread] | Current Thread | [Next in Thread] |