lilypond-user
[Top][All Lists]
Advanced

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

RE: Rotating TextSpanner


From: Nick Payne
Subject: RE: Rotating TextSpanner
Date: Sat, 25 Apr 2009 16:05:10 +1000

Thanks. With that as a model I was able to generalize it to a music function
taking arbitrary text, right Y, and offset. If I knew a bit more I could
generalize it a bit more by also passing in the direction as a parameter,
and depending on whether it was #UP or #DOWN, draw the RH end bracket either
down or up.

\version "2.12.2"

rtspan = #(define-music-function (parser location text rightY offset
shorten)
        (string? number? pair? pair?)
#{
        \once \override TextSpanner #'bound-details #'left #'text = 
                \markup \bold { \small \concat { { $text } " " } }
        \once \override TextSpanner #'direction = #DOWN
        \once \override TextSpanner #'(bound-details right Y) = #$rightY
        \once \override TextSpanner #'extra-offset = #$offset
        \once \override TextSpanner #'dash-period = #1.5
        \once \override TextSpanner #'dash-fraction = #0.5
        \once \override TextSpanner #'thickness = #0.8
        \once \override TextSpanner #'bound-details #'right #'text = 
                \markup { \draw-line #'(0 . 2) }
        \once \override TextSpanner #'bound-details #'left
#'stencil-align-dir-y = #DOWN
        \once \override TextSpanner #'bound-details #'left #'padding = #(car
$shorten)
        \once \override TextSpanner #'bound-details #'right #'padding =
#(cdr $shorten)
#})

music = \relative
{
        \override Staff.TimeSignature #'stencil = ##f \time 3/4
        <<
                { \voiceOne s4 s8 r4. r2. }
                \new Voice { \voiceTwo s4 \rtspan "stacc." #5 #'(0 . 5)
#'(-0.5 . -1)
                f,8\startTextSpan[ a b d f a b d f a ]\stopTextSpan }
        >>
}

\score
{
        \music
        \layout { ragged-right = ##f }
}

Nick

> -----Original Message-----
> From: Kieren MacMillan [mailto:address@hidden
> Sent: Saturday, 25 April 2009 11:22
> To: Nick Payne
> Cc: 'lilypond'
> Subject: Re: Rotating TextSpanner
> 
> Hi Nick,
> 
> > Any suggestions (other than trial and error alignment of separate
> > elements)
> > on how to get an effect similar to that in the attached image,
> > where the
> > line is rotated but the text is not.
> 
> The following should help:
> 
> \version "2.12.2"
> 
> setTS =
> {
>       \override TextSpanner #'direction = #-1
>       \override TextSpanner #'dash-fraction = #0.4
>       \override TextSpanner #'dash-period = #1
>       \override TextSpanner #'(bound-details left text) = \markup
> \raise
> #0.5 "stacc."
>       \override TextSpanner #'(bound-details left padding) = #-1
>       \override TextSpanner #'bound-details #'right #'text = \markup
> { \draw-line #'(0 . 4) }
>       \override TextSpanner #'(bound-details right padding) = #-1.5
>       \override TextSpanner #'(bound-details right Y) = #7
>       \override TextSpanner #'extra-offset = #'(0 . 9)
> }
> 
> music = \relative
> {
>       \override Staff.TimeSignature #'stencil = ##f \time 3/4
>       <<
>               { \voiceOne s4 s8 r4. r2. }
>               \new Voice { \voiceTwo \setTS s4 f,8\startTextSpan a b d
> f[ a b d f
> a ]\stopTextSpan }
>       >>
> }
> 
> \score
> {
>       \music
>       \layout { ragged-right = ##f }
> }
> 





reply via email to

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