On Wed, Nov 18, 2009 at 3:39 PM, Nick Payne
<address@hidden <mailto:address@hidden>> wrote:
Following example shows a problem I have in a score with multiple
voices where I want the TextSpanner for a barre to be two bars
long. Because the actual notes in the two bars are split between
the voices, I have the \stopTextSpan on the silent eighth note at
the end of bar two in voiceOne, but it is terminating as if I had
it on the B flat at the start of the bar. In fact there is no
difference in the output between having the \stopTextSpan on the B
flat or s8. Why is this?
%================================================================
\version "2.13.7"
barre = #(define-music-function (parser location fretnum dirn
shorten adjBreak adjEnd)
(string? number? pair? number? number?)
#{
\once \override TextSpanner #'bound-details #'left #'text =
\markup { \small { \concat { "C" "." $fretnum " " } } }
\once \override TextSpanner #'style = #'line
\once \override TextSpanner #'font-shape = #'upright
\once \override TextSpanner #'direction = #$dirn
\once \override TextSpanner #'bound-details #'right #'text =
\markup { \draw-line #(cons 0 (/ $dirn -1)) }
\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 5/8
\new Staff
<<
\new Voice = "first"
{ \voiceOne \barre "6" #UP #'(-0.5 . -1) #5 #1
bes8\startTextSpan f' aes d_( e) |
bes'4 s4 s8\stopTextSpan |
}
\new Voice= "second"
{ \voiceTwo
s2 s8 |
bes f e aes, e' |
}
>>
}
%================================================================
Hi Nick,
I can't explain what's going on exactly, but transparent rests fix
this one nicely:
%================================================================
\version "2.13.7"
barre = #(define-music-function (parser location fretnum dirn shorten
adjBreak adjEnd)
(string? number? pair? number? number?)
#{
\once \override TextSpanner #'bound-details #'left #'text =
\markup { \small { \concat { "C" "." $fretnum " " } } }
\once \override TextSpanner #'style = #'line
\once \override TextSpanner #'font-shape = #'upright
\once \override TextSpanner #'direction = #$dirn
\once \override TextSpanner #'bound-details #'right #'text = \markup
{ \draw-line #(cons 0 (/ $dirn -1)) }
\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 5/8
\new Staff
<<
\new Voice = "first"
{ \voiceOne \barre "6" #UP #'(-0.5 . -1) #5 #1
bes8\startTextSpan f' aes d_( e) |
bes'4
\override Rest #'transparent = ##t
r4 r8\stopTextSpan
\revert Rest #'transparent
|
}
\new Voice= "second"
{ \voiceTwo
s2 s8 |
bes f e aes, e' |
}
>>
}
%================================================================
Intuitively I always imagine skips as meaning "don't do any engraving
work here." I don't know if that's actually an (or the) intended
meaning skips or not, but it helps me remember that are a very few --
but important -- gotcha differences between skips and (transparent)
rests, this situation with the spanners being one of them.