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:

%=================================
\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
\string "1" #UP #'(0.25 . -0.75) #7 #0.5 c'16\startTextSpan b\stopTextSpan
    \string "2" #UP #'(0.25 . -0.75) #7 #0.5 a\startTextSpan g\stopTextSpan
    \string "3" #UP #'(0.25 . -0.75) #7 #0.5 f\startTextSpan e\stopTextSpan
\string "4" #UP #'(0.25 . -0.75) #7 #0.5 c\startTextSpan b\stopTextSpan
    \string "5" #UP #'(0.25 . -0.75) #7 #0.5 a\startTextSpan g\stopTextSpan
    \string "6" #UP #'(0.25 . -0.75) #7 #0.5 f\startTextSpan e\stopTextSpan
\string "6" #UP #'(0.25 . -0.75) #7 #0.5 e\startTextSpan f\stopTextSpan
    \string "5" #UP #'(0.25 . -0.75) #7 #0.5 g\startTextSpan a\stopTextSpan
    \string "4" #UP #'(0.25 . -0.75) #7 #0.5 b\startTextSpan c\stopTextSpan
}
%=================================

Nick

<<attachment: test.preview.png>>

_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to