lilypond-user
[Top][All Lists]
Advanced

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

Re: Centered Textspan for Piano music


From: Mark Polesky
Subject: Re: Centered Textspan for Piano music
Date: Sat, 22 Nov 2008 13:05:43 -0800 (PST)

November 22, 2008, stefankaegi wrote:


> I'd like to have a centered accelerando Textspan for a piano piece.
> Something like this: acc. -   -   -   -


Did you mean...
1) center the text-spanner between the 2 staves
2) center the dashes in the text-spanner vertically
      ( acc. - - - as opposed to acc. _ _ _ )
or
3) both? 

I don't know if this works for version 2.10, but here's how to do it in 2.11: 

First, you need the updated template:
http://lilypond.org/doc/v2.11/Documentation/user/lilypond-learning/Piano-templates#Piano-templates

Then add this line to the list of \consists in the Dynamics context definition:
\consists "Text_spanner_engraver"

If you want the dash centered vertically, 
then add this line to the list of \overrides:
\override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #CENTER

Then enter your spanner-text like so:

dynamics = {
  \override TextSpanner #'bound-details #'left #'text = #"acc. "
  s2. s4\startTextSpan
  s4.\stopTextSpan
}

As I understand it, currently there's a bug that sets the first dash right 
next to the text without allowing you to move it. The workaround is just to 
add a space after the text: #"acc. "

Also, as of 2.11.64, this is the correct way to do it. However (just in case 
you're interested), developers are currently working on a patch that will 
eventually allow an abbreviated form:
  \override TextSpanner #'(bound-details left text) = #"acc. "
but this has not yet been implemented as of 2.11.64.

I've attached an example .ly file and the .png it generates.

One last word: 2.11 is so much more advanced than 2.10, with fantastically
better documentation. Consider making the switch.

Hope this helps.
- Mark


      

Attachment: centered-spanner.ly
Description: Text Data

Attachment: centered-spanner.png
Description: PNG image


reply via email to

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