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