RE: Rotating TextSpanner

2009-04-25 Thread Nick Payne
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:kieren_macmil...@sympatico.ca]
 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 }
 }
 



___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Rotating TextSpanner

2009-04-25 Thread Kieren MacMillan

Hi Nick,


With that as a model I was able to generalize it to a music function


Nice! Even better would be to take the music as a parameter, compute  
the correct rightY (using the relative position of the endpoints of  
the first and last stem) and automagically adjust -- that, however,  
is beyond my current Scheme ability.


Regards,
Kieren.


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Rotating TextSpanner

2009-04-25 Thread Jonathan Kulp

Kieren MacMillan wrote:

Hi Nick,


With that as a model I was able to generalize it to a music function


Nice! 


+1.  That's a very cool piece of code!

Jon
--
Jonathan Kulp
http://www.jonathankulp.com


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Rotating TextSpanner

2009-04-24 Thread Nick Payne
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.

Nick Payne



attachment: spanner.png___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Rotating TextSpanner

2009-04-24 Thread Kieren MacMillan

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 }
}

Best,
Kieren.


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user