X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Ftest%2Fadd-staccato.ly;h=0c1cf13f4ed81598c421495ab9171a7331ab0df5;hb=6a83303732cf1c1e93eaaff0f7b7cd5005ed598e;hp=141d908e34b5efdcf968f94e4f2941b5582b9a9d;hpb=5933b7691a6ad0c3f3af5fbb5b3d872a6981012b;p=lilypond.git diff --git a/input/test/add-staccato.ly b/input/test/add-staccato.ly index 141d908e34..0c1cf13f4e 100644 --- a/input/test/add-staccato.ly +++ b/input/test/add-staccato.ly @@ -1,39 +1,35 @@ -\header { -texidoc= "Using make-music, you can add various stuff to notes. Here -is an example how to add staccato dots. Note: for this simple case -one would not use scm constructs. See separate-staccato.ly first." +\version "2.3.17" + +\header { +texidoc= "@cindex Add Stacato +Using @code{make-music}, you can add various stuff to notes. In this +example staccato dots are added to the notes. For this simple case, +it is not necessary to use scm constructs (see @code{separate-staccato.ly}). +" } #(define (make-script x) - (let ((m (ly-make-music "Articulation_req"))) - ;;(ly-set-mus-property! m 'articulation-type 'staccato) - ;; urg - (ly-set-mus-property! m 'articulation-type x) - (ly-set-mus-property! m 'script x) - m)) - + (make-music 'ArticulationEvent + 'articulation-type x)) + #(define (add-script m x) - (if (equal? (ly-music-name m) "Request_chord") - (ly-set-mus-property! m 'elements - (cons (make-script x) - (ly-get-mus-property m 'elements))) - - (let ((es (ly-get-mus-property m 'elements)) - (e (ly-get-mus-property m 'element)) ) - (map (lambda (y) (add-script y x)) es) - (if (music? e) - (add-script e x)))) - m) + (if + (equal? (ly:music-property m 'name) 'EventChord) + (set! (ly:music-property m 'elements) + (cons (make-script x) + (ly:music-property m 'elements)))) + m) #(define (add-staccato m) (add-script m "staccato")) \score { - \notes\relative c'' { - a b \apply #add-staccato { c c } - a b \apply #add-staccato { c c } + \relative c'' { + a b \applymusic #(lambda (x) (music-map add-staccato x)) { c c } } + \paper{ raggedright = ##t } } +