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.

Editorial annotations 124<br />

Using PostScript to generate special note head shapes<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 />

currentpoint translate<br />

newpath<br />

0 0.25 moveto<br />

1.3125 0.75 lineto<br />

1.3125 -0.25 lineto<br />

0 -0.75 lineto<br />

closepath<br />

fill<br />

grestore" )<br />

(cons 0 1.3125)<br />

(cons 0 0))<br />

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

normalNoteHeads = \revert NoteHead #'stencil<br />

\relative c'' {<br />

\myNoteHeads<br />

g4 d'<br />

\normalNoteHeads<br />

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

Saved successfully!

Ooh no, something went wrong!