09.09.2013 Views

LilyPond Beginnershandleiding

LilyPond Beginnershandleiding

LilyPond Beginnershandleiding

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Hoofdstuk 4: Tweaking output 115<br />

Slurs by default are classed as within-staff objects, but they often appear above the staff if<br />

the notes to which they are attached are high on the staff. This can push outside-staff objects<br />

such as articulations too high, as the slur will be placed first. The avoid-slur property of the<br />

articulation can be set to 'inside to bring the articulation inside the slur, but the avoid-slur<br />

property is effective only if the outside-staff-priority is also set to #f. Alternatively, the<br />

outside-staff-priority of the slur can be set to a numerical value to cause it to be placed<br />

along with other outside-staff objects according to that value. Here’s an example showing the<br />

effect of the two methods:<br />

c4( c^\markup { \tiny \sharp } d4.) c8 |<br />

c4(<br />

\once \override TextScript.avoid-slur = #'inside<br />

\once \override TextScript.outside-staff-priority = ##f<br />

c4^\markup { \tiny \sharp } d4.) c8 |<br />

\once \override Slur.outside-staff-priority = #500<br />

c4( c^\markup { \tiny \sharp } d4.) c8 |<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Changing the outside-staff-priority can also be used to control the vertical placement<br />

of individual objects, although the results may not always be desirable. Suppose we would like<br />

“Text3” to be placed above “Text4” in the example under Automatic behavior, above (see<br />

Sectie 4.4.1 [Automatic behavior], pagina 108). All we need to do is to look up the priority of<br />

TextScript in the IR or in the tables above, and increase the priority of “Text3” to a higher<br />

value:<br />

c2^"Text1"<br />

c2^"Text2" |<br />

\once \override TextScript.outside-staff-priority = #500<br />

c2^"Text3"<br />

c2^"Text4" |<br />

<br />

Text3<br />

Text2<br />

Text1 Text4<br />

<br />

This certainly lifts “Text3” above “Text4” but it also lifts it above “Text2”, and “Text4”<br />

now drops down. Perhaps this is not so good. What we would really like to do is to position all<br />

the annotation at the same distance above the staff. To do this, we clearly will need to space the<br />

notes out horizontally to make more room for the text. This is done using the textLengthOn<br />

command.<br />

The \textLengthOn command<br />

By default, text produced by markup takes up no horizontal space as far as laying out the<br />

music is concerned. The \textLengthOn command reverses this behavior, causing the notes to<br />

be spaced out as far as is necessary to accommodate the text:<br />

\textLengthOn % Cause notes to space out to accommodate text<br />

c2^"Text1"<br />

c2^"Text2" |

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!