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.

Editorial annotations 155<br />

#(def<strong>in</strong>e (calc-f<strong>in</strong>ger-without-warn<strong>in</strong>g grob)<br />

(let* ((event (event-cause grob))<br />

(digit (ly:event-property event 'digit)))<br />

(number->str<strong>in</strong>g digit 10)))<br />

\relative c' {<br />

% optional override to remove warn<strong>in</strong>gs for f<strong>in</strong>ger<strong>in</strong>gs larger than 5<br />

\override F<strong>in</strong>ger<strong>in</strong>g #'text = #calc-f<strong>in</strong>ger-without-warn<strong>in</strong>g<br />

c1\ten<br />

c1\fifty<br />

c1-\f<strong>in</strong>ger #36<br />

c1-\f<strong>in</strong>ger #29<br />

}<br />

<br />

<br />

10<br />

<br />

50<br />

<br />

36<br />

<br />

29<br />

<br />

Default direction of stems on the center l<strong>in</strong>e of the staff<br />

The default direction of stems on the center l<strong>in</strong>e of the staff is set by the Stem property<br />

neutral-direction.<br />

\relative c'' {<br />

a4 b c b<br />

\override Stem #'neutral-direction = #up<br />

a4 b c b<br />

\override Stem #'neutral-direction = #down<br />

a4 b c b<br />

}<br />

<br />

<br />

Draw<strong>in</strong>g boxes around grobs<br />

<br />

<br />

<br />

The pr<strong>in</strong>t-function can be overridden to draw a box around an arbitrary grob.<br />

\relative c'' {<br />

\override TextScript #'stencil =<br />

#(make-stencil-boxer 0.1 0.3 ly:text-<strong>in</strong>terface::pr<strong>in</strong>t)<br />

c'4^"foo"<br />

\override Stem #'stencil =<br />

#(make-stencil-boxer 0.05 0.25 ly:stem::pr<strong>in</strong>t)<br />

\override Score.RehearsalMark #'stencil =<br />

#(make-stencil-boxer 0.15 0.3 ly:text-<strong>in</strong>terface::pr<strong>in</strong>t)<br />

b8<br />

\revert Stem #'stencil<br />

\revert Flag #'stencil

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

Saved successfully!

Ooh no, something went wrong!