X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Ftest%2Fadd-staccato.ly;h=98c7fea756d0ef9413f77bcd34c7b89faa9fb695;hb=b22e169e712aeeb006fe55f7a4196f739493ad94;hp=caac177d2f224ebfd93f0dcf00e24f65b53080b5;hpb=899a5926b98860f3d5db399616d9211927fbfa3c;p=lilypond.git diff --git a/input/test/add-staccato.ly b/input/test/add-staccato.ly index caac177d2f..98c7fea756 100644 --- a/input/test/add-staccato.ly +++ b/input/test/add-staccato.ly @@ -1,10 +1,12 @@ -\version "1.7.3" %% or actually: 1.7.1 ... +\version "1.7.18" + \header { -texidoc= "Using make-music, you can add various stuff to notes. Here +texidoc= "@cindex Add Stacato +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." - +one would not use scm constructs. See separate-staccato.ly first. +" } #(define (make-script x) @@ -13,16 +15,11 @@ one would not use scm constructs. See separate-staccato.ly first." m)) #(define (add-script m x) - (if (equal? (ly:get-mus-property m 'name) 'RequestChord) - (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 (ly:music? e) - (add-script e x)))) + (if + (equal? (ly:get-mus-property m 'name) 'EventChord) + (ly:set-mus-property! m 'elements + (cons (make-script x) + (ly:get-mus-property m 'elements)))) m) #(define (add-staccato m) @@ -30,8 +27,9 @@ one would not use scm constructs. See separate-staccato.ly first." \score { \notes\relative c'' { - a b \apply #add-staccato { c c } - a b \apply #add-staccato { c c } + a b \apply #(lambda (x) (music-map add-staccato x)) { c c } } + \paper{ raggedright = ##t } } +