lilypond-user
[Top][All Lists]
Advanced

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

Re: Short TextSpanners do not follow beam slope


From: Nick Payne
Subject: Re: Short TextSpanners do not follow beam slope
Date: Thu, 02 Sep 2010 10:51:23 +1000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

On 02/09/10 08:37, Neil Puttock wrote:
On 1 September 2010 04:33, Nick Payne<address@hidden>  wrote:
When I look at commercially engraved guitar scores that I have, short text
spanners, such as string number indications, follow the slope of a beam. If
there are several of them along a sloping beam, they descend or ascend along
with the beam so that there is a constant spacing between each spanner and
the beam. Lilypond doesn't do this - if the stems are up, the calculation of
the vertical height of all spanners seems to be relative to the highest part
of the beam, even though some spanners are only above a lower part of the
beam. If the stems are down, then the spanners descend or ascend to be the
same spacing from the noteheads:
You could try tweaking the slope via

'(bound-details right Y)

though you'll also have to force the spanners closer to the beams to
compensate for the inflexible skylines.

With a bit of clever coding,it might be possible to generate the
correct bound-details informatio automatically (the code for tuplet
bracket sloping might provide some inspiration).
Actually, what I meant was not that the spanner line should slope to match the beam but that each spanner should be the same distance above the part of the beam vertically below it. The following example better illustrates things. The first text spanner is positioned about three staff units too high because it's height seems to be calculated from the highest part of the entire beam and not the highest part of the section of the beam that it spans:

\version "2.13.31"

string = #(define-music-function (parser location stringnum dirn shorten adjBreak adjEnd)
    (string? number? pair? number? number?)
#{
\once \override TextSpanner #'bound-details #'left #'text = \markup \bold { \teeny \concat { \circle { \finger $stringnum } " " } }
    \once \override TextSpanner #'font-shape = #'upright
    \once \override TextSpanner #'direction = #$dirn
    \once \override TextSpanner #'dash-period = #0.8
    \once \override TextSpanner #'dash-fraction = #0.6
    \once \override TextSpanner #'thickness = #0.8
\once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #(cons 0 (/ $dirn -2)) } \once \override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #CENTER \once \override TextSpanner #'bound-details #'left #'padding = #(car $shorten) \once \override TextSpanner #'bound-details #'right #'padding = #(cdr $shorten) \once \override TextSpanner #'bound-details #'right-broken #'padding = #$adjEnd \once \override TextSpanner #'bound-details #'left-broken #'X = #$adjBreak
    \once \override TextSpanner #'bound-details #'left-broken #'text = ##f
    \once \override TextSpanner #'bound-details #'right-broken #'text = ##f
#})

\relative c'' {
    \time 9/8
    \override StringNumber #'add-stem-support = ##t
f16 d b <g\3> <e\4> \string "5" #UP #'(0.25 . -0.75) #7 #0.5 c\startTextSpan c c c c c c\stopTextSpan f' d b <g\3> <e\4> \string "5" #UP #'(0.25 . -0.75) #7 #0.5 c-\tweak #'extra-offset #'(0 . -2.8)\startTextSpan c c c c c c\stopTextSpan
}

Nick

Attachment: test.preview.png
Description: PNG image


reply via email to

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