]> git.donarmstrong.com Git - lilypond.git/blob - input/test/cadenza-skip.ly
* scripts/convert-ly.py (conv): remove \notes.
[lilypond.git] / input / test / cadenza-skip.ly
1 \header {
2
3
4     texidoc = "A second staff can be aligned to a fragment (say, a
5     cadenza) from the first staff, using a Scheme function: the
6     function creates a skip of the same length as the cadenza. "
7
8    }
9
10 \version "2.3.4"
11
12 cadenza =  \relative c' {
13     c4 d8 << { e f g } \\ { d4. } >>
14     g4 f2 g4 g
15 }
16
17
18 #(define (skip-of-length mus)
19   "Create a skip of exactle the same length as MUS."
20   (let*
21    ((skip
22      (make-music
23       'SkipEvent
24       'duration (ly:make-duration 0 0))))
25
26    (make-event-chord (list (ly:music-compress skip (ly:music-length mus))))
27 ))
28
29
30 #(define (mmrest-of-length mus)
31   "Create a mmrest of exactly the same length as MUS."
32   
33   (let*
34    ((skip
35      (make-multi-measure-rest
36       (ly:make-duration 0 0) '() )))
37    (ly:music-compress skip (ly:music-length mus))
38    skip
39 ))
40
41
42 \score {
43     
44     \relative c' \new GrandStaff <<
45         \new Staff { \cadenza c4 \bar "|." }
46         \new Staff {
47             #(ly:export (mmrest-of-length cadenza))
48             c4 \bar "|." }
49     >>
50
51     \paper {}
52 }