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

Str<strong>in</strong>g number extender l<strong>in</strong>es<br />

Make an extender l<strong>in</strong>e for str<strong>in</strong>g number <strong>in</strong>dications, show<strong>in</strong>g that a series of notes is supposed<br />

to be played all on the same str<strong>in</strong>g.<br />

str<strong>in</strong>gNumberSpanner =<br />

#(def<strong>in</strong>e-music-function (parser location Str<strong>in</strong>gNumber) (str<strong>in</strong>g?)<br />

#{<br />

\override TextSpanner #'style = #'solid<br />

\override TextSpanner #'font-size = #-5<br />

\override TextSpanner #'(bound-details left stencil-align-dir-y) = #CENTER<br />

\override TextSpanner #'(bound-details left text) = \markup { \circle \number #Str<strong>in</strong>gNum<br />

#})<br />

\relative c {<br />

\clef "treble_8"<br />

\str<strong>in</strong>gNumberSpanner "5"<br />

\textSpannerDown<br />

a8\startTextSpan<br />

b c d e f\stopTextSpan<br />

\str<strong>in</strong>gNumberSpanner "4"<br />

g\startTextSpan a<br />

bes4 a g2\stopTextSpan<br />

}<br />

<br />

8<br />

<br />

<br />

<br />

5<br />

4<br />

<br />

Us<strong>in</strong>g PostScript to generate special note head shapes<br />

<br />

When a note head with a special shape cannot easily be generated with graphic markup, Post-<br />

Script code can be used to generate the shape. This example shows how a parallelogram-shaped<br />

note head is generated.<br />

parallelogram =<br />

#(ly:make-stencil (list 'embedded-ps<br />

"gsave<br />

currentpo<strong>in</strong>t translate<br />

newpath<br />

0 0.25 moveto<br />

1.3125 0.75 l<strong>in</strong>eto<br />

1.3125 -0.25 l<strong>in</strong>eto<br />

0 -0.75 l<strong>in</strong>eto<br />

closepath<br />

fill<br />

grestore" )<br />

(cons 0 1.3125)<br />

(cons -.75 .75))<br />

myNoteHeads = \override NoteHead #'stencil = \parallelogram<br />

normalNoteHeads = \revert NoteHead #'stencil

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

Saved successfully!

Ooh no, something went wrong!