]> git.donarmstrong.com Git - lilypond.git/blob - input/test/add-staccato.ly
patch::: 1.5.14.jcn3
[lilypond.git] / input / test / add-staccato.ly
1 \header {
2
3 texidoc= "Using make-music, you can add various stuff to notes. Here
4 is an example how to add staccato dots."
5
6
7
8 #(define (make-script x)
9   (let ((m (ly-make-music "Articulation_req")))
10      ;;(ly-set-mus-property m 'articulation-type 'staccato)
11      ;; urg
12      (ly-set-mus-property m 'articulation-type x)
13      (ly-set-mus-property m 'script x)
14      m))
15      
16 #(define (add-script m x)
17   (if (equal? (ly-music-name m) "Request_chord")
18       (ly-set-mus-property m 'elements
19                            (cons (make-script x)
20                                  (ly-get-mus-property m 'elements)))
21       
22       (let ((es (ly-get-mus-property m 'elements))
23             (e (ly-get-mus-property m 'element)) )
24         (map (lambda (y) (add-script y x)) es)
25         (if (music? e)
26             (add-script e x))))
27   m)
28
29 #(define (add-staccato m)
30    (add-script m "staccato"))
31
32 \score {
33   \notes\relative c'' {
34     a b \apply #add-staccato { c c } 
35     a b \apply #add-staccato { c c } 
36   }
37 }
38