]> git.donarmstrong.com Git - lilypond.git/blob - ly/gregorian.ly
Web-ja: update introduction
[lilypond.git] / ly / gregorian.ly
1 %{
2   Shortcuts common for all styles of gregorian chant notation.
3   $Id$
4 %}
5
6 \version "2.19.22"
7
8 %
9 % Declare memorable shortcuts for special unicode characters
10 % that are used in chant notation.
11 %
12
13 % unicode 0132 (latin capital ligature IJ)
14 IJ = \lyricmode { IJ }
15 IIJ = \lyricmode { IIJ }
16
17 % unicode 0133 (latin small ligature ij)
18 ij = \lyricmode { ij }
19 iij = \lyricmode { iij }
20
21 %
22 % Given some music that represents lyrics, add a prefix to the first
23 % lyric event.
24 %
25 #(define (add-prefix-to-lyrics prefix music)
26    (let ((found? #f))
27      (map-some-music
28       (lambda (m)
29         (if found? m
30             (and (music-is-of-type? m 'lyric-event)
31                  (begin
32                    (set! (ly:music-property m 'text)
33                          (string-append prefix (ly:music-property m 'text)))
34                    (set! found? #t)
35                    m))))
36       music)))
37
38 % Add unicode 2123 (versicle) as prefix to lyrics.
39 versus =
40 #(define-music-function (music) (ly:music?)
41    (add-prefix-to-lyrics "℣" music))
42
43 % Add unicode 211F (response) as prefix to lyrics.
44 responsum =
45 #(define-music-function (music) (ly:music?)
46    (add-prefix-to-lyrics "℟" music))
47
48 %
49 % Declare head prefix shortcuts.
50 %
51 virga =
52   \once \override NoteHead.virga = ##t
53 stropha =
54   \once \override NoteHead.stropha = ##t
55 inclinatum =
56   \once \override NoteHead.inclinatum = ##t
57 auctum =
58   \once \override NoteHead.auctum = ##t
59 descendens =
60   \once \override NoteHead.descendens = ##t
61 ascendens =
62   \once \override NoteHead.ascendens = ##t
63 pes =
64   \once \override NoteHead.pes-or-flexa = ##t
65 flexa =
66   \once \override NoteHead.pes-or-flexa = ##t
67 oriscus =
68   \once \override NoteHead.oriscus = ##t
69 quilisma =
70   \once \override NoteHead.quilisma = ##t
71 deminutum =
72   \once \override NoteHead.deminutum = ##t
73 linea =
74   \once \override NoteHead.linea = ##t
75 cavum =
76   \once \override NoteHead.cavum = ##t
77
78 %
79 % Declare divisiones shortcuts.
80 %
81 virgula = {
82   \once \override BreathingSign.text = #(make-musicglyph-markup "scripts.rcomma")
83   \once \override BreathingSign.font-size = #-2
84
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)
88
89   \breathe
90 }
91 caesura = {
92   \once \override BreathingSign.text = #(make-musicglyph-markup "scripts.rvarcomma")
93   \once \override BreathingSign.font-size = #-2
94
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)
98
99   \breathe
100 }
101 divisioMinima = {
102   \once \override BreathingSign.stencil = #ly:breathing-sign::divisio-minima
103
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)
107
108   \breathe
109 }
110 divisioMaior = {
111   \once \override BreathingSign.stencil = #ly:breathing-sign::divisio-maior
112   \once \override BreathingSign.Y-offset = #0
113
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)
117
118   \breathe
119 }
120 divisioMaxima = {
121   \once \override BreathingSign.stencil = #ly:breathing-sign::divisio-maxima
122   \once \override BreathingSign.Y-offset = #0
123
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)
127
128   \breathe
129 }
130 finalis = {
131   \once \override BreathingSign.stencil = #ly:breathing-sign::finalis
132   \once \override BreathingSign.Y-offset = #0
133
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)
137
138   \breathe
139 }
140
141 %
142 % Declare articulation shortcuts.
143 %
144 accentus = #(make-articulation "accentus")
145 ictus = #(make-articulation "ictus")
146 semicirculus = #(make-articulation "semicirculus")
147 circulus = #(make-articulation "circulus")
148
149 %
150 % \augmentum increases the dot-count value of all note heads to which
151 % it is applied by one.
152 %
153 augmentum =
154 #(define-music-function (expr) (ly:music?)
155    (shift-duration-log expr 0 1))
156
157 %
158 % Declare shortcut music functions for Liber Hymnarius neumes
159 % table (experimental).
160 %
161
162 #(define (make-ligature music)
163    (make-music 'SequentialMusic
164                'elements (append
165                           (cons
166                            (make-music 'EventChord
167                                        'elements (list
168                                                   (make-span-event 'LigatureEvent START)))
169                            (ly:music-property music 'elements))
170                           (list
171                            (make-music 'EventChord
172                                        'elements (list
173                                                   (make-span-event 'LigatureEvent STOP)))))))
174
175 ligature = #(define-music-function
176               (location music) (ly:music?)
177               (make-ligature music))
178
179 %#(define (make-script x)
180 %   (make-music 'ArticulationEvent
181 %               'articulation-type x))
182 %
183 %#(define (add-script m x)
184 %   (if
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))))
189 %   m)
190 %
191 %#(define (add-staccato m)
192 %   (add-script m "staccato"))
193 %
194 % % \applyMusic #(lambda (x) (music-map add-staccato x)) { c c }
195 %
196 % % \climacus { x y z ... }:
197 % % \[ \virga x \inclinatum y \inclinatum z ... \]
198 %
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)
204 %                        music
205 %                        (ly:music-deep-copy ,stop)
206 %                       'LigatureStopEvent))))
207 %climacus = #(def-climacus-function startSequentialMusic stopSequentialMusic)
208
209 %
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
216 % gregorian.ly.
217 %
218 \layout {
219     indent = 0.0
220
221     %%% TODO: should ragged-right be the default?
222     %ragged-right = ##t
223     ragged-last = ##t
224
225     line-thickness = #(/ (ly:output-def-lookup $defaultpaper 'staff-space) 7.0)
226
227     \context {
228         \VaticanaStaff
229          \override StaffSymbol.color = #red
230          \override LedgerLineSpanner.color = #red
231     }
232     \context {
233         \Score
234         \remove "Bar_number_engraver"
235
236         %%%
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.
243         %%%
244         timing = ##t
245
246         %%%
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.
250         %%%
251         barAlways = ##f
252
253         \override SpacingSpanner.packed-spacing = ##t
254
255         %%%
256         %%% TODO: Play around with the following SpacingSpanner
257         %%% settings to yield better spacing between ligatures.
258         %%%
259         %%% FIXME: setting #'spacing-increment to a small value
260         %%% causes tons of "programming error: adding reverse spring,
261         %%% setting to unit" messages.
262         %%%
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
268     }
269 }
270
271 %
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.
277 %
278 neumeDemoLayout = \layout {
279     interscoreline = 1
280     \context {
281         \Score
282         \remove "Bar_number_engraver"
283     }
284     \context {
285         \Staff
286         \remove "Clef_engraver"
287         \remove "Key_engraver"
288         \hide StaffSymbol
289         \remove "Time_signature_engraver"
290         \remove "Bar_engraver"
291         \override VerticalAxisGroup.staff-staff-spacing = #'()
292     }
293     \context {
294         \Voice
295         \remove "Ligature_bracket_engraver"
296         \consists "Vaticana_ligature_engraver"
297         \override NoteHead.style = #'vaticana.punctum
298         \hide Stem
299     }
300 }
301
302 %%% Local Variables:
303 %%% coding: utf-8
304 %%% End: