]> git.donarmstrong.com Git - lilypond.git/blob - input/test/add-staccato.ly
* scripts/convert-ly.py (FatalConversionError.figures_replace):
[lilypond.git] / input / test / add-staccato.ly
1
2 \version "1.9.4"
3
4 \header {
5
6 texidoc= "@cindex Add Stacato
7 Using make-music, you can add various stuff to notes. Here
8 is an example how to add staccato dots.  Note: for this simple case
9 one would not use scm constructs.  See separate-staccato.ly first.
10 "
11
12
13 #(define (make-script x)
14    (let ((m (make-music-by-name 'ArticulationEvent)))
15      (ly:set-mus-property! m 'articulation-type x)
16      m))
17     
18 #(define (add-script m x)
19    (if
20     (equal? (ly:get-mus-property m 'name) 'EventChord)
21     (ly:set-mus-property! m 'elements
22                           (cons (make-script x)
23                                 (ly:get-mus-property m 'elements))))
24    m)
25
26 #(define (add-staccato m)
27    (add-script m "staccato"))
28
29 \score {
30   \notes\relative c'' {
31     a b \apply #(lambda (x) (music-map add-staccato x)) { c c } 
32   }
33   \paper{ raggedright = ##t }
34 }
35
36