10.04.2013 Views

in Snippets - LilyPond

in Snippets - LilyPond

in Snippets - 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.

Text 171<br />

<br />

<br />

<br />

<br />

default<br />

<br />

<br />

<br />

<br />

<br />

right aligned<br />

<br />

center aligned reset to default <br />

<br />

word word word word word word word word word word word word<br />

Blank<strong>in</strong>g staff l<strong>in</strong>es us<strong>in</strong>g the \whiteout command<br />

The \whiteout command underlays a markup with a white box. S<strong>in</strong>ce staff l<strong>in</strong>es are <strong>in</strong> a lower<br />

layer than most other grobs, this white box will not overlap any other grob.<br />

\layout { ragged-right = ##f }<br />

\relative c' {<br />

\override TextScript #'extra-offset = #'(2 . 4)<br />

c2-\markup { \whiteout \pad-markup #0.5 "middle C" } c<br />

}<br />

<br />

<br />

<br />

middle C<br />

Center text below hairp<strong>in</strong> dynamics<br />

This example provides a function to typeset a hairp<strong>in</strong> (de)crescendo with some additional text<br />

below it, such as “molto” or “poco”. The example also illustrates how to modify the way an<br />

object is normally pr<strong>in</strong>ted, us<strong>in</strong>g some Scheme code.<br />

hairp<strong>in</strong>WithCenteredText =<br />

#(def<strong>in</strong>e-music-function (parser location text) (markup?)<br />

#{<br />

\override Voice.Hairp<strong>in</strong> #'stencil = #(lambda (grob)<br />

(ly:stencil-aligned-to<br />

(ly:stencil-comb<strong>in</strong>e-at-edge<br />

(ly:stencil-aligned-to (ly:hairp<strong>in</strong>::pr<strong>in</strong>t grob) X CENTER)<br />

Y DOWN<br />

(ly:stencil-aligned-to (grob-<strong>in</strong>terpret-markup grob text) X CENTER))<br />

X LEFT))<br />

#})<br />

hairp<strong>in</strong>Molto = \hairp<strong>in</strong>WithCenteredText \markup { \italic molto }<br />

hairp<strong>in</strong>More = \hairp<strong>in</strong>WithCenteredText \markup { \larger moltissimo }<br />

\layout { ragged-right = ##f }<br />

\relative c' {<br />

\hairp<strong>in</strong>Molto<br />

c2\< c\f<br />

\hairp<strong>in</strong>More<br />

c2\< c\f<br />

}<br />

<br />

<br />

<br />

f<br />

molto<br />

<br />

moltissimo<br />

<br />

f

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

Saved successfully!

Ooh no, something went wrong!