29.11.2012 Views

mpdolce - LilyPond

mpdolce - LilyPond

mpdolce - LilyPond

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4: Tweaking output 112<br />

\tempo 4=80<br />

d1<br />

�<br />

�<br />

� = 80<br />

� = 120<br />

�<br />

�<br />

Note in the second example how important it is to figure out what context handles a certain<br />

object. Since the MetronomeMark object is handled in the Score context, property changes in<br />

the Voice context will not be noticed. For more details, see Section “Modifying properties” in<br />

Notation Reference.<br />

If the padding property of an object is increased when that object is in a stack of objects<br />

being positioned according to their outside-staff-priority, then that object and all objects<br />

outside it are moved.<br />

left-padding and right-padding<br />

The right-padding property affects the spacing between the accidental and the note to which<br />

it applies. It is not often required, but the following example shows one situation where it is<br />

needed. Suppose we wish to show a chord containing both a B-natural and a B-flat. To avoid<br />

ambiguity we would like to precede the notes with both a natural and a flat sign. Here are a<br />

few attempts to do this:<br />

<br />

<br />

<br />

� ���� �����<br />

�����<br />

None work, with the second two showing bad collisions between the two signs.<br />

One way of achieving this is to override the accidental stencil with a markup containing the<br />

natural and flat symbols in the order we would like, like this:<br />

naturalplusflat = \markup { \natural \flat }<br />

\relative c'' {<br />

\once \override Accidental<br />

#'stencil = #ly:text-interface::print<br />

\once \override Accidental #'text = #naturalplusflat<br />

\once \override Score.AccidentalPlacement #'right-padding = #1.5<br />

<br />

}<br />

� ��� ��<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 natural sign followed by a flat sign. These are then<br />

moved further away from the note head by overriding right-padding.

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

Saved successfully!

Ooh no, something went wrong!