4 %%%%%%%% shortcuts common for all styles of gregorian chant notation
8 % Declare memorable shortcuts for special unicode characters
9 % that are used in chant notation.
12 % unicode 0132 (latin capital ligature IJ)
14 IIJ = \lyricmode { IIJ }
16 % unicode 0133 (latin small ligature ij)
18 iij = \lyricmode { iij }
20 % Given some music that represents lyrics, add a prefix to the first
22 #(define (add-prefix-to-lyrics prefix music)
27 (let* ((elems (car (ly:music-property music 'elements)))
28 (props (ly:music-mutable-properties elems))
29 (events (filter (lambda (x)
30 (equal? (car x) 'elements))
32 (first-evt (cadar events))
33 (first-syllable (ly:prob-property first-evt 'text))
34 (first-duration (ly:prob-property first-evt 'duration)))
37 'duration first-duration
38 'text (string-append prefix first-syllable)))
39 (cdr (ly:music-property music 'elements))))))
41 % Add unicode 2123 (versicle) as prefix to lyrics.
43 #(define-music-function (parser location music) (ly:music?)
44 (add-prefix-to-lyrics "℣" music))
46 % Add unicode 211F (response) as prefix to lyrics.
48 #(define-music-function (parser location music) (ly:music?)
49 (add-prefix-to-lyrics "℟" music))
52 % Declare head prefix shortcuts.
55 \once \override NoteHead #'virga = ##t
57 \once \override NoteHead #'stropha = ##t
59 \once \override NoteHead #'inclinatum = ##t
61 \once \override NoteHead #'auctum = ##t
63 \once \override NoteHead #'descendens = ##t
65 \once \override NoteHead #'ascendens = ##t
67 \once \override NoteHead #'pes-or-flexa = ##t
69 \once \override NoteHead #'pes-or-flexa = ##t
71 \once \override NoteHead #'oriscus = ##t
73 \once \override NoteHead #'quilisma = ##t
75 \once \override NoteHead #'deminutum = ##t
77 \once \override NoteHead #'linea = ##t
79 \once \override NoteHead #'cavum = ##t
82 % Declare divisiones shortcuts.
85 \once \override BreathingSign #'text = #(make-musicglyph-markup "scripts.rcomma")
86 \once \override BreathingSign #'font-size = #-2
88 % Workaround: add padding. Correct fix would be spacing engine handle this.
89 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
94 \once \override BreathingSign #'text = #(make-musicglyph-markup "scripts.rvarcomma")
95 \once \override BreathingSign #'font-size = #-2
97 % Workaround: add padding. Correct fix would be spacing engine handle this.
98 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
103 \once \override BreathingSign #'stencil = #ly:breathing-sign::divisio-minima
105 % Workaround: add padding. Correct fix would be spacing engine handle this.
106 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
111 \once \override BreathingSign #'stencil = #ly:breathing-sign::divisio-maior
112 \once \override BreathingSign #'Y-offset = #0
114 % Workaround: add padding. Correct fix would be spacing engine handle this.
115 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
120 \once \override BreathingSign #'stencil = #ly:breathing-sign::divisio-maxima
121 \once \override BreathingSign #'Y-offset = #0
123 % Workaround: add padding. Correct fix would be spacing engine handle this.
124 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
129 \once \override BreathingSign #'stencil = #ly:breathing-sign::finalis
130 \once \override BreathingSign #'Y-offset = #0
132 % Workaround: add padding. Correct fix would be spacing engine handle this.
133 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
139 % Declare articulation shortcuts.
141 accentus = #(make-articulation "accentus")
142 ictus = #(make-articulation "ictus")
143 semicirculus = #(make-articulation "semicirculus")
144 circulus = #(make-articulation "circulus")
145 episemInitium = #(make-span-event 'TextSpanEvent START)
146 episemFinis = #(make-span-event 'TextSpanEvent STOP)
148 %%% TODO: A ligature head postfix that indicates that an
149 %%% augmentum dot should be appended to the right end of
150 %%% the surrounding ligature. [Not yet implemented.]
155 % Declare shortcut music functions for Liber Hymnarius neumes
156 % table (experimental).
159 #(define (make-ligature music)
160 (make-music 'SequentialMusic
163 (make-music 'EventChord
165 (make-span-event 'LigatureEvent START)))
166 (ly:music-property music 'elements))
168 (make-music 'EventChord
170 (make-span-event 'LigatureEvent STOP)))))))
172 ligature = #(define-music-function
173 (location music) (ly:music?)
174 (make-ligature music))
176 %#(define (make-script x)
177 % (make-music 'ArticulationEvent
178 % 'articulation-type x))
180 %#(define (add-script m x)
182 % (equal? (ly:music-property m 'name) 'EventChord)
183 % (set! (ly:music-property m 'elements)
184 % (cons (make-script x)
185 % (ly:music-property m 'elements))))
188 %#(define (add-staccato m)
189 % (add-script m "staccato"))
191 % % \applyMusic #(lambda (x) (music-map add-staccato x)) { c c }
193 % % \climacus { x y z ... }:
194 % % \[ \virga x \inclinatum y \inclinatum z ... \]
196 %#(defmacro def-climacus-function (start stop)
197 % `(define-music-function (location music) (ly:music?)
198 % (make-music 'SequentialMusic
199 % 'elements (list 'LigatureStartEvent
200 % (ly:music-deep-copy ,start)
202 % (ly:music-deep-copy ,stop)
203 % 'LigatureStopEvent))))
204 %climacus = #(def-climacus-function startSequentialMusic stopSequentialMusic)
207 % Declare default layout; here for Vaticana style. In case there will
208 % be additional styles, we may want to create style-specific .ly files
209 % for inclusion (e.g. vaticana-init.ly), move the style-dependent stuff
210 % over there, leave the style-independent Gregorian stuff here, and let
211 % the style-specific file (vaticana-init.ly) include this file. The
212 % user then will have to include vaticana-init.ly instead of
219 %%% TODO: should raggedright be the default?
223 %%% FIXME: line-thickness should be set here to a slightly
224 %%% thicker value as the default; but we can not set it here,
225 %%% since neither \staff-space nor #staff-space is yet defined
226 %%% when lily comes across the following line.
227 %line-thickness = \staff-space / 7.0
231 \override StaffSymbol #'color = #red
232 \override LedgerLineSpanner #'color = #red
236 \remove "Bar_number_engraver"
239 %%% FIXME: Musicologically seen, timing should be set to #f.
240 %%% Unfortunately, setting it to #f will result in no
241 %%% line-breakable items being created, such that the whole
242 %%% music will end up in a single line. Therefore, we
243 %%% currently set it to #t, until the ligature code is fixed
244 %%% to automatically insert breakable items.
249 %%% FIXME: Setting barAlways to #t would fix the above
250 %%% "timing = ##t" problem, but, surprisingly, it increases
251 %%% the space between ligatures. Hence, we set it to #f.
255 \override SpacingSpanner #'packed-spacing = ##t
258 %%% TODO: Play around with the following SpacingSpanner
259 %%% settings to yield better spacing between ligatures.
261 %%% FIXME: setting #'spacing-increment to a small value
262 %%% causes tons of "programming error: adding reverse spring,
263 %%% setting to unit" messages.
265 %\override SpacingSpanner #'shortest-duration-space = #0
266 %\override SpacingSpanner #'average-spacing-wishes = ##f
267 %\override SpacingSpanner #'spacing-increment = #0.0
268 %\override SpacingSpanner #'uniform-stretching = ##t
273 % neumeDemoLayout defines a layout block suitable for notating pure
274 % Vaticana style neumes without any other notation symbols such as
275 % staff lines or clefs. This layout is useful for engraving neumes
276 % tables, such as that one in the lilypond manual section on
277 % Gregorian ligatures, or for educational works.
279 neumeDemoLayout = \layout {
283 \remove "Bar_number_engraver"
287 \remove "Clef_engraver"
288 \remove "Key_engraver"
289 \override StaffSymbol #'transparent = ##t
290 \remove "Time_signature_engraver"
291 \remove "Bar_engraver"
292 minimumVerticalExtent = ##f
296 \remove Ligature_bracket_engraver
297 \consists Vaticana_ligature_engraver
298 \override NoteHead #'style = #'vaticana.punctum
299 \override Stem #'transparent = ##t