2 \defineBarLine "!!:" #'("" "!!:" "!! ")
3 \defineBarLine ".!:" #'("|" ".!:" ".! ")
4 \defineBarLine "|!:" #'("|" "|!:" "|! ")
5 \defineBarLine "!:" #'("" "!:" "! ")
6 \defineBarLine ":!." #'(":!." "" " !.")
7 \defineBarLine ":!|" #'(":!|" "" " !|")
8 \defineBarLine ":||:" #'(":||:" "" " || ")
9 \defineBarLine "|;|" #'("|;|" "" "| |")
10 \defineBarLine " .|:" #'("" ".|:" ".| ")
12 %% Breathing signs from Hippolyte et Aricie
14 \once\override BreathingSign #'text = \markup \fontsize #2 "|"
15 \once\override BreathingSign #'Y-offset = #0
19 \once\override BreathingSign #'text = \markup \fontsize #2 "|"
20 \once\override BreathingSign #'Y-offset = #-1
24 \once\override BreathingSign #'text = \markup \fontsize #2 "|"
25 \once\override BreathingSign #'Y-offset = #-2
30 \once\override BreathingSign #'text = \markup \musicglyph #"scripts.caesura.straight"
35 \once\override BreathingSign #'text = \markup \musicglyph #"scripts.caesura.straight"
36 \once\override BreathingSign #'Y-offset = #-1
40 \once\override BreathingSign #'text = \markup \musicglyph #"scripts.caesura.straight"
41 \once\override BreathingSign #'Y-offset = #-2
45 dotSign=\markup\vcenter "╸"
47 %% New baroque scripts (Charpentier, Rameau...)
48 #(define-public baroque-script-alist
52 . (markup . ,(markup #:center-align #:sans #:fontsize -2 #:bold "t")))
58 . (markup . , #{ \markup\center-align\concat\vcenter {
59 \smaller\smaller\sharp
60 \musicglyph #"scripts.stopped" } #}))
66 . (markup . , #{ \markup\center-align\concat\vcenter {
67 \smaller\smaller\natural
68 \musicglyph #"scripts.stopped" } #}))
74 . (markup . , #{ \markup\center-align\concat {
75 \smaller\smaller\musicglyph #"accidentals.leftparen"
76 \musicglyph #"scripts.stopped"
77 \translate #'(-0.6 . 0) \smaller\smaller\musicglyph #"accidentals.rightparen"
84 . (markup . , #{ \markup\center-align\concat {
85 \smaller\smaller\musicglyph #"accidentals.leftparen"
86 \musicglyph #"scripts.prall"
87 \translate #'(-0.6 . 0) \smaller\smaller\musicglyph #"accidentals.rightparen"
92 ("arcTrill" ; + with an arc above (like a formata with a + signe instead of dot)
94 . (markup . ,(markup #:combine
95 #:concat (#:null #:translate '(0.3 . 0.8) #:rotate -90
96 #:musicglyph "accidentals.leftparen")
97 #:musicglyph "scripts.stopped")))
103 . (markup . ,(markup #:combine
104 #:concat (#:null #:translate '(0.3 . 0.65) #:rotate -90
105 #:musicglyph "accidentals.leftparen")
106 #:musicglyph "scripts.staccato")))
108 (avoid-slur . around)
114 \markup\combine\combine
115 \translate #'(0 . 1) \musicglyph #"scripts.ufermata"
116 \with-color #white \translate #'(0 . 1.2) \draw-circle #0.4 #0 ##t
118 \smaller\smaller\translate #'(0 . 0) \musicglyph #"scripts.ufermata"
119 \with-color #white \translate #'(0 . 0.2) \draw-circle #0.4 #0 ##t
122 (avoid-slur . around)
128 \markup\combine\combine
129 \translate #'(0 . 1) \musicglyph #"scripts.ufermata"
130 \with-color #white \translate #'(0 . 1.2) \draw-circle #0.4 #0 ##t
131 \smaller\smaller \translate #'(0 . 0) \musicglyph #"scripts.ufermata"
134 (avoid-slur . around)
138 . (markup . ,(markup #:center-align #:line (#:musicglyph "period" #:musicglyph "period"))))
140 (avoid-slur . around)
142 ("dotPrall" ; Articulation used Charpentier: a dot, followed by a prall sign
144 . (markup . ,(markup #:override '(word-space . 1)
145 #:line (#:vcenter "╸" #:vcenter #:musicglyph "scripts.prall"))))
147 (avoid-slur . around)
149 ("dotDoublePrallDoublePrall"
151 . (markup . ,(markup #:override '(word-space . 2) #:override '(baseline-skip . 0)
152 #:column (#:line (#:vcenter "╸"
153 #:vcenter #:musicglyph "scripts.prallprall" )
154 #:line (#:transparent #:vcenter "╸"
155 #:vcenter #:musicglyph "scripts.prallprall")))))
157 (avoid-slur . around)
161 . (markup . ,(markup #:override '(baseline-skip . 0)
162 #:center-align #:column (#:musicglyph "scripts.prall"
163 #:musicglyph "scripts.prall"))))
165 (avoid-slur . around)
168 default-script-alist))
170 #(define (baroque-script-interface::print grob)
171 (let ((script-stencil (ly:grob-property grob 'script-stencil)))
172 (cond ((and (pair? script-stencil)
173 (eqv? 'markup (car script-stencil)))
174 (set! (ly:grob-property grob 'font-encoding) 'latin1)
175 (grob-interpret-markup grob (cdr script-stencil)))
177 (ly:script-interface::print grob)))))
182 scriptDefinitions = #baroque-script-alist
186 \override Script #'stencil = #baroque-script-interface::print
189 trill = #(make-articulation "stopped")
190 trillSharp = #(make-articulation "trillSharp")
191 trillNatural = #(make-articulation "trillNatural")
192 tr = #(make-articulation "t")
193 trillSug = #(make-articulation "trillSug")
194 prallSug = #(make-articulation "prallSug")
195 arcTrill = #(make-articulation "arcTrill")
196 arcDot = #(make-articulation "arcDot")
197 arcArc = #(make-articulation "arcArc")
198 arcArcDot = #(make-articulation "arcArcDot")
199 dotDot = #(make-articulation "dotDot")
200 dotPrall = #(make-articulation "dotPrall")
201 dotDoublePrallDoublePrall = #(make-articulation "dotDoublePrallDoublePrall")
202 doublePrall = #(make-articulation "doublePrall")
208 \override Script #'avoid-slur = #'outside
213 \override Script #'avoid-slur = #'outside
217 %% A slur and a prall, both joined on their right ends
219 \once\override Slur #'direction = #UP
220 \once\override Slur #'text = \markup\musicglyph #"scripts.prall"
221 \once\override Slur #'stencil =
223 (let* ((slur-stencil (ly:slur::print grob))
224 (coords (ly:slur::calc-control-points grob))
225 (X-ext (ly:stencil-extent slur-stencil X))
226 (Y-ext (ly:stencil-extent slur-stencil Y))
227 (text-stencil (ly:text-interface::print grob))
228 (text-width (interval-length (ly:stencil-extent text-stencil X)))
229 (prall-stencil (ly:stencil-translate
230 (ly:stencil-aligned-to text-stencil X LEFT)
231 (cons (- (cdr X-ext) text-width 0.17)
232 (+ (if (< (cdr (list-ref coords 3)) 2.8)
233 (- 2.8 (cdr (list-ref coords 3)))
235 (- (cdr (list-ref coords 3)) 0.15)))))
236 (combo-stencil (ly:stencil-add slur-stencil prall-stencil)))
237 (ly:stencil-translate combo-stencil (cons 0 0))))
238 \once\override Slur #'control-points =
240 (let* ((coords (ly:slur::calc-control-points grob))
241 (point-0 (list-ref coords 0))
242 (point-1 (list-ref coords 1))
243 (point-2 (list-ref coords 2))
244 (point-3 (list-ref coords 3))
245 (text-stencil (ly:text-interface::print grob))
246 (text-width (interval-length (ly:stencil-extent text-stencil X))))
247 (set-cdr! point-1 (+ (cdr point-1) 1))
248 (set-car! point-2 (+ (car point-2) (/ text-width 1.0)))
249 (set-car! point-3 (+ (car point-3) 0.34 (/ text-width 2.0)))
250 (set-cdr! point-3 (if (< (cdr point-3) 2.8)
252 (+ 0.5 (cdr point-3))))
253 (set-cdr! point-2 (+ (cdr point-3) 2.0))
258 %% For quarter note with eighth note flag and half note note head (in e.g. 3/2)
259 #(define-public (calc-white-note-head-glyph grob)
260 (let ((style (ly:grob-property grob 'style))
261 (duration-log (min 1 (ly:grob-property grob 'duration-log))))
262 (select-head-glyph style duration-log)))
265 \override Staff.NoteHead #'style = #'baroque
266 \override Staff.NoteHead #'glyph-name = #calc-white-note-head-glyph
268 whiteNoteHeadsOff = {
269 \revert Staff.NoteHead #'style
270 \revert Staff.NoteHead #'glyph-name
273 %% Black notation, for breve and whole notes
274 #(define-public (ly:note-head::print-black grob)
275 (let ((head-style (ly:grob-property grob 'style)))
278 (let* ((head-stencil (ly:note-head::print grob))
279 (duration (ly:grob-property grob 'duration-log))
280 (glyph-name (format #f "noteheads.s~a"
281 (ly:grob-property grob 'glyph-name)))
282 (glyph (grob-interpret-markup
284 (make-musicglyph-markup glyph-name))))
286 (ly:stencil-translate
287 (ly:stencil-aligned-to
290 ;; oval for whole note
292 (* 0.9 (/ (interval-length (ly:stencil-extent glyph X)) 2))
293 (* 1.1 (/ (interval-length (ly:stencil-extent glyph Y)) 2))
295 ;; rectangle for breve
296 (make-filled-box-stencil (ly:stencil-extent glyph X)
297 (ly:stencil-extent glyph Y)))
300 (cons (/ (interval-length (ly:stencil-extent head-stencil X)) 2)
304 (set! (ly:grob-property grob 'style) 'blackpetrucci)
305 (ly:note-head::print grob))
307 (ly:note-head::print grob)))))
310 #(define-music-function (parser location music) (ly:music?)
311 #{ \override NoteHead #'stencil = #ly:note-head::print-black
312 \override NoteHead #'Y-extent =
313 #(ly:make-unpure-pure-container
314 ly:grob::stencil-height
315 (lambda (grob b e) (ly:grob::stencil-height grob)))
317 \revert NoteHead #'stencil #})
319 ficta = { \once\set suggestAccidentals = ##t }
322 %% change a flat or sharp alteration into natural
323 %% unless 'ancient-style option is true
325 #(define-music-function (parser location fig) (ly:music?)
326 (if (eqv? #t (ly:get-option 'ancient-style))
330 (if (eqv? 'BassFigureEvent (ly:music-property music 'name))
331 (let ((alteration (ly:music-property music 'alteration)))
332 (if (and (number? alteration)
333 (or (= alteration 1/2) (= alteration -1/2)))
334 (set! (ly:music-property music 'alteration) 0))))
340 #(make-music 'TextScriptEvent
341 'text (markup #:whiteout #:italic #:general-align X -0.75
344 #(make-music 'TextScriptEvent
345 'text (markup #:whiteout #:italic #:general-align X -0.75
349 #(make-music 'TextScriptEvent
350 'text (markup #:whiteout #:italic #:general-align X -0.5 "doux"))
352 #(make-music 'TextScriptEvent
353 'text (markup #:whiteout #:italic #:general-align X -0.5 "[doux]"))
356 #(make-music 'TextScriptEvent
357 'text (markup #:whiteout #:italic #:general-align X -0.75
360 #(make-music 'TextScriptEvent
361 'text (markup #:whiteout #:italic #:general-align X -0.75
365 #(make-music 'TextScriptEvent
366 'text (markup #:whiteout #:italic #:general-align X -0.9
369 #(make-music 'TextScriptEvent
370 'text (markup #:whiteout #:italic #:general-align X -0.9
374 #(make-music 'TextScriptEvent
375 'text (markup #:whiteout #:italic #:general-align X -0.75
378 #(make-music 'TextScriptEvent
379 'text (markup #:whiteout #:italic #:general-align X -0.75
382 #(make-music 'TextScriptEvent
383 'text (markup #:whiteout #:italic #:general-align X -0.75
387 #(make-music 'TextScriptEvent
388 'text (markup #:whiteout #:italic #:general-align X -0.75
391 #(make-music 'TextScriptEvent
392 'text (markup #:whiteout #:italic #:general-align X -0.75
396 #(make-music 'TextScriptEvent
397 'text (markup #:whiteout #:italic #:general-align X -0.75
401 #(make-music 'TextScriptEvent
402 'text (markup #:whiteout #:italic #:general-align X -0.75
405 #(make-music 'TextScriptEvent
406 'text (markup #:whiteout #:italic #:general-align X -0.75
410 #(make-music 'TextScriptEvent
411 'text (markup #:whiteout #:italic #:general-align X -0.5 "fort"))
413 #(make-music 'TextScriptEvent
414 'text (markup #:whiteout #:italic #:general-align X -0.5 "[fort]"))
417 #(make-music 'TextScriptEvent
418 'text (markup #:whiteout #:italic #:general-align X -0.75
421 #(make-music 'TextScriptEvent
422 'text (markup #:whiteout #:italic #:general-align X -0.75
428 'text #{\markup\whiteout\italic\general-align #X #-0.5 viste #})