X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Ftest%2Fadd-staccato.ly;h=aee898561d4f13f077d34f87337b390384aae8a8;hb=0c289671d105bea58592607cb508aef59aee882b;hp=9b65422ea3f3040f6c098426587373baea214813;hpb=7a0f6ed20a117b8e74183f515d229804ea415400;p=lilypond.git diff --git a/input/test/add-staccato.ly b/input/test/add-staccato.ly index 9b65422ea3..aee898561d 100644 --- a/input/test/add-staccato.ly +++ b/input/test/add-staccato.ly @@ -1,35 +1,36 @@ -\version "1.7.18 +\version "2.10.0" +\sourcefilename "add-staccato.ly" \header { - 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. -" +Using @code{make-music}, you can add various stuff to notes. In this +example staccato dots are added to the notes." } #(define (make-script x) - (let ((m (make-music-by-name 'ArticulationEvent))) - (ly:set-mus-property! m 'articulation-type x) - m)) - + (make-music 'ArticulationEvent + 'articulation-type x)) + #(define (add-script m 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)))) + (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")) +addStacc = +#(define-music-function (parser location music) + (ly:music?) + (music-map add-staccato music)) + \score { - \notes\relative c'' { - a b \apply #(lambda (x) (music-map add-staccato x)) { c c } + \relative c'' { + a b \addStacc { c c } } - \paper{ raggedright = ##t } + \layout{ ragged-right = ##t } } -