]> git.donarmstrong.com Git - lilypond.git/blob - ly/gregorian-init.ly
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / ly / gregorian-init.ly
1 \version "2.7.39"
2
3 %%%%%%%%
4 %%%%%%%% shortcuts common for all styles of gregorian chant notation
5 %%%%%%%%
6
7 %
8 % declare head prefix shortcuts
9 %
10 virga =
11   \once \override NoteHead  #'virga = ##t
12 stropha =
13   \once \override NoteHead  #'stropha = ##t
14 inclinatum =
15   \once \override NoteHead  #'inclinatum = ##t
16 auctum =
17   \once \override NoteHead  #'auctum = ##t
18 descendens =
19   \once \override NoteHead  #'descendens = ##t
20 ascendens =
21   \once \override NoteHead  #'ascendens = ##t
22 pes =
23   \once \override NoteHead  #'pes-or-flexa = ##t
24 flexa =
25   \once \override NoteHead  #'pes-or-flexa = ##t
26 oriscus =
27   \once \override NoteHead  #'oriscus = ##t
28 quilisma =
29   \once \override NoteHead  #'quilisma = ##t
30 deminutum =
31   \once \override NoteHead  #'deminutum = ##t
32 linea =
33   \once \override NoteHead  #'linea = ##t
34 cavum =
35   \once \override NoteHead  #'cavum = ##t
36
37 %
38 % declare divisiones shortcuts
39 %
40 virgula = {
41   \once \override BreathingSign  #'text = #(make-musicglyph-markup "scripts.rcomma")
42   \once \override BreathingSign  #'font-size = #-2
43
44   % Workaround: add padding.  Correct fix would be spacing engine handle this.
45   \once \override BreathingSign  #'extra-X-extent = #'(-1.0 . 0)
46
47   \breathe
48 }
49 caesura = {
50   \once \override BreathingSign  #'text = #(make-musicglyph-markup "scripts.rvarcomma")
51   \once \override BreathingSign  #'font-size = #-2
52
53   % Workaround: add padding.  Correct fix would be spacing engine handle this.
54   \once \override BreathingSign  #'extra-X-extent = #'(-1.0 . 0)
55
56   \breathe
57 }
58 divisioMinima = {
59   \once \override BreathingSign  #'stencil = #ly:breathing-sign::divisio-minima
60
61   % Workaround: add padding.  Correct fix would be spacing engine handle this.
62   \once \override BreathingSign  #'extra-X-extent = #'(-1.0 . 0)
63
64   \breathe
65 }
66 divisioMaior = {
67   \once \override BreathingSign  #'stencil = #ly:breathing-sign::divisio-maior
68   \once \override BreathingSign  #'Y-offset = #0
69
70   % Workaround: add padding.  Correct fix would be spacing engine handle this.
71   \once \override BreathingSign  #'extra-X-extent = #'(-1.0 . 0)
72
73   \breathe
74 }
75 divisioMaxima = {
76   \once \override BreathingSign  #'stencil = #ly:breathing-sign::divisio-maxima
77   \once \override BreathingSign  #'Y-offset = #0
78
79   % Workaround: add padding.  Correct fix would be spacing engine handle this.
80   \once \override BreathingSign  #'extra-X-extent = #'(-1.0 . 0)
81
82   \breathe
83 }
84 finalis = {
85   \once \override BreathingSign  #'stencil = #ly:breathing-sign::finalis
86   \once \override BreathingSign  #'Y-offset = #0
87
88   % Workaround: add padding.  Correct fix would be spacing engine handle this.
89   \once \override BreathingSign  #'extra-X-extent = #'(-1.0 . 0)
90
91   \breathe
92 }
93
94 augmentum = {
95   %%% TODO: A ligature head postfix that indicates that an
96   %%% augmentum dot should be appended to the right end of
97   %%% the surrounding ligature.  [Not yet implemented.]
98 }
99
100 %
101 % declare articulation shortcuts
102 %
103 accentus = #(make-articulation "accentus")
104 ictus = #(make-articulation "ictus")
105 semicirculus = #(make-articulation "semicirculus")
106 circulus = #(make-articulation "circulus")
107 episemInitium = #(make-span-event 'TextSpanEvent START)
108 episemFinis = #(make-span-event 'TextSpanEvent STOP)
109
110 %
111 % shortcut music functions for Liber Hymnarius neumes table
112 % (experimental)
113 %
114
115 #(define (make-ligature music)
116    (make-music 'SequentialMusic
117                'elements (append
118                           (cons
119                            (make-music 'EventChord
120                                        'elements (list
121                                                   (make-span-event 'LigatureEvent START)))
122                            (ly:music-property music 'elements))
123                           (list
124                            (make-music 'EventChord
125                                        'elements (list
126                                                   (make-span-event 'LigatureEvent STOP)))))))
127
128 ligature = #(define-music-function
129               (location music) (ly:music?)
130               (make-ligature music))
131
132 %#(define (make-script x)
133 %   (make-music 'ArticulationEvent
134 %               'articulation-type x))
135 %    
136 %#(define (add-script m x)
137 %   (if
138 %     (equal? (ly:music-property m 'name) 'EventChord)
139 %     (set! (ly:music-property m 'elements)
140 %           (cons (make-script x)
141 %                 (ly:music-property m 'elements))))
142 %   m)
143 %
144 %#(define (add-staccato m)
145 %   (add-script m "staccato"))
146 %
147 % % \applyMusic #(lambda (x) (music-map add-staccato x)) { c c }
148 %
149 % % \climacus { x y z ... }:
150 % % \[ \virga x \inclinatum y \inclinatum z ... \]
151 %
152 %#(defmacro def-climacus-function (start stop)
153 %  `(define-music-function (location music) (ly:music?)
154 %     (make-music 'SequentialMusic
155 %        'elements (list 'LigatureStartEvent
156 %                       (ly:music-deep-copy ,start)
157 %                        music
158 %                        (ly:music-deep-copy ,stop)
159 %                       'LigatureStopEvent))))
160 %climacus = #(def-climacus-function startSequentialMusic stopSequentialMusic)
161
162 \layout {
163     indent = 0.0
164     packed = ##t
165
166     %%% TODO: should raggedright be the default?
167     %ragged-right = ##t
168     ragged-last = ##t
169
170     %%% FIXME: line-thickness should be set here to a slightly
171     %%% thicker value as the default; but we can not set it here,
172     %%% since neither \staff-space nor #staff-space is yet defined
173     %%% when lily comes across the following line.
174     %line-thickness = \staff-space / 7.0
175
176     \context {
177         \VaticanaStaff
178          \override StaffSymbol #'color = #red
179          \override LedgerLineSpanner #'color = #red
180     }
181     \context {
182         \Score
183         \remove "Bar_number_engraver"
184
185         %%%
186         %%% FIXME: Musicologically seen, timing should be set to #f.
187         %%% Unfortunately, setting it to #f will result in no
188         %%% line-breakable items being created, such that the whole
189         %%% music will end up in a single line.  Therefore, we
190         %%% currently set it to #t, until the ligature code is fixed
191         %%% to automatically insert breakable items.
192         %%%
193         timing = ##t
194
195         %%%
196         %%% FIXME: Setting barAlways to #t would fix the above
197         %%% "timing = ##t" problem, but, surprisingly, it increases
198         %%% the space between ligatures.  Hence, we set it to #f.
199         %%%
200         barAlways = ##f
201
202         \override SpacingSpanner #'packed-spacing = ##t
203
204         %%%
205         %%% TODO: Play around with the following SpacingSpanner
206         %%% settings to yield better spacing between ligatures.
207         %%%
208         %%% FIXME: setting #'spacing-increment to a small value
209         %%% causes tons of "programming error: adding reverse spring,
210         %%% setting to unit" messages.
211         %%%
212         %\override SpacingSpanner #'shortest-duration-space = #0
213         %\override SpacingSpanner #'average-spacing-wishes = ##f
214         %\override SpacingSpanner #'spacing-increment = #0.0
215         %\override SpacingSpanner #'uniform-stretching = ##t
216     }
217 }
218
219 %
220 % example layout block for gregorian chant notation
221 %
222
223 neumeDemoLayout = \layout {
224     interscoreline = 1
225     \context {
226         \Score
227         \remove "Bar_number_engraver"
228     }
229     \context {
230         \Staff
231         \remove "Clef_engraver"
232         \remove "Key_engraver"
233         \override StaffSymbol #'transparent = ##t
234         \remove "Time_signature_engraver"
235         \remove "Bar_engraver"
236         minimumVerticalExtent = ##f
237     }
238     \context {
239         \Voice
240         \remove Ligature_bracket_engraver
241         \consists Vaticana_ligature_engraver
242         \override NoteHead #'style = #'vaticana.punctum
243         \override Stem #'transparent = ##t
244     }
245 }