Le Bourgeois Gentilhomme : acte2
[nenuvar.git] / common / markup.ily
blob6d454433541f261c53be6a74695cdf911ddaf827
1 %%% markup.ily -- generic markup commands
2 %%%
3 %%% Author: Nicolas Sceaux <nicolas.sceaux@free.fr>
4 %%%
5 %%% Markup commands
6 %%% ===============
7 %%%   \vspace <amount>
8 %%%     like \hspace, but for vertical space
9 %%%
10 %%%   \smallCaps <string>
11 %%%     like built-in \smallCaps, but dealing with accented letters
12 %%%
13 %%%   \when-property <symbol> <markup>
14 %%%     if symbol is find in properties, interpret the markup
15 %%%     otherwise, return an empty stencil
16 %%%
17 %%%   \line-width-ratio <ratio> <markup>
18 %%%     interpret markup with a line-width set to current line-width * ratio
19 %%%
20 %%%   \copyright
21 %%%     build a copyight line, using the maintainer and copyrightYear
22 %%%     header variables.
23 %%%
24 %%%   \wordwrap-center <markup-list>
25 %%%     like wordwrap, but center align the lines
26 %%%
27 %%% Markup lines commands
28 %%% =====================
29 %%%   \wordwrap-center-lines <markup-list>
30 %%%     make a markup list composed centered lines of text.
32 %%% Redefinition of \column, \justify and \wordwrap
33 %%% to fix spacing around blocks
34 #(define-markup-command (column layout props args) (markup-list?)
35    #:properties ((baseline-skip))
36    (let ((arg-stencils (interpret-markup-list layout props args)))
37      (stack-lines DOWN 0.0 0
38                   (space-lines baseline-skip
39                                (remove ly:stencil-empty? arg-stencils)))))
41 #(define-markup-command (justify layout props args)
42      (markup-list?)
43    #:properties ((baseline-skip)
44                  wordwrap-internal-markup-list)
45    (stack-lines
46     DOWN 0.0 0
47     (space-lines baseline-skip
48                  (wordwrap-internal-markup-list layout props #t args))))
50 #(define-markup-command (wordwrap layout props args)
51      (markup-list?)
52    #:properties ((baseline-skip)
53                  wordwrap-internal-markup-list)
54   (stack-lines
55    DOWN 0.0 0
56    (space-lines baseline-skip
57                 (wordwrap-internal-markup-list layout props #f args))))
59 %%%
60 %%%
62 #(define-markup-command (vspace layout props amount) (number?)
63   "This produces a invisible object taking vertical space."
64   (let ((amount (* amount 3.0)))
65     (if (> amount 0)
66         (ly:make-stencil "" (cons -1 1) (cons 0 amount))
67         (ly:make-stencil "" (cons -1 1) (cons amount amount)))))
69 #(define-markup-command (copyright layout props) ()
70   (let* ((maintainer (chain-assoc-get 'header:maintainer props))
71          (this-year (+ 1900 (tm:year (gmtime (current-time)))))
72          (year (string->number (or (chain-assoc-get 'header:copyrightYear props)
73                                    (number->string this-year)))))
74     (interpret-markup layout props
75      (markup "Copyright ©" 
76              (if (= year this-year)
77                  (format #f "~a" this-year)
78                  (format #f "~a-~a" year this-year))
79              maintainer))))
81 #(define-markup-command (today layout props) ()
82   (let ((today (gmtime (current-time))))
83    (interpret-markup layout props
84      (format #f "~a-~a-~a"
85              (+ 1900 (tm:year today))
86              (1+ (tm:mon today))
87              (tm:mday today)))))
89 #(define-markup-command (today-french layout props) ()
90    (let* ((date (gmtime (current-time)))
91           (months '#("janvier" "février" "mars" "avril"
92                                "mai" "juin" "juillet" "août"
93                                "septembre" "octobre" "novembre"
94                                "décembre"))
95           (day (if (= (tm:mday date) 1)
96                    (markup (#:concat ("1" #:super "er")))
97                    (number->string (tm:mday date))))
98           (month (vector-ref months (tm:mon date)))
99           (year (number->string (+ 1900 (tm:year date)))))
100      (interpret-markup
101       layout props (markup day month year))))
103 #(define-markup-command (when-property layout props symbol markp) (symbol? markup?)
104   (if (chain-assoc-get symbol props)
105       (interpret-markup layout props markp)
106       (ly:make-stencil '()  '(1 . -1) '(1 . -1))))
108 #(define-markup-command (apply-fromproperty layout props fn symbol)
109   (procedure? symbol?)
110   (let ((m (chain-assoc-get symbol props)))
111     (if (markup? m)
112         (interpret-markup layout props (fn m))
113         empty-stencil)))
115 #(define-markup-command (line-width-ratio layout props width-ratio arg)
116   (number? markup?)
117   (interpret-markup layout props
118    (markup #:override (cons 'line-width (* width-ratio
119                                            (chain-assoc-get 'line-width props)))
120            arg)))
122 #(define-markup-list-command (line-width-ratio-lines layout props width-ratio args)
123   (number? markup-list?)
124   (interpret-markup-list layout props
125     (make-override-lines-markup-list
126       (cons 'line-width (* width-ratio
127                            (chain-assoc-get 'line-width props)))
128       args)))
130 #(define-markup-list-command (with-line-width-ratio layout props width-ratio args)
131   (number? markup-list?)
132   (let* ((line-width (chain-assoc-get 'line-width props))
133          (new-line-width (* width-ratio line-width))
134          (indent (* 0.5 (- line-width new-line-width)))
135          (stencils (interpret-markup-list layout
136                      (cons `((line-width . ,new-line-width)) props)
137                      args)))
138     (interpret-markup-list layout props
139       (map (lambda (stencil)
140              (markup #:hspace indent #:stencil stencil))
141            stencils))))
143 #(define-markup-command (force-line-width-ratio layout props ratio arg)
144      (number? markup?)
145    (let* ((new-line-width (* ratio (chain-assoc-get 'line-width props)))
146           (line-stencil (interpret-markup layout props
147                                   (markup #:override (cons 'line-width new-line-width)
148                                           arg)))
149           (gap (max 0
150                     (- new-line-width
151                        (interval-length (ly:stencil-extent line-stencil X))))))
152      (interpret-markup layout props (markup #:concat (#:stencil line-stencil #:hspace gap)))))
154 #(define-markup-list-command (two-column-lines layout props col1 col2)
155    (markup-list? markup-list?)
156    (interpret-markup-list layout props
157                           (make-column-lines-markup-list
158                            (let ((result '()))
159                              (let map-on-lists ((col1 col1)
160                                                 (col2 col2))
161                                (if (and (null? col1) (null? col2))
162                                    (reverse! result)
163                                    (let ((line-col1 (if (null? col1) "" (car col1)))
164                                          (line-col2 (if (null? col2) "" (car col2)))
165                                          (rest-col1 (if (null? col1) '() (cdr col1)))
166                                          (rest-col2 (if (null? col2) '() (cdr col2))))
167                                      (set! result (cons
168                                                    (markup #:fill-line
169                                                            (#:null
170                                                             #:force-line-width-ratio 0.45 line-col1
171                                                             #:null
172                                                             #:force-line-width-ratio 0.45 line-col2
173                                                             #:null))
174                                                    result))
175                                      (map-on-lists rest-col1 rest-col2))))))))
177 #(define-markup-command (tacet-lyrics layout props score text)
178      (markup? markup-list?)
179    #:properties ((column-number 2))
180    (interpret-markup
181     layout props
182     #{\markup\column {
183         \fontsize #-2 \override #`(column-number . ,column-number)
184         \column\page-columns {
185           \fontsize #2 \line { \hspace #10 Tacet $score }
186           \null
187           $text
188         }
189       } #}))
191 #(define-markup-command (tacet layout props num) (number?)
192    (let ((score (ly:make-score (make-music
193                                 'MultiMeasureRestMusic
194                                 'duration (ly:make-duration 0 0 num)))))
195      (ly:score-add-output-def! score #{ \layout {
196   indent = 0
197   ragged-right = ##t
198   \context { \Score skipBars = ##t }
199   \context {
200     \Staff
201     \remove "Time_signature_engraver"
202     \remove "Clef_engraver"
203     \remove "Staff_symbol_engraver"
204     \override MultiMeasureRest #'expand-limit = #2
205   }
206 } #})
207      (interpret-markup
208       layout props
209 #{ \markup\fontsize #2 { \hspace #10 Tacet $(make-score-markup score) } #})))
211 #(define-markup-command (lyrics layout props text)
212      (markup-list?)
213    #:properties ((column-number 2))
214    (interpret-markup
215     layout props
216     #{\markup\column {
217         \fontsize #-2 \override #`(column-number . ,column-number)
218         \column\page-columns { $text } } #}))
220 #(define-markup-list-command (indented-lines layout props indent args)
221   (number? markup-list?)
222   (let* ((new-line-width (- (chain-assoc-get 'line-width props) indent))
223          (lines (interpret-markup-list layout
224                  (cons `((line-width . ,new-line-width)) props)
225                  args)))
226    (interpret-markup-list layout props
227     (map (lambda (line)
228           (markup #:hspace indent #:stencil line))
229      lines))))
231 #(define-markup-list-command (wordwrap-center-lines layout props args)
232   (markup-list?)
233   (map (lambda (stencil)
234         (interpret-markup layout props (markup #:fill-line (#:stencil stencil))))
235    (interpret-markup-list layout props (make-wordwrap-lines-markup-list args))))
237 #(define-markup-list-command (centered-lines layout props args)
238   (markup-list?)
239   (let ((baseline-skip (chain-assoc-get 'baseline-skip props)))
240     (space-lines baseline-skip
241       (interpret-markup-list layout props
242         (map (lambda (arg) (markup #:fill-line (arg)))
243              args)))))
245 #(define-markup-list-command (fontsize-lines layout props increment args)
246    (number? markup-list?)
247    #:properties ((font-size 0)
248                  (word-space 1)
249                  (baseline-skip 2))
250    (interpret-markup-list layout
251                           (cons `((baseline-skip . ,(* baseline-skip (magstep increment)))
252                                   (word-space . ,(* word-space (magstep increment)))
253                                   (font-size . ,(+ font-size increment)))
254                                 props)
255                           args))
257 #(define-markup-list-command (abs-fontsize-lines layout props size args)
258   (number? markup-list?)
259   (let* ((ref-size (ly:output-def-lookup layout 'text-font-size 12))
260          (text-props (list (ly:output-def-lookup layout 'text-font-defaults)))
261          (ref-word-space (chain-assoc-get 'word-space text-props 0.6))
262          (ref-baseline (chain-assoc-get 'baseline-skip text-props 3))
263          (magnification (/ size ref-size)))
264     (interpret-markup-list layout
265                            (cons `((baseline-skip . ,(* magnification ref-baseline))
266                                    (word-space . ,(* magnification ref-word-space))
267                                    (font-size . ,(magnification->font-size magnification)))
268                                  props)
269                            args)))
271 #(define-markup-command (wordwrap-center layout props args) (markup-list?)
272   (interpret-markup layout props
273    (make-column-markup
274     (make-wordwrap-center-lines-markup-list args))))
276 #(define (page-ref-aux layout props label gauge next)
277   (let* ((gauge-stencil
278           (interpret-markup layout props
279                             (make-concat-markup (list gauge next))))
280          (x-ext (ly:stencil-extent gauge-stencil X))
281          (y-ext (ly:stencil-extent gauge-stencil Y)))
282     (ly:make-stencil
283      `(delay-stencil-evaluation
284        ,(delay (ly:stencil-expr
285                 (let* ((table (ly:output-def-lookup layout 'label-page-table))
286                        (label-page (and (list? table) (assoc label table)))
287                        (page-number (and label-page (cdr label-page)))
288                        (page-markup (if page-number
289                                         (markup #:page-link page-number
290                                             #:concat ((format "~a" page-number)
291                                                       next))
292                                         (markup #:concat ("?" next))))
293                        (page-stencil (interpret-markup layout props page-markup))
294                        (gap (- (interval-length x-ext)
295                                (interval-length (ly:stencil-extent page-stencil X)))))
296                   (interpret-markup layout props
297                                     (markup #:concat (page-markup #:hspace gap)))))))
298      x-ext
299      y-ext)))
301 #(define-markup-command (page-refI layout props label next)
302   (symbol? markup?)
303   (page-ref-aux layout props label "0" next))
305 #(define-markup-command (page-refII layout props label next)
306   (symbol? markup?)
307   (page-ref-aux layout props label "00" next))
309 #(define-markup-command (page-refIII layout props label next)
310   (symbol? markup?)
311   (page-ref-aux layout props label "000" next))
313 #(define-markup-command (super layout props arg) (markup?)
314   (ly:stencil-translate-axis
315    (interpret-markup
316     layout
317     (cons `((font-size . ,(- (chain-assoc-get 'font-size props 0) 3))) props)
318     arg)
319    (* 0.25 (chain-assoc-get 'baseline-skip props))
320    Y))
322 #(define-markup-list-command (paragraph layout props text) (markup-list?)
323   (let ((indentation (markup #:pad-to-box (cons 0 3) (cons 0 0) #:null)))
324     (interpret-markup-list layout props
325        (make-justified-lines-markup-list (cons indentation text)))))
327 #(define-markup-list-command (columns paper props text) (markup-list?)
328   (interpret-markup-list paper props
329     (make-column-lines-markup-list text)))
331 #(define-markup-command (separation-line layout props width) (number?)
332   (interpret-markup layout props
333    (markup #:fill-line (#:draw-line (cons (/ (* 20 width) (*staff-size*)) 0)))))
335 #(define-markup-command (sep layout props) ()
336    (interpret-markup layout props
337                      (markup #:pad-around 1 #:fill-line (#:draw-line '(50 . 0)))))
339 #(define-markup-command (boxed-justify layout props text) (markup-list?)
340   (interpret-markup layout props
341    (make-override-markup '(box-padding . 1)
342     (make-box-markup
343      (make-column-markup
344       (make-justified-lines-markup-list text))))))
346 #(define-markup-command (after-system layout props arg) (markup?)
347    (let ((stencil (interpret-markup layout props arg)))
348      (ly:make-stencil (ly:stencil-expr (ly:stencil-aligned-to stencil Y DOWN))
349                       (ly:stencil-extent stencil X)
350                       '(1 . -1))))
352 %%% Guile does not deal with accented letters
353 #(use-modules (ice-9 regex))
354 %%;; actually defined below, in a closure
355 #(define-public string-upper-case #f)
356 #(define accented-char-upper-case? #f)
357 #(define accented-char-lower-case? #f)
359 %%;; an accented character is seen as two characters by guile
360 #(let ((lower-case-accented-string "éèêëáàâäíìîïóòôöúùûüçœæ")
361        (upper-case-accented-string "ÉÈÊËÁÀÂÄÍÌÎÏÓÒÔÖÚÙÛÜÇŒÆ"))
362    (define (group-by-2 chars result)
363       (if (or (null? chars) (null? (cdr chars)))
364           (reverse! result)
365           (group-by-2 (cddr chars)
366                       (cons (string (car chars) (cadr chars))
367                             result))))
368    (let ((lower-case-accented-chars
369           (group-by-2 (string->list lower-case-accented-string) (list)))
370          (upper-case-accented-chars
371           (group-by-2 (string->list upper-case-accented-string) (list))))
372      (set! string-upper-case
373            (lambda (str)
374              (define (replace-chars str froms tos)
375                (if (null? froms)
376                    str
377                    (replace-chars (regexp-substitute/global #f (car froms) str
378                                                             'pre (car tos) 'post)
379                                   (cdr froms)
380                                   (cdr tos))))
381              (string-upcase (replace-chars str
382                                            lower-case-accented-chars
383                                            upper-case-accented-chars))))
384      (set! accented-char-upper-case?
385            (lambda (char1 char2)
386              (member (string char1 char2) upper-case-accented-chars string=?)))
387      (set! accented-char-lower-case?
388            (lambda (char1 char2)
389              (member (string char1 char2) lower-case-accented-chars string=?)))))
391 #(define-markup-command (smallCaps layout props text) (markup?)
392   "Turn @code{text}, which should be a string, to small caps.
393 @example
394 \\markup \\small-caps \"Text between double quotes\"
395 @end example"
396   (define (string-list->markup strings lower)
397     (let ((final-string (string-upper-case
398                          (apply string-append (reverse strings)))))
399       (if lower
400           (markup #:fontsize -2 final-string)
401           final-string)))
402   (define (make-small-caps rest-chars currents current-is-lower prev-result)
403     (if (null? rest-chars)
404         (make-concat-markup (reverse! (cons (string-list->markup
405                                               currents current-is-lower)
406                                             prev-result)))
407         (let* ((ch1 (car rest-chars))
408                (ch2 (and (not (null? (cdr rest-chars))) (cadr rest-chars)))
409                (this-char-string (string ch1))
410                (is-lower (char-lower-case? ch1))
411                (next-rest-chars (cdr rest-chars)))
412           (cond ((and ch2 (accented-char-lower-case? ch1 ch2))
413                  (set! this-char-string (string ch1 ch2))
414                  (set! is-lower #t)
415                  (set! next-rest-chars (cddr rest-chars)))
416                 ((and ch2 (accented-char-upper-case? ch1 ch2))
417                  (set! this-char-string (string ch1 ch2))
418                  (set! is-lower #f)
419                  (set! next-rest-chars (cddr rest-chars))))
420           (if (or (and current-is-lower is-lower)
421                   (and (not current-is-lower) (not is-lower)))
422               (make-small-caps next-rest-chars
423                                (cons this-char-string currents)
424                                is-lower
425                                prev-result)
426               (make-small-caps next-rest-chars
427                                (list this-char-string)
428                                is-lower
429                                (if (null? currents)
430                                    prev-result
431                                    (cons (string-list->markup
432                                             currents current-is-lower)
433                                          prev-result)))))))
434   (interpret-markup layout props
435     (if (string? text)
436         (make-small-caps (string->list text) (list) #f (list))
437         text)))
439 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
440 %%% Character lists, inline quoted scores, etc.
442 startQuote =
443 #(define-music-function (parser location bar-num) (number?)
444    #{ \override Score.BarNumber #'break-visibility = #'#(#f #f #t)
445       \bar ""
446       \set Score.currentBarNumber = #bar-num #})
448 tinyQuote = {
449   \override Score.StaffSymbol #'staff-space = #(magstep -2)
450   \set Score . fontSize = #-2
453 quoteLayout = \layout {
454   indent = 0
455   ragged-right = ##t
456   \context { \Staff \remove "Time_signature_engraver" }
457   \context { \Voice \override Script #'avoid-slur = #'outside }
458   \context { \Score \override BarNumber.break-visibility = #'#(#f #f #t) }
461 tinyLayout = \layout {
462   \context {
463     \Score
464     \override StaffSymbol #'staff-space = #(magstep -2)
465     fontSize = #-2
466   }
467   \context { \FiguredBass \override BassFigure.font-size = #-2 }
470 tinyQuoteLayout = \layout {
471   \quoteLayout
472   \context {
473     \Score
474     \override StaffSymbol #'staff-space = #(magstep -2)
475     fontSize = #-2
476   }
477   \context { \FiguredBass \override BassFigure.font-size = #-2 }
480 quoteEmptyLayout = \layout {
481   indent = 0
482   ragged-right = ##t
483   \context { \Score skipBars = ##t }
484   \context {
485     \Staff
486     \remove "Time_signature_engraver"
487     \remove "Clef_engraver"
488     \remove "Staff_symbol_engraver"
489     \override MultiMeasureRest #'expand-limit = #2
490   }
493 smallLayout = \layout {
494   \context {
495     \Staff fontSize = #-1
496     \override StaffSymbol.staff-space = #(magstep -1)
497   }
498   \context { \Lyrics fontSize = #-1 }
499   \context { \FiguredBass \override BassFigure.font-size = #-1 }
500   \context { \Voice \override Script.avoid-slur = #'outside }
501   \context { \CueVoice \override Script.avoid-slur = #'outside }
502   \context {
503     \Score
504     \override NonMusicalPaperColumn.line-break-permission = #'allow
505     \override NonMusicalPaperColumn.page-break-permission = #'allow
506   }
509 onlyNotesLayout = \layout {
510   indent = 0
511   \context {
512     \Staff
513     \remove "Time_signature_engraver"
514     \remove "Clef_engraver"
515     \remove "Staff_symbol_engraver"
516   }
517   \context { \Score \remove "Bar_number_engraver" }
520 characterLayout = \layout {
521   \quoteLayout
522   line-width = #(if (eqv? #t (ly:get-option 'ancient-style))
523                     (* 10 mm)
524                     (* 18 mm))
525   ragged-right = ##f
526   \context {
527     \Staff
528     \override Clef #'full-size-change = ##t
529     \remove "Bar_engraver"
530   }
531   \context {
532     \Voice
533     \remove "Stem_engraver"
534   }
537 characterAmbitus =
538 #(define-music-function (parser location clef1 clef2 low-note high-note)
539      (string? string? ly:music? ly:music?)
540    (let* ((low-pitch (ly:music-property low-note 'pitch))
541           (high-pitch (ly:music-property high-note 'pitch))
542           (chord (make-music
543                   'EventChord
544                   'elements (list (make-music
545                                    'NoteEvent
546                                    'duration (ly:make-duration 2 0 1 1)
547                                    'pitch low-pitch)
548                                   (make-music
549                                    'NoteEvent
550                                    'duration (ly:make-duration 2 0 1 1)
551                                    'pitch high-pitch)))))
552      (if (eqv? #t (ly:get-option 'ancient-style))
553          #{ \new Staff { \clef $clef1 $chord } #}
554          #{ \new Staff {
555   \clef $clef1 s16
556   \set Staff.forceClef = ##t
557   \clef $clef2 s8. $chord s2
558 } #})))
561 #(define-markup-command (character-ambitus layout props name ambitus)
562      (markup? markup?)
563    #:properties ((character-width-ratio 16/20)
564                  (ambitus-width-ratio 3/20))
565    (stack-lines
566     DOWN 0 0
567     (list empty-stencil
568           (interpret-markup layout props
569                             (markup 
570                              #:force-line-width-ratio ambitus-width-ratio
571                              #:vcenter #:fill-line (#:null #:left-align ambitus)
572                              #:hspace 2
573                              #:force-line-width-ratio character-width-ratio
574                              #:vcenter #:smallCaps name)))))
576 #(define-markup-command (character-two-columns layout props col1 col2)
577      (markup? markup?)
578    #:properties ((word-space 0.6)
579                  (character-width-ratio 10/30)
580                  (ambitus-width-ratio 4/30))
581    (interpret-markup
582     layout props
583     #{ \markup
584        \override #`(character-width-ratio . ,character-width-ratio)
585        \override #`(ambitus-width-ratio . ,ambitus-width-ratio)
586        \fill-line {
587          \null
588          \override #`(word-space . ,word-space) $col1
589          \hspace #3
590          \override #`(word-space . ,word-space) $col2
591          \null
592        } #}))
594 #(define-markup-command (character-three-columns layout props col1 col2 col3)
595      (markup? markup? markup?)
596    #:properties ((word-space 0.6))
597    (interpret-markup
598     layout props
599     (markup (#:concat (#:override `(word-space . ,word-space) col1
600                                   #:hspace 3
601                                   #:override `(word-space . ,word-space) col2
602                                   #:hspace 3
603                                   #:override `(word-space . ,word-space) col3)))))
605 #(define-markup-command (sline layout props args) (markup-list?)
606    (interpret-markup layout props
607                      (make-line-markup (cons (make-hspace-markup 4) args))))
609 %% Verse margins
610 #(define-markup-command (verse layout props syllab-count words)
611      (number? markup-list?)
612    (interpret-markup
613     layout props
614     (if (< syllab-count 12)
615         (make-line-markup (cons (make-hspace-markup (* 1.5 (- 12 syllab-count)))
616                                 words))
617         (make-line-markup words))))
620 %%% Foot notes
621 \paper {
622   footnote-auto-numbering = ##t
623   footnote-numbering-function =
624   #(lambda (num)
625      (markup #:small #:box (number->string (+ 1 num))))
626   footnote-separator-markup = \markup\override #'(span-factor . 1/4) \draw-hline
627   footnote-padding = 2\mm
628   footnote-footer-padding = 1\mm
631 footnoteHere =
632 #(define-music-function (parser this-location offset note)
633      (number-pair? markup?)
634    (let ((foot-mus (make-music
635                     'FootnoteEvent
636                     'X-offset (car offset)
637                     'Y-offset (cdr offset)
638                     'automatically-numbered #t
639                     'text (make-null-markup)
640                     'footnote-text note)))
641      (set! location #f)
642      #{ <>-\tweak footnote-music #foot-mus ^\markup\transparent\box "1" #}))
644 footnoteHereNoSpace =
645 #(define-music-function (parser this-location offset note)
646      (number-pair? markup?)
647    (let ((foot-mus (make-music
648                     'FootnoteEvent
649                     'X-offset (car offset)
650                     'Y-offset (cdr offset)
651                     'automatically-numbered #t
652                     'text (make-null-markup)
653                     'footnote-text note)))
654      (set! location #f)
655      #{ <>-\tweak footnote-music #foot-mus ^\markup\null #}))
659 textSpanner =
660 #(define-music-function (parser this-location text)
661      (markup?)
662    #{
663 \once\override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER
664 \once\override TextSpanner.bound-details.left.text =
665 \markup\whiteout { $text \hspace #1 }
666 \once\override TextSpanner.bound-details.left-broken.text = \markup\transparent t %##f