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

\dynamicUp<br />

% Extend width by 1 staff space<br />

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

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

<br />

f<br />

mf<br />

mp p<br />

<br />

This looks better, but maybe we would prefer the dynamic marks to be aligned along the same<br />

baseline rather than going up and down with the notes. The property to do this is staff-padding<br />

which is covered in the following section.<br />

4.5 Collisions of objects<br />

4.5.1 Moving objects<br />

This may come as a surprise, but <strong>LilyPond</strong> is not perfect. Some notation elements can overlap.<br />

This is unfortunate, but in fact rather rare. Usually the need to move objects is for clarity or<br />

aesthetic reasons – they would look better with a little more or a little less space around them.<br />

There are three main approaches to resolving overlapping notation. They should be considered<br />

in the following order:<br />

1. The direction of one of the overlapping objects may be changed using the predefined commands<br />

listed above for within-staff objects (see Sectie 4.4.2 [Within-staff objects], pagina<br />

109). Stems, slurs, beams, ties, dynamics, text and tuplets may be repositioned easily<br />

in this way. The limitation is that you have a choice of only two positions, and neither may<br />

be suitable.<br />

2. The object properties, which <strong>LilyPond</strong> uses when positioning layout objects, may be modified<br />

using \override. The advantages of making changes to this type of property are (a)<br />

that some other objects will be moved automatically if necessary to make room and (b)<br />

the single override can apply to all instances of the same type of object. Such properties<br />

include:<br />

• direction<br />

This has already been covered in some detail – see Sectie 4.4.2 [Within-staff objects],<br />

pagina 109.<br />

• padding, right-padding, staff-padding<br />

As an object is being positioned the value of its padding property specifies the gap that<br />

must be left between itself and the nearest edge of the object against which it is being<br />

positioned. Note that it is the padding value of the object being placed that is used;<br />

the padding value of the object which is already placed is ignored. Gaps specified by<br />

padding can be applied to all objects which support the side-position-interface.<br />

Instead of padding, the placement of groups of accidentals is controlled by<br />

right-padding. This property is to be found in the AccidentalPlacement object<br />

which, note, lives in the Staff context. In the typesetting process the note heads<br />

are typeset first and then the accidentals, if any, are added to the left of the note<br />

heads using the right-padding property to determine the separation from the note<br />

heads and between individual accidentals. So only the right-padding property of the<br />

AccidentalPlacement object has any effect on the placement of the accidentals.<br />

The staff-padding property is closely related to the padding property: padding<br />

controls the minimum amount of space between any object which supports the

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

Saved successfully!

Ooh no, something went wrong!