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