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 122<br />

This necessarily uses an override for the accidental stencil which will not be covered until later.<br />

The stencil type must be a procedure, here changed to print the contents of the text property<br />

of Accidental, which itself is set to be a sesquisharp sign. This sign is then moved further away<br />

from the note head by overriding right-padding.<br />

The staff-padding property<br />

staff-padding can be used to align objects such as dynamics along a baseline at a fixed height<br />

above the staff, rather than at a height dependent on the position of the note to which they are<br />

attached. It is not a property of DynamicText but of DynamicLineSpanner. This is because the<br />

baseline should apply equally to all dynamics, including those created as extended spanners. So<br />

this is the way to align the dynamic marks in the example taken from the previous section:<br />

\dynamicUp<br />

% Extend width by 1 unit<br />

\override DynamicText.extra-spacing-width = #'(-0.5 . 0.5)<br />

% Align dynamics to a base line 2 units above staff<br />

\override DynamicLineSpanner.staff-padding = #2<br />

a4\f b\mf c\mp b\p<br />

<br />

f mf<br />

<br />

mp<br />

<br />

p<br />

<br />

The self-alignment-X property<br />

The following example shows how this can resolve the collision of a string fingering object with<br />

a note’s stem by aligning the right edge with the reference point of the parent note:<br />

\voiceOne<br />

<br />

\once \override StringNumber.self-alignment-X = #RIGHT<br />

<br />

<br />

<br />

2<br />

<br />

2 <br />

The staff-position property<br />

Multimeasure rests in one voice can collide with notes in another. Since these rests are typeset<br />

centered between the bar lines, it would require significant effort for <strong>LilyPond</strong> to figure out<br />

which other notes might collide with it, since all the current collision handling between notes<br />

and between notes and rests is done only for notes and rests that occur at the same time. Here’s<br />

an example of a collision of this type:<br />

><br />

<br />

<br />

<br />

The best solution here is to move the multimeasure rest down, since the rest is in voice two.<br />

The default in \voiceTwo (i.e. in the second voice of a construct) is that

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

Saved successfully!

Ooh no, something went wrong!