]> git.donarmstrong.com Git - lilypond.git/blob - input/test/add-staccato.ly
Very minor comments to aid future reorganization.
[lilypond.git] / input / test / add-staccato.ly
1 \version "1.7.18"  %% or actually: 1.7.1 ...
2 % TODO: doesn't work with 1.7.19.  Check with more recent version.
3 \header {
4
5 texidoc= "Using make-music, you can add various stuff to notes. Here
6 is an example how to add staccato dots.  Note: for this simple case
7 one would not use scm constructs.  See separate-staccato.ly first."
8
9
10
11 #(define (make-script x)
12    (let ((m (make-music-by-name 'ArticulationEvent)))
13      (ly:set-mus-property! m 'articulation-type x)
14      m))
15     
16 #(define (add-script m x)
17    (if (equal? (ly:get-mus-property m 'name) 'RequestChord)
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 (ly: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
39 %% new-chords-done %%