]> git.donarmstrong.com Git - lilypond.git/blob - input/test/add-staccato.ly
* input/test/[a-b]*.ly: refresh descriptions -- avoid referring
[lilypond.git] / input / test / add-staccato.ly
1
2 \version "2.1.26"
3
4 \header {
5
6 texidoc= "@cindex Add Stacato
7 Using @code{make-music}, you can add various stuff to notes. In this
8 example staccato dots are added to the notes.  For this simple case,
9 it is not necessary to use scm constructs (see @code{separate-staccato.ly}).
10 "
11
12
13 #(define (make-script x)
14    (let ((m (make-music-by-name 'ArticulationEvent)))
15      (ly:music-set-property! m 'articulation-type x)
16      m))
17     
18 #(define (add-script m x)
19    (if
20     (equal? (ly:music-property m 'name) 'EventChord)
21     (ly:music-set-property! m 'elements
22                           (cons (make-script x)
23                                 (ly:music-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