X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Fregression%2Fmusic-map.ly;h=ee6e1eeb1c0dee46323aa68c5bb6646f2fc63cae;hb=5d84bfad4626892bcffd05adcced53c8a2329047;hp=5006a502b40cbc74d797bada5bbc913cee6305b0;hpb=d02446a61d3eabfde67ed48928ae07766c97750f;p=lilypond.git diff --git a/input/regression/music-map.ly b/input/regression/music-map.ly index 5006a502b4..ee6e1eeb1c 100644 --- a/input/regression/music-map.ly +++ b/input/regression/music-map.ly @@ -4,32 +4,25 @@ "With @code{music-map}, you can apply functions operating on a single piece of music to an entire music expression. In this example, -the the function @code{notes-to-skip} changes a note to a skip. When +the function @code{notes-to-skip} changes a note to a skip. When applied to an entire music expression in the 1st measure, the scripts and dynamics are left over. These are put onto the 2nd measure." } -\version "2.7.32" +\version "2.17.27" #(define (notes-to-skip m) "Convert all stuff with duration (notes, lyrics, bass figures, etc.) to skips. -Scripts and dynamics are maintained. -" - (if (memq 'rhythmic-event (ly:music-property m 'types)) - (let* ((newmus (make-music 'SkipEvent))) - (map - (lambda (x) (ly:music-set-property! newmus (car x) (cdr x))) - (ly:music-mutable-properties m)) - newmus - ) - m) -) +Scripts and dynamics are maintained." + (if (music-is-of-type? m 'rhythmic-event) + (make-music 'SkipEvent m) + m)) \layout { ragged-right= ##t } -foobar = \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^ } +foobar = \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^ } \relative c'' \context Voice { @@ -37,5 +30,5 @@ foobar = \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^ } << \applyMusic #(lambda (x) (music-map notes-to-skip x)) \foobar - { d2 d2 } >> + { d8 d d d d d d d } >> }