X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Fregression%2Fmusic-map.ly;h=ee6e1eeb1c0dee46323aa68c5bb6646f2fc63cae;hb=ff22b3332b1089d38226f15a72040d8cbc202c12;hp=8d5436d5afe727eda3d58a2e50c8c2f333772c2f;hpb=d2e7425b88e579fe53989106965fa13eab551c92;p=lilypond.git diff --git a/input/regression/music-map.ly b/input/regression/music-map.ly index 8d5436d5af..ee6e1eeb1c 100644 --- a/input/regression/music-map.ly +++ b/input/regression/music-map.ly @@ -1,42 +1,34 @@ -#(ly:set-option 'old-relative) \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 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.9.8" +\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: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) -) - - - \paper { raggedright= ##t } - -foobar = \notes \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^ } - -\score { - \notes \relative c'' \context Voice { - \foobar - - << \apply #(lambda (x) (music-map notes-to-skip x)) - \foobar - { d2 d2 } >> -}} + "Convert all stuff with duration (notes, lyrics, bass figures, etc.) to skips. +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-^ } + + +\relative c'' \context Voice { + \foobar + + << \applyMusic #(lambda (x) (music-map notes-to-skip x)) + \foobar + { d8 d d d d d d d } >> +}