2 \sourcefilename "add-text-script.ly"
5 texidoc= "@cindex make-music Fingering
6 You can add various stuff to notes using @code{make-music}.
7 In this example, an extra fingering is attached to a note.
11 #(define (make-text-script x)
12 (make-music 'TextScriptEvent
14 'text (make-simple-markup x)))
16 #(define (add-text-script m x)
17 (if (equal? (ly:music-property m 'name) 'EventChord)
18 (set! (ly:music-property m 'elements)
19 (cons (make-text-script x)
20 (ly:music-property m 'elements)))
21 (let ((es (ly:music-property m 'elements))
22 (e (ly:music-property m 'element)))
23 (map (lambda (y) (add-text-script y x)) es)
25 (add-text-script e x))))
29 #(define-music-function (parser location script music )
31 (add-text-script music script))
35 \addScript "6" { c'4-3 }