]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/using-postscript-to-generate-special-note-head-shapes.ly
Doc-it: chapter 1 completed
[lilypond.git] / Documentation / snippets / using-postscript-to-generate-special-note-head-shapes.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.17.25"
8
9 \header {
10   lsrtags = "editorial-annotations, really-cool, scheme-language, tweaks-and-overrides"
11
12   texidoc = "
13 When a note head with a special shape cannot easily be generated with
14 graphic markup, PostScript code can be used to generate the shape.
15 This example shows how a parallelogram-shaped note head is generated.
16
17 "
18   doctitle = "Using PostScript to generate special note head shapes"
19 } % begin verbatim
20
21
22 parallelogram =
23   #(ly:make-stencil (list 'embedded-ps
24     "gsave
25       currentpoint translate
26       newpath
27       0 0.25 moveto
28       1.3125 0.75 lineto
29       1.3125 -0.25 lineto
30       0 -0.75 lineto
31       closepath
32       fill
33       grestore" )
34     (cons 0 1.3125)
35     (cons -.75 .75))
36
37 myNoteHeads = \override NoteHead.stencil = \parallelogram
38 normalNoteHeads = \revert NoteHead.stencil
39
40 \relative c'' {
41   \myNoteHeads
42   g4 d'
43   \normalNoteHeads
44   <f, \tweak stencil \parallelogram b e>4 d
45 }