]> git.donarmstrong.com Git - lilypond.git/blob - input/test/add-text-script.ly
release: 1.3.146
[lilypond.git] / input / test / add-text-script.ly
1 \version "1.3.146"
2 \header {
3 texidoc= "Using make-music, you can add
4 various stuff to notes. Here is an example
5 how to add an extra fingering. 
6
7 In general, first do a display of the music you want ot
8 create, then write a function that will build the structure for you."
9
10
11 #(define (make-script x) 
12      (let* (  (m (ly-make-music "Text_script_req"))
13      )
14      
15      (ly-set-mus-property m 'text-type 'finger)
16      (ly-set-mus-property m 'text x)
17      m
18      ))
19      
20 #(define (add-script m x)
21   (if (equal? (ly-music-name m) "Request_chord")
22     (ly-set-mus-property m 'elements
23       (cons (make-script x) (ly-get-mus-property m 'elements)))
24
25     (let* ( (es (ly-get-mus-property m 'elements))
26             (e (ly-get-mus-property m 'element)) )
27      (map (lambda (y) (add-script y x)) es)
28      (if (music? e)
29        (add-script e x))
30     )
31   )
32   m
33 )
34
35 \score {  \apply #(lambda (x) (add-script x "6") (display x) x ) \notes { c4-3 } }
36