X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Fregression%2Fmusic-map.ly;h=661dc03511970f36156483fcb6bccfd1baeadc8b;hb=076b15ac89c6402ac2729d17bb53107d4d1342a2;hp=9e5eb800753c10ed31b3256af849ee6ff5bf25f9;hpb=72972afb27cf99f5ae432f4a1463d4f6de6107a0;p=lilypond.git diff --git a/input/regression/music-map.ly b/input/regression/music-map.ly index 9e5eb80075..661dc03511 100644 --- a/input/regression/music-map.ly +++ b/input/regression/music-map.ly @@ -1,39 +1,41 @@ \header { -texidoc = + texidoc = -"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 applied -to an entire music expression in the 1st measure, the scripts and -dynamics are left over. These are put onto the 2nd measure." + "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 +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 "1.7.16" +\version "2.12.0" #(define (notes-to-skip m) -"Convert all stuff with duration (notes, lyrics, bass figures, etc.) to skips. + "Convert all stuff with duration (notes, lyrics, bass figures, etc.) to skips. Scripts and dynamics are maintained. " - (if (memq 'rhythmic-event (ly:get-mus-property m 'types)) - (let* ((newmus (make-music-by-name 'SkipEvent))) - (map - (lambda (x) (ly:set-mus-property! newmus (car x) (cdr x))) - (ly:get-mutable-properties m)) - newmus - ) - m) + (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) ) -foobar = \notes \transpose c c' { c4-\>-^ c4-^ c4-\!-^ c4-^ } +\layout { ragged-right= ##t } -\score { - \notes \relative c'' \context Voice { - \foobar +foobar = \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^ } - < \apply #(lambda (x) (music-map notes-to-skip x)) - \foobar - { d2 d2 } > -}} + +\relative c'' \context Voice { + \foobar + + << \applyMusic #(lambda (x) (music-map notes-to-skip x)) + \foobar + { d8 d d d d d d d } >> +}