1 %% Breathing signs from Hippolyte et Aricie
3 \once\override BreathingSign #'text = \markup \fontsize #2 "|"
4 \once\override BreathingSign #'Y-offset = #0
8 \once\override BreathingSign #'text = \markup \fontsize #2 "|"
9 \once\override BreathingSign #'Y-offset = #-1
13 \once\override BreathingSign #'text = \markup \fontsize #2 "|"
14 \once\override BreathingSign #'Y-offset = #-2
19 \once\override BreathingSign #'text = \markup \musicglyph #"scripts.caesura.straight"
23 dotSign=\markup\vcenter "╸"
25 %% New baroque scripts (Charpentier, Rameau...)
26 #(define-public baroque-script-alist
30 . (markup . ,(markup #:center-align #:sans #:fontsize -2 #:bold "t")))
34 ("arcTrill" ; + with an arc above (like a formata with a + signe instead of dot)
36 . (markup . ,(markup #:combine
37 #:concat (#:null #:translate '(0.3 . 0.8) #:rotate -90
38 #:musicglyph "accidentals.leftparen")
39 #:musicglyph "scripts.stopped")))
45 . (markup . ,(markup #:combine
46 #:concat (#:null #:translate '(0.3 . 0.65) #:rotate -90
47 #:musicglyph "accidentals.leftparen")
48 #:musicglyph "scripts.staccato")))
54 . (markup . ,(markup #:center-align #:line (#:musicglyph "period" #:musicglyph "period"))))
58 ("dotPrall" ; Articulation used Charpentier: a dot, followed by a prall sign
60 . (markup . ,(markup #:override '(word-space . 1)
61 #:line (#:vcenter "╸" #:vcenter #:musicglyph "scripts.prall"))))
65 ("dotDoublePrallDoublePrall"
67 . (markup . ,(markup #:override '(word-space . 2) #:override '(baseline-skip . 0)
68 #:column (#:line (#:vcenter "╸"
69 #:vcenter #:musicglyph "scripts.prallprall" )
70 #:line (#:transparent #:vcenter "╸"
71 #:vcenter #:musicglyph "scripts.prallprall")))))
77 . (markup . ,(markup #:override '(baseline-skip . 0)
78 #:center-align #:column (#:musicglyph "scripts.prall"
79 #:musicglyph "scripts.prall"))))
84 default-script-alist))
86 #(define (baroque-script-interface::print grob)
87 (let ((script-stencil (ly:grob-property grob 'script-stencil)))
88 (cond ((and (pair? script-stencil)
89 (eqv? 'markup (car script-stencil)))
90 (set! (ly:grob-property grob 'font-encoding) 'latin1)
91 (grob-interpret-markup grob (cdr script-stencil)))
93 (ly:script-interface::print grob)))))
98 scriptDefinitions = #baroque-script-alist
102 \override Script #'stencil = #baroque-script-interface::print
105 tr = #(make-articulation "t")
106 arcTrill = #(make-articulation "arcTrill")
107 arcDot = #(make-articulation "arcDot")
108 dotDot = #(make-articulation "dotDot")
109 dotPrall = #(make-articulation "dotPrall")
110 dotDoublePrallDoublePrall = #(make-articulation "dotDoublePrallDoublePrall")
111 doublePrall = #(make-articulation "doublePrall")
113 %% A slur and a prall, both joined on their right ends
115 \once\override Slur #'direction = #UP
116 \once\override Slur #'text = \markup\musicglyph #"scripts.prall"
117 \once\override Slur #'stencil =
119 (let* ((slur-stencil (ly:slur::print grob))
120 (coords (ly:slur::calc-control-points grob))
121 (X-ext (ly:stencil-extent slur-stencil X))
122 (Y-ext (ly:stencil-extent slur-stencil Y))
123 (text-stencil (ly:text-interface::print grob))
124 (text-width (interval-length (ly:stencil-extent text-stencil X)))
125 (prall-stencil (ly:stencil-translate
126 (ly:stencil-aligned-to text-stencil X LEFT)
127 (cons (- (cdr X-ext) text-width 0.17)
128 (+ (if (< (cdr (list-ref coords 3)) 2.8)
129 (- 2.8 (cdr (list-ref coords 3)))
131 (- (cdr (list-ref coords 3)) 0.15)))))
132 (combo-stencil (ly:stencil-add slur-stencil prall-stencil)))
133 (ly:stencil-translate combo-stencil (cons 0 0))))
134 \once\override Slur #'control-points =
136 (let* ((coords (ly:slur::calc-control-points grob))
137 (point-0 (list-ref coords 0))
138 (point-1 (list-ref coords 1))
139 (point-2 (list-ref coords 2))
140 (point-3 (list-ref coords 3))
141 (text-stencil (ly:text-interface::print grob))
142 (text-width (interval-length (ly:stencil-extent text-stencil X))))
143 (set-cdr! point-1 (+ (cdr point-1) 1))
144 (set-car! point-2 (+ (car point-2) (/ text-width 1.0)))
145 (set-car! point-3 (+ (car point-3) 0.34 (/ text-width 2.0)))
146 (set-cdr! point-3 (if (< (cdr point-3) 2.8)
148 (+ 0.5 (cdr point-3))))
149 (set-cdr! point-2 (+ (cdr point-3) 2.0))
154 %% For quarter note with eighth note flag and half note note head (in e.g. 3/2)
155 #(define-public (calc-white-note-head-glyph grob)
156 (let ((style (ly:grob-property grob 'style))
157 (duration-log (min 1 (ly:grob-property grob 'duration-log))))
158 (select-head-glyph style duration-log)))
161 \override Staff.NoteHead #'style = #'baroque
162 \override Staff.NoteHead #'glyph-name = #calc-white-note-head-glyph
164 whiteNoteHeadsOff = {
165 \revert Staff.NoteHead #'style
166 \revert Staff.NoteHead #'glyph-name
169 %% Black notation, for breve and whole notes
170 #(define-public (ly:note-head::print-black grob)
171 (let ((head-style (ly:grob-property grob 'style)))
174 (let* ((head-stencil (ly:note-head::print grob))
175 (duration (ly:grob-property grob 'duration-log))
176 (glyph-name (format #f "noteheads.s~a"
177 (ly:grob-property grob 'glyph-name)))
178 (glyph (grob-interpret-markup
180 (make-musicglyph-markup glyph-name))))
182 (ly:stencil-translate
183 (ly:stencil-aligned-to
186 ;; oval for whole note
188 (* 0.9 (/ (interval-length (ly:stencil-extent glyph X)) 2))
189 (* 1.1 (/ (interval-length (ly:stencil-extent glyph Y)) 2))
191 ;; rectangle for breve
192 (make-filled-box-stencil (ly:stencil-extent glyph X)
193 (ly:stencil-extent glyph Y)))
196 (cons (/ (interval-length (ly:stencil-extent head-stencil X)) 2)
200 (set! (ly:grob-property grob 'style) 'blackpetrucci)
201 (ly:note-head::print grob))
203 (ly:note-head::print grob)))))
206 #(define-music-function (parser location music) (ly:music?)
207 #{ \override NoteHead #'stencil = #ly:note-head::print-black
208 \override NoteHead #'Y-extent =
209 #(ly:make-unpure-pure-container
210 ly:grob::stencil-height
211 (lambda (grob b e) (ly:grob::stencil-height grob)))
213 \revert NoteHead #'stencil #})
215 ficta = { \once\set suggestAccidentals = ##t }
218 %% change a flat or sharp alteration into natural
219 %% unless 'ancient-style option is true
221 #(define-music-function (parser location fig) (ly:music?)
222 (if (eqv? #t (ly:get-option 'ancient-style))
226 (if (eqv? 'BassFigureEvent (ly:music-property music 'name))
227 (let ((alteration (ly:music-property music 'alteration)))
228 (if (and (number? alteration)
229 (or (= alteration 1/2) (= alteration -1/2)))
230 (set! (ly:music-property music 'alteration) 0))))