2 Shortcuts common for all styles of gregorian chant notation.
9 % Declare memorable shortcuts for special unicode characters
10 % that are used in chant notation.
13 % unicode 0132 (latin capital ligature IJ)
15 IIJ = \lyricmode { IIJ }
17 % unicode 0133 (latin small ligature ij)
19 iij = \lyricmode { iij }
22 % Given some music that represents lyrics, add a prefix to the first
25 #(define (add-prefix-to-lyrics prefix music)
30 (and (music-is-of-type? m 'lyric-event)
32 (set! (ly:music-property m 'text)
33 (string-append prefix (ly:music-property m 'text)))
38 % Add unicode 2123 (versicle) as prefix to lyrics.
40 #(define-music-function (parser location music) (ly:music?)
41 (add-prefix-to-lyrics "℣" music))
43 % Add unicode 211F (response) as prefix to lyrics.
45 #(define-music-function (parser location music) (ly:music?)
46 (add-prefix-to-lyrics "℟" music))
49 % Declare head prefix shortcuts.
52 \once \override NoteHead #'virga = ##t
54 \once \override NoteHead #'stropha = ##t
56 \once \override NoteHead #'inclinatum = ##t
58 \once \override NoteHead #'auctum = ##t
60 \once \override NoteHead #'descendens = ##t
62 \once \override NoteHead #'ascendens = ##t
64 \once \override NoteHead #'pes-or-flexa = ##t
66 \once \override NoteHead #'pes-or-flexa = ##t
68 \once \override NoteHead #'oriscus = ##t
70 \once \override NoteHead #'quilisma = ##t
72 \once \override NoteHead #'deminutum = ##t
74 \once \override NoteHead #'linea = ##t
76 \once \override NoteHead #'cavum = ##t
79 % Declare divisiones shortcuts.
82 \once \override BreathingSign #'text = #(make-musicglyph-markup "scripts.rcomma")
83 \once \override BreathingSign #'font-size = #-2
85 % Workaround: add padding. Correct fix would be spacing engine handle this.
86 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
91 \once \override BreathingSign #'text = #(make-musicglyph-markup "scripts.rvarcomma")
92 \once \override BreathingSign #'font-size = #-2
94 % Workaround: add padding. Correct fix would be spacing engine handle this.
95 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
100 \once \override BreathingSign #'stencil = #ly:breathing-sign::divisio-minima
102 % Workaround: add padding. Correct fix would be spacing engine handle this.
103 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
108 \once \override BreathingSign #'stencil = #ly:breathing-sign::divisio-maior
109 \once \override BreathingSign #'Y-offset = #0
111 % Workaround: add padding. Correct fix would be spacing engine handle this.
112 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
117 \once \override BreathingSign #'stencil = #ly:breathing-sign::divisio-maxima
118 \once \override BreathingSign #'Y-offset = #0
120 % Workaround: add padding. Correct fix would be spacing engine handle this.
121 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
126 \once \override BreathingSign #'stencil = #ly:breathing-sign::finalis
127 \once \override BreathingSign #'Y-offset = #0
129 % Workaround: add padding. Correct fix would be spacing engine handle this.
130 \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0)
131 \once \override BreathingSign #'extra-spacing-height = #'(-0.5 . 0.5)
137 % Declare articulation shortcuts.
139 accentus = #(make-articulation "accentus")
140 ictus = #(make-articulation "ictus")
141 semicirculus = #(make-articulation "semicirculus")
142 circulus = #(make-articulation "circulus")
145 % \augmentum increases the dot-count value of all note heads to which
146 % it is applied by one.
149 #(define-music-function (parser location expr) (ly:music?)
150 (shift-duration-log expr 0 1))
153 % Declare shortcut music functions for Liber Hymnarius neumes
154 % table (experimental).
157 #(define (make-ligature music)
158 (make-music 'SequentialMusic
161 (make-music 'EventChord
163 (make-span-event 'LigatureEvent START)))
164 (ly:music-property music 'elements))
166 (make-music 'EventChord
168 (make-span-event 'LigatureEvent STOP)))))))
170 ligature = #(define-music-function
171 (location music) (ly:music?)
172 (make-ligature music))
174 %#(define (make-script x)
175 % (make-music 'ArticulationEvent
176 % 'articulation-type x))
178 %#(define (add-script m x)
180 % (equal? (ly:music-property m 'name) 'EventChord)
181 % (set! (ly:music-property m 'elements)
182 % (cons (make-script x)
183 % (ly:music-property m 'elements))))
186 %#(define (add-staccato m)
187 % (add-script m "staccato"))
189 % % \applyMusic #(lambda (x) (music-map add-staccato x)) { c c }
191 % % \climacus { x y z ... }:
192 % % \[ \virga x \inclinatum y \inclinatum z ... \]
194 %#(defmacro def-climacus-function (start stop)
195 % `(define-music-function (location music) (ly:music?)
196 % (make-music 'SequentialMusic
197 % 'elements (list 'LigatureStartEvent
198 % (ly:music-deep-copy ,start)
200 % (ly:music-deep-copy ,stop)
201 % 'LigatureStopEvent))))
202 %climacus = #(def-climacus-function startSequentialMusic stopSequentialMusic)
205 % Declare default layout; here for Vaticana style. In case there will
206 % be additional styles, we may want to create style-specific .ly files
207 % for inclusion (e.g. vaticana-init.ly), move the style-dependent stuff
208 % over there, leave the style-independent Gregorian stuff here, and let
209 % the style-specific file (vaticana-init.ly) include this file. The
210 % user then will have to include vaticana-init.ly instead of
216 %%% TODO: should ragged-right be the default?
220 line-thickness = #(/ (ly:output-def-lookup $defaultpaper 'staff-space) 7.0)
224 \override StaffSymbol #'color = #red
225 \override LedgerLineSpanner #'color = #red
229 \remove "Bar_number_engraver"
232 %%% FIXME: Musicologically seen, timing should be set to #f.
233 %%% Unfortunately, setting it to #f will result in no
234 %%% line-breakable items being created, such that the whole
235 %%% music will end up in a single line. Therefore, we
236 %%% currently set it to #t, until the ligature code is fixed
237 %%% to automatically insert breakable items.
242 %%% FIXME: Setting barAlways to #t would fix the above
243 %%% "timing = ##t" problem, but, surprisingly, it increases
244 %%% the space between ligatures. Hence, we set it to #f.
248 \override SpacingSpanner #'packed-spacing = ##t
251 %%% TODO: Play around with the following SpacingSpanner
252 %%% settings to yield better spacing between ligatures.
254 %%% FIXME: setting #'spacing-increment to a small value
255 %%% causes tons of "programming error: adding reverse spring,
256 %%% setting to unit" messages.
258 %\override SpacingSpanner #'base-shortest-duration = #(ly:make-moment 1 4)
259 %\override SpacingSpanner #'shortest-duration-space = #0
260 %\override SpacingSpanner #'average-spacing-wishes = ##f
261 %\override SpacingSpanner #'spacing-increment = #0.0
262 %\override SpacingSpanner #'uniform-stretching = ##t
267 % neumeDemoLayout defines a layout block suitable for notating pure
268 % Vaticana style neumes without any other notation symbols such as
269 % staff lines or clefs. This layout is useful for engraving neumes
270 % tables, such as that one in the lilypond manual section on
271 % Gregorian ligatures, or for educational works.
273 neumeDemoLayout = \layout {
277 \remove "Bar_number_engraver"
281 \remove "Clef_engraver"
282 \remove "Key_engraver"
283 \override StaffSymbol #'transparent = ##t
284 \remove "Time_signature_engraver"
285 \remove "Bar_engraver"
286 \override VerticalAxisGroup #'staff-staff-spacing = #'()
290 \remove Ligature_bracket_engraver
291 \consists Vaticana_ligature_engraver
292 \override NoteHead #'style = #'vaticana.punctum
293 \override Stem #'transparent = ##t
294 \override Flag #'transparent = ##t