]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/music-map.ly
Merge branch 'translation' into staging
[lilypond.git] / input / regression / music-map.ly
1 \header {
2
3   texidoc =
4
5   "With @code{music-map}, you can apply functions operating on a
6 single piece of music to an entire music expression. In this example,
7 the function @code{notes-to-skip} changes a note to a skip. When
8 applied to an entire music expression in the 1st measure, the scripts
9 and dynamics are left over. These are put onto the 2nd measure."
10
11 }
12
13 \version "2.17.27"
14
15 #(define (notes-to-skip m)
16   "Convert all stuff with duration (notes, lyrics, bass figures, etc.) to skips.
17 Scripts and dynamics are maintained."
18   (if (music-is-of-type? m 'rhythmic-event)
19       (make-music 'SkipEvent m)
20       m))
21
22
23 \layout { ragged-right= ##t }
24
25 foobar =  \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^  }
26
27
28 \relative c''  \context Voice {
29   \foobar
30
31   << \applyMusic #(lambda (x) (music-map notes-to-skip x))
32      \foobar
33      { d8 d d d d d d d  } >>
34 }