lilypond-user
[Top][All Lists]
Advanced

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

Re: Slur as TupletBracket


From: David Nalesnik
Subject: Re: Slur as TupletBracket
Date: Sat, 22 Oct 2011 09:36:06 -0500



On Sat, Oct 22, 2011 at 8:26 AM, Thomas Morley <address@hidden> 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

reply via email to

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