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 (music) (ly:music?)
41 (add-prefix-to-lyrics "℣" music))
43 % Add unicode 211F (response) as prefix to lyrics.
45 #(define-music-function (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.minimum-X-extent = #'(-1.0 . 0.0)
87 \once \override BreathingSign.minimum-Y-extent = #'(-2.5 . 2.5)
92 \once \override BreathingSign.text = #(make-musicglyph-markup "scripts.rvarcomma")
93 \once \override BreathingSign.font-size = #-2
95 % Workaround: add padding. Correct fix would be spacing engine handle this.
96 \once \override BreathingSign.minimum-X-extent = #'(-1.0 . 0.0)
97 \once \override BreathingSign.minimum-Y-extent = #'(-2.5 . 2.5)
102 \once \override BreathingSign.stencil = #ly:breathing-sign::divisio-minima
104 % Workaround: add padding. Correct fix would be spacing engine handle this.
105 \once \override BreathingSign.minimum-X-extent = #'(-1.0 . 0.0)
106 \once \override BreathingSign.minimum-Y-extent = #'(-2.5 . 2.5)
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.minimum-X-extent = #'(-1.0 . 0.0)
116 \once \override BreathingSign.minimum-Y-extent = #'(-2.5 . 2.5)
121 \once \override BreathingSign.stencil = #ly:breathing-sign::divisio-maxima
122 \once \override BreathingSign.Y-offset = #0
124 % Workaround: add padding. Correct fix would be spacing engine handle this.
125 \once \override BreathingSign.minimum-X-extent = #'(-1.0 . 0.0)
126 \once \override BreathingSign.minimum-Y-extent = #'(-2.5 . 2.5)
131 \once \override BreathingSign.stencil = #ly:breathing-sign::finalis
132 \once \override BreathingSign.Y-offset = #0
134 % Workaround: add padding. Correct fix would be spacing engine handle this.
135 \once \override BreathingSign.minimum-X-extent = #'(-1.0 . 0.0)
136 \once \override BreathingSign.minimum-Y-extent = #'(-2.5 . 2.5)
142 % Declare articulation shortcuts.
144 accentus = #(make-articulation "accentus")
145 ictus = #(make-articulation "ictus")
146 semicirculus = #(make-articulation "semicirculus")
147 circulus = #(make-articulation "circulus")
150 % \augmentum increases the dot-count value of all note heads to which
151 % it is applied by one.
154 #(define-music-function (expr) (ly:music?)
155 (shift-duration-log expr 0 1))
158 % Declare shortcut music functions for Liber Hymnarius neumes
159 % table (experimental).
162 #(define (make-ligature music)
163 (make-music 'SequentialMusic
166 (make-music 'EventChord
168 (make-span-event 'LigatureEvent START)))
169 (ly:music-property music 'elements))
171 (make-music 'EventChord
173 (make-span-event 'LigatureEvent STOP)))))))
175 ligature = #(define-music-function
176 (location music) (ly:music?)
177 (make-ligature music))
179 %#(define (make-script x)
180 % (make-music 'ArticulationEvent
181 % 'articulation-type x))
183 %#(define (add-script m x)
185 % (equal? (ly:music-property m 'name) 'EventChord)
186 % (set! (ly:music-property m 'elements)
187 % (cons (make-script x)
188 % (ly:music-property m 'elements))))
191 %#(define (add-staccato m)
192 % (add-script m "staccato"))
194 % % \applyMusic #(lambda (x) (music-map add-staccato x)) { c c }
196 % % \climacus { x y z ... }:
197 % % \[ \virga x \inclinatum y \inclinatum z ... \]
199 %#(defmacro def-climacus-function (start stop)
200 % `(define-music-function (location music) (ly:music?)
201 % (make-music 'SequentialMusic
202 % 'elements (list 'LigatureStartEvent
203 % (ly:music-deep-copy ,start)
205 % (ly:music-deep-copy ,stop)
206 % 'LigatureStopEvent))))
207 %climacus = #(def-climacus-function startSequentialMusic stopSequentialMusic)
210 % Declare default layout; here for Vaticana style. In case there will
211 % be additional styles, we may want to create style-specific .ly files
212 % for inclusion (e.g. vaticana-init.ly), move the style-dependent stuff
213 % over there, leave the style-independent Gregorian stuff here, and let
214 % the style-specific file (vaticana-init.ly) include this file. The
215 % user then will have to include vaticana-init.ly instead of
221 %%% TODO: should ragged-right be the default?
225 line-thickness = #(/ (ly:output-def-lookup $defaultpaper 'staff-space) 7.0)
229 \override StaffSymbol.color = #red
230 \override LedgerLineSpanner.color = #red
234 \remove "Bar_number_engraver"
237 %%% FIXME: Musicologically seen, timing should be set to #f.
238 %%% Unfortunately, setting it to #f will result in no
239 %%% line-breakable items being created, such that the whole
240 %%% music will end up in a single line. Therefore, we
241 %%% currently set it to #t, until the ligature code is fixed
242 %%% to automatically insert breakable items.
247 %%% FIXME: Setting barAlways to #t would fix the above
248 %%% "timing = ##t" problem, but, surprisingly, it increases
249 %%% the space between ligatures. Hence, we set it to #f.
253 \override SpacingSpanner.packed-spacing = ##t
256 %%% TODO: Play around with the following SpacingSpanner
257 %%% settings to yield better spacing between ligatures.
259 %%% FIXME: setting #'spacing-increment to a small value
260 %%% causes tons of "programming error: adding reverse spring,
261 %%% setting to unit" messages.
263 %\override SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/4)
264 %\override SpacingSpanner.shortest-duration-space = #0
265 %\override SpacingSpanner.average-spacing-wishes = ##f
266 %\override SpacingSpanner.spacing-increment = #0.0
267 %\override SpacingSpanner.uniform-stretching = ##t
272 % neumeDemoLayout defines a layout block suitable for notating pure
273 % Vaticana style neumes without any other notation symbols such as
274 % staff lines or clefs. This layout is useful for engraving neumes
275 % tables, such as that one in the lilypond manual section on
276 % Gregorian ligatures, or for educational works.
278 neumeDemoLayout = \layout {
282 \remove "Bar_number_engraver"
286 \remove "Clef_engraver"
287 \remove "Key_engraver"
289 \remove "Time_signature_engraver"
290 \remove "Bar_engraver"
291 \override VerticalAxisGroup.staff-staff-spacing = #'()
295 \remove "Ligature_bracket_engraver"
296 \consists "Vaticana_ligature_engraver"
297 \override NoteHead.style = #'vaticana.punctum