2 \defineBarLine "!!:" #'("" "!!:" "")
3 \defineBarLine "|!:" #'("|" "|!:" "|! ")
4 \defineBarLine "!:" #'("" "!:" "! ")
5 \defineBarLine ":!." #'(":!." "" " !.")
6 \defineBarLine ":!|" #'(":!|" "" " !|")
7 \defineBarLine ":||:" #'(":||:" "" " || ")
8 \defineBarLine "|;|" #'("|;|" "" "| |")
9 \defineBarLine " .|:" #'("" ".|:" ".| ")
11 %% Breathing signs from Hippolyte et Aricie
13 \once\override BreathingSign #'text = \markup \fontsize #2 "|"
14 \once\override BreathingSign #'Y-offset = #0
18 \once\override BreathingSign #'text = \markup \fontsize #2 "|"
19 \once\override BreathingSign #'Y-offset = #-1
23 \once\override BreathingSign #'text = \markup \fontsize #2 "|"
24 \once\override BreathingSign #'Y-offset = #-2
29 \once\override BreathingSign #'text = \markup \musicglyph #"scripts.caesura.straight"
34 \once\override BreathingSign #'text = \markup \musicglyph #"scripts.caesura.straight"
35 \once\override BreathingSign #'Y-offset = #-1
39 \once\override BreathingSign #'text = \markup \musicglyph #"scripts.caesura.straight"
40 \once\override BreathingSign #'Y-offset = #-2
44 dotSign=\markup\vcenter "╸"
46 %% New baroque scripts (Charpentier, Rameau...)
47 #(define-public baroque-script-alist
51 . (markup . ,(markup #:center-align #:sans #:fontsize -2 #:bold "t")))
57 . (markup . , #{ \markup\center-align\concat\vcenter {
58 \smaller\smaller\sharp
59 \musicglyph #"scripts.stopped" } #}))
65 . (markup . , #{ \markup\center-align\concat\vcenter {
66 \smaller\smaller\natural
67 \musicglyph #"scripts.stopped" } #}))
73 . (markup . , #{ \markup\center-align\concat {
74 \smaller\smaller\musicglyph #"accidentals.leftparen"
75 \musicglyph #"scripts.stopped"
76 \translate #'(-0.6 . 0) \smaller\smaller\musicglyph #"accidentals.rightparen"
83 . (markup . , #{ \markup\center-align\concat {
84 \smaller\smaller\musicglyph #"accidentals.leftparen"
85 \musicglyph #"scripts.prall"
86 \translate #'(-0.6 . 0) \smaller\smaller\musicglyph #"accidentals.rightparen"
91 ("arcTrill" ; + with an arc above (like a formata with a + signe instead of dot)
93 . (markup . ,(markup #:combine
94 #:concat (#:null #:translate '(0.3 . 0.8) #:rotate -90
95 #:musicglyph "accidentals.leftparen")
96 #:musicglyph "scripts.stopped")))
102 . (markup . ,(markup #:combine
103 #:concat (#:null #:translate '(0.3 . 0.65) #:rotate -90
104 #:musicglyph "accidentals.leftparen")
105 #:musicglyph "scripts.staccato")))
107 (avoid-slur . around)
113 \markup\combine\combine
114 \translate #'(0 . 1) \musicglyph #"scripts.ufermata"
115 \with-color #white \translate #'(0 . 1.2) \draw-circle #0.4 #0 ##t
117 \smaller\smaller\translate #'(0 . 0) \musicglyph #"scripts.ufermata"
118 \with-color #white \translate #'(0 . 0.2) \draw-circle #0.4 #0 ##t
121 (avoid-slur . around)
127 \markup\combine\combine
128 \translate #'(0 . 1) \musicglyph #"scripts.ufermata"
129 \with-color #white \translate #'(0 . 1.2) \draw-circle #0.4 #0 ##t
130 \smaller\smaller \translate #'(0 . 0) \musicglyph #"scripts.ufermata"
133 (avoid-slur . around)
137 . (markup . ,(markup #:center-align #:line (#:musicglyph "period" #:musicglyph "period"))))
139 (avoid-slur . around)
141 ("dotPrall" ; Articulation used Charpentier: a dot, followed by a prall sign
143 . (markup . ,(markup #:override '(word-space . 1)
144 #:line (#:vcenter "╸" #:vcenter #:musicglyph "scripts.prall"))))
146 (avoid-slur . around)
148 ("dotDoublePrallDoublePrall"
150 . (markup . ,(markup #:override '(word-space . 2) #:override '(baseline-skip . 0)
151 #:column (#:line (#:vcenter "╸"
152 #:vcenter #:musicglyph "scripts.prallprall" )
153 #:line (#:transparent #:vcenter "╸"
154 #:vcenter #:musicglyph "scripts.prallprall")))))
156 (avoid-slur . around)
160 . (markup . ,(markup #:override '(baseline-skip . 0)
161 #:center-align #:column (#:musicglyph "scripts.prall"
162 #:musicglyph "scripts.prall"))))
164 (avoid-slur . around)
167 default-script-alist))
169 #(define (baroque-script-interface::print grob)
170 (let ((script-stencil (ly:grob-property grob 'script-stencil)))
171 (cond ((and (pair? script-stencil)
172 (eqv? 'markup (car script-stencil)))
173 (set! (ly:grob-property grob 'font-encoding) 'latin1)
174 (grob-interpret-markup grob (cdr script-stencil)))
176 (ly:script-interface::print grob)))))
181 scriptDefinitions = #baroque-script-alist
185 \override Script #'stencil = #baroque-script-interface::print
188 trill = #(make-articulation "stopped")
189 trillSharp = #(make-articulation "trillSharp")
190 trillNatural = #(make-articulation "trillNatural")
191 tr = #(make-articulation "t")
192 trillSug = #(make-articulation "trillSug")
193 prallSug = #(make-articulation "prallSug")
194 arcTrill = #(make-articulation "arcTrill")
195 arcDot = #(make-articulation "arcDot")
196 arcArc = #(make-articulation "arcArc")
197 arcArcDot = #(make-articulation "arcArcDot")
198 dotDot = #(make-articulation "dotDot")
199 dotPrall = #(make-articulation "dotPrall")
200 dotDoublePrallDoublePrall = #(make-articulation "dotDoublePrallDoublePrall")
201 doublePrall = #(make-articulation "doublePrall")
207 \override Script #'avoid-slur = #'outside
212 \override Script #'avoid-slur = #'outside
216 %% A slur and a prall, both joined on their right ends
218 \once\override Slur #'direction = #UP
219 \once\override Slur #'text = \markup\musicglyph #"scripts.prall"
220 \once\override Slur #'stencil =
222 (let* ((slur-stencil (ly:slur::print grob))
223 (coords (ly:slur::calc-control-points grob))
224 (X-ext (ly:stencil-extent slur-stencil X))
225 (Y-ext (ly:stencil-extent slur-stencil Y))
226 (text-stencil (ly:text-interface::print grob))
227 (text-width (interval-length (ly:stencil-extent text-stencil X)))
228 (prall-stencil (ly:stencil-translate
229 (ly:stencil-aligned-to text-stencil X LEFT)
230 (cons (- (cdr X-ext) text-width 0.17)
231 (+ (if (< (cdr (list-ref coords 3)) 2.8)
232 (- 2.8 (cdr (list-ref coords 3)))
234 (- (cdr (list-ref coords 3)) 0.15)))))
235 (combo-stencil (ly:stencil-add slur-stencil prall-stencil)))
236 (ly:stencil-translate combo-stencil (cons 0 0))))
237 \once\override Slur #'control-points =
239 (let* ((coords (ly:slur::calc-control-points grob))
240 (point-0 (list-ref coords 0))
241 (point-1 (list-ref coords 1))
242 (point-2 (list-ref coords 2))
243 (point-3 (list-ref coords 3))
244 (text-stencil (ly:text-interface::print grob))
245 (text-width (interval-length (ly:stencil-extent text-stencil X))))
246 (set-cdr! point-1 (+ (cdr point-1) 1))
247 (set-car! point-2 (+ (car point-2) (/ text-width 1.0)))
248 (set-car! point-3 (+ (car point-3) 0.34 (/ text-width 2.0)))
249 (set-cdr! point-3 (if (< (cdr point-3) 2.8)
251 (+ 0.5 (cdr point-3))))
252 (set-cdr! point-2 (+ (cdr point-3) 2.0))
257 %% For quarter note with eighth note flag and half note note head (in e.g. 3/2)
258 #(define-public (calc-white-note-head-glyph grob)
259 (let ((style (ly:grob-property grob 'style))
260 (duration-log (min 1 (ly:grob-property grob 'duration-log))))
261 (select-head-glyph style duration-log)))
264 \override Staff.NoteHead #'style = #'baroque
265 \override Staff.NoteHead #'glyph-name = #calc-white-note-head-glyph
267 whiteNoteHeadsOff = {
268 \revert Staff.NoteHead #'style
269 \revert Staff.NoteHead #'glyph-name
272 %% Black notation, for breve and whole notes
273 #(define-public (ly:note-head::print-black grob)
274 (let ((head-style (ly:grob-property grob 'style)))
277 (let* ((head-stencil (ly:note-head::print grob))
278 (duration (ly:grob-property grob 'duration-log))
279 (glyph-name (format #f "noteheads.s~a"
280 (ly:grob-property grob 'glyph-name)))
281 (glyph (grob-interpret-markup
283 (make-musicglyph-markup glyph-name))))
285 (ly:stencil-translate
286 (ly:stencil-aligned-to
289 ;; oval for whole note
291 (* 0.9 (/ (interval-length (ly:stencil-extent glyph X)) 2))
292 (* 1.1 (/ (interval-length (ly:stencil-extent glyph Y)) 2))
294 ;; rectangle for breve
295 (make-filled-box-stencil (ly:stencil-extent glyph X)
296 (ly:stencil-extent glyph Y)))
299 (cons (/ (interval-length (ly:stencil-extent head-stencil X)) 2)
303 (set! (ly:grob-property grob 'style) 'blackpetrucci)
304 (ly:note-head::print grob))
306 (ly:note-head::print grob)))))
309 #(define-music-function (parser location music) (ly:music?)
310 #{ \override NoteHead #'stencil = #ly:note-head::print-black
311 \override NoteHead #'Y-extent =
312 #(ly:make-unpure-pure-container
313 ly:grob::stencil-height
314 (lambda (grob b e) (ly:grob::stencil-height grob)))
316 \revert NoteHead #'stencil #})
318 ficta = { \once\set suggestAccidentals = ##t }
321 %% change a flat or sharp alteration into natural
322 %% unless 'ancient-style option is true
324 #(define-music-function (parser location fig) (ly:music?)
325 (if (eqv? #t (ly:get-option 'ancient-style))
329 (if (eqv? 'BassFigureEvent (ly:music-property music 'name))
330 (let ((alteration (ly:music-property music 'alteration)))
331 (if (and (number? alteration)
332 (or (= alteration 1/2) (= alteration -1/2)))
333 (set! (ly:music-property music 'alteration) 0))))
339 #(make-music 'TextScriptEvent
340 'text (markup #:whiteout #:italic #:general-align X -0.75
343 #(make-music 'TextScriptEvent
344 'text (markup #:whiteout #:italic #:general-align X -0.75
348 #(make-music 'TextScriptEvent
349 'text (markup #:whiteout #:italic #:general-align X -0.5 "doux"))
351 #(make-music 'TextScriptEvent
352 'text (markup #:whiteout #:italic #:general-align X -0.5 "[doux]"))
355 #(make-music 'TextScriptEvent
356 'text (markup #:whiteout #:italic #:general-align X -0.75
359 #(make-music 'TextScriptEvent
360 'text (markup #:whiteout #:italic #:general-align X -0.75
364 #(make-music 'TextScriptEvent
365 'text (markup #:whiteout #:italic #:general-align X -0.9
368 #(make-music 'TextScriptEvent
369 'text (markup #:whiteout #:italic #:general-align X -0.9
373 #(make-music 'TextScriptEvent
374 'text (markup #:whiteout #:italic #:general-align X -0.75
377 #(make-music 'TextScriptEvent
378 'text (markup #:whiteout #:italic #:general-align X -0.75
381 #(make-music 'TextScriptEvent
382 'text (markup #:whiteout #:italic #:general-align X -0.75
386 #(make-music 'TextScriptEvent
387 'text (markup #:whiteout #:italic #:general-align X -0.75
390 #(make-music 'TextScriptEvent
391 'text (markup #:whiteout #:italic #:general-align X -0.75
395 #(make-music 'TextScriptEvent
396 'text (markup #:whiteout #:italic #:general-align X -0.75
400 #(make-music 'TextScriptEvent
401 'text (markup #:whiteout #:italic #:general-align X -0.75
404 #(make-music 'TextScriptEvent
405 'text (markup #:whiteout #:italic #:general-align X -0.75
409 #(make-music 'TextScriptEvent
410 'text (markup #:whiteout #:italic #:general-align X -0.5 "fort"))
412 #(make-music 'TextScriptEvent
413 'text (markup #:whiteout #:italic #:general-align X -0.5 "[fort]"))
416 #(make-music 'TextScriptEvent
417 'text (markup #:whiteout #:italic #:general-align X -0.75
420 #(make-music 'TextScriptEvent
421 'text (markup #:whiteout #:italic #:general-align X -0.75
427 'text #{\markup\whiteout\italic\general-align #X #-0.5 viste #})