lilypond-user
[Top][All Lists]
Advanced

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

Re: TextSpanner terminates too early


From: Nick Payne
Subject: Re: TextSpanner terminates too early
Date: Thu, 19 Nov 2009 08:06:51 +1100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Trevor Bača wrote:


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.
Wow, that was quick. Thanks, it does fix the problem. However, I went back and checked some other scores I have engraved, and in some of them I have used the same construction of TextSpanner sometimes starting and sometimes finishing on a spacing note, and there it does work correctly.

Nick




reply via email to

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