]> git.donarmstrong.com Git - lilypond.git/blob - input/test/add-staccato.ly
patch::: 1.5.14.jcn4
[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.  Note: for this simple case
5 one would not use scm constructs.  See separate-staccato.ly first."
6
7
8
9 #(define (make-script x)
10   (let ((m (ly-make-music "Articulation_req")))
11      ;;(ly-set-mus-property m 'articulation-type 'staccato)
12      ;; urg
13      (ly-set-mus-property m 'articulation-type x)
14      (ly-set-mus-property m 'script x)
15      m))
16      
17 #(define (add-script m x)
18   (if (equal? (ly-music-name m) "Request_chord")
19       (ly-set-mus-property m 'elements
20                            (cons (make-script x)
21                                  (ly-get-mus-property m 'elements)))
22       
23       (let ((es (ly-get-mus-property m 'elements))
24             (e (ly-get-mus-property m 'element)) )
25         (map (lambda (y) (add-script y x)) es)
26         (if (music? e)
27             (add-script e x))))
28   m)
29
30 #(define (add-staccato m)
31    (add-script m "staccato"))
32
33 \score {
34   \notes\relative c'' {
35     a b \apply #add-staccato { c c } 
36     a b \apply #add-staccato { c c } 
37   }
38 }
39