]> git.donarmstrong.com Git - lilypond.git/blob - input/test/add-staccato.ly
45d61d4db1e13e9a68ecf55d7bbb6cbadc22a34c
[lilypond.git] / input / test / add-staccato.ly
1 \version "2.9.7"
2 \sourcefilename "add-staccato.ly"
3
4 \header {
5 texidoc= "@cindex Add Stacato
6 Using @code{make-music}, you can add various stuff to notes. In this
7 example staccato dots are added to the notes."
8
9
10 #(define (make-script x)
11    (make-music 'ArticulationEvent
12                'articulation-type x))
13
14 #(define (add-script m x)
15    (if
16      (equal? (ly:music-property m 'name) 'EventChord)
17      (set! (ly:music-property m 'elements)
18            (cons (make-script x)
19                  (ly:music-property m 'elements))))
20    m)
21
22 #(define (add-staccato m)
23    (add-script m "staccato"))
24
25 addStacc =
26 #(define-music-function (parser location music) 
27                                         (ly:music?)
28                 (music-map add-staccato music))    
29
30 \score {
31   \relative c'' {
32     a b \addStacc { c c } 
33   }
34   \layout{ ragged-right = ##t }
35 }
36