]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/using-postscript-to-generate-special-note-head-shapes.ly
6fbdc1d7c58d9dd64bcb7a3c36de3fd956641b47
[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.14.2"
8
9 \header {
10   lsrtags = "tweaks-and-overrides, scheme-language, really-cool, editorial-annotations"
11
12 %% Translation of GIT committish: d5307870fe0ad47904daba73792c7e17b813737f
13   texidocfr = "
14 Lorsqu'il est impossible d'obtenir facilement une allure particulière
15 pour les têtes de note en recourant à la technique du @code{\\markup}, un
16 code PostScript peut vous tirer d'embarras.  Voici comment générer des
17 têtes ressemblant à des parallélogrammes.
18
19 "
20   doctitlefr = "Utilisation de PostScript pour générer des têtes de note à l'allure particulière"
21
22   texidoc = "
23 When a note head with a special shape cannot easily be generated with
24 graphic markup, PostScript code can be used to generate the shape.
25 This example shows how a parallelogram-shaped note head is generated.
26
27 "
28   doctitle = "Using PostScript to generate special note head shapes"
29 } % begin verbatim
30
31
32 parallelogram =
33   #(ly:make-stencil (list 'embedded-ps
34     "gsave
35       currentpoint translate
36       newpath
37       0 0.25 moveto
38       1.3125 0.75 lineto
39       1.3125 -0.25 lineto
40       0 -0.75 lineto
41       closepath
42       fill
43       grestore" )
44     (cons 0 1.3125)
45     (cons -.75 .75))
46
47 myNoteHeads = \override NoteHead #'stencil = \parallelogram
48 normalNoteHeads = \revert NoteHead #'stencil
49
50 \relative c'' {
51   \myNoteHeads
52   g4 d'
53   \normalNoteHeads
54   <f, \tweak #'stencil \parallelogram b e>4 d
55 }