]> git.donarmstrong.com Git - lilypond.git/blob - input/test/add-staccato.ly
The grand \paper -> \layout, \bookpaper -> \paper renaming.
[lilypond.git] / input / test / add-staccato.ly
1
2 \version "2.3.22"
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    (make-music 'ArticulationEvent
15                'articulation-type x))
16     
17 #(define (add-script m x)
18    (if
19      (equal? (ly:music-property m 'name) 'EventChord)
20      (set! (ly:music-property m 'elements)
21            (cons (make-script x)
22                  (ly:music-property m 'elements))))
23    m)
24
25 #(define (add-staccato m)
26    (add-script m "staccato"))
27
28 \score {
29   \relative c'' {
30     a b \applymusic #(lambda (x) (music-map add-staccato x)) { c c } 
31   }
32   \layout{ raggedright = ##t }
33 }
34
35