]> git.donarmstrong.com Git - lilypond.git/blob - input/test/add-staccato.ly
*** empty log message ***
[lilypond.git] / input / test / add-staccato.ly
1 \version "1.7.18
2
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
19     (equal? (ly:get-mus-property m 'name) 'EventChord)
20     (ly:set-mus-property! m 'elements
21                           (cons (make-script x)
22                                 (ly:get-mus-property m 'elements))))
23    m)
24
25 #(define (add-staccato m)
26    (add-script m "staccato"))
27
28 \score {
29   \notes\relative c'' {
30     a b \apply #(lambda (x) (music-map add-staccato x)) { c c } 
31   }
32   \paper{ raggedright = ##t }
33 }
34
35