27.03.2013 Views

LilyPond Snippets

LilyPond Snippets

LilyPond Snippets

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Tweaks and overrides 347<br />

Using the \tweak command to tweak individual grobs<br />

With the \tweak command, every grob can be tuned directly. Here are some examples of<br />

available tweaks.<br />

\relative c' {<br />

\time 2/4<br />

\set fingeringOrientations = #'(right)<br />

<<br />

\tweak #'font-size #3 c<br />

\tweak #'color #red d-\tweak #'font-size #8 -4<br />

\tweak #'style #'cross g<br />

\tweak #'duration-log #2 a<br />

>2<br />

}<br />

4 2<br />

<br />

<br />

<br />

4<br />

Vertically aligned dynamics and textscripts<br />

By setting the 'Y-extent property to a suitable value, all DynamicLineSpanner objects (hairpins<br />

and dynamic texts) can be aligned to a common reference point, regardless of their actual extent.<br />

This way, every element will be vertically aligned, thus producing a more pleasing output.<br />

The same idea is used to align the text scripts along their baseline.<br />

music = \relative c'' {<br />

c2\p^\markup { gorgeous } c\f^\markup { fantastic }<br />

c4\p c\f\> c c\!\p<br />

}<br />

{<br />

}<br />

3<br />

\music \break<br />

\override DynamicLineSpanner #'staff-padding = #2.0<br />

\override DynamicLineSpanner #'Y-extent = #'(-1.5 . 1.5)<br />

\override TextScript #'Y-extent = #'(-1.5 . 1.5)<br />

\music<br />

<br />

<br />

<br />

gorgeous<br />

<br />

p<br />

<br />

gorgeous<br />

p<br />

<br />

fantastic<br />

f<br />

fantastic<br />

<br />

f<br />

<br />

p<br />

<br />

p<br />

<br />

f<br />

<br />

f<br />

<br />

<br />

<br />

p<br />

<br />

p

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

Saved successfully!

Ooh no, something went wrong!