1 #(ly:set-option 'old-relative)
6 "With @code{music-map}, you can apply functions operating on a single
7 piece of music to an entire music expression. In this example, the the
8 function @code{notes-to-skip} changes a note to a skip. When applied
9 to an entire music expression in the 1st measure, the scripts and
10 dynamics are left over. These are put onto the 2nd measure."
16 #(define (notes-to-skip m)
17 "Convert all stuff with duration (notes, lyrics, bass figures, etc.) to skips.
18 Scripts and dynamics are maintained.
20 (if (memq 'rhythmic-event (ly:get-mus-property m 'types))
21 (let* ((newmus (make-music-by-name 'SkipEvent)))
23 (lambda (x) (ly:set-mus-property! newmus (car x) (cdr x)))
24 (ly:get-mutable-properties m))
31 \paper { raggedright= ##t }
33 foobar = \notes \transpose c c' { c4-\>-^ c4-^ c4-\!-^ c4-^ }
36 \notes \relative c'' \context Voice {
39 < \apply #(lambda (x) (music-map notes-to-skip x))