]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/make-relative.ly
Fixed errors in Catalan translation
[lilypond.git] / input / regression / make-relative.ly
1 \version "2.17.11"
2 \header {
3
4   texidoc = "@code{make-relative} is a Scheme utility macro mainly
5 useful for creating music functions accepting pitches as arguments.
6 Its purpose is to make music functions taking pitch arguments for
7 producing complex music fragments integrate nicely within a
8 @code{\\relative} section.  This regtest typesets a short music
9 fragment twice, once without using @code{\\relative}, once using it.
10 The fragment should appear identical in both cases."
11
12 }
13
14 \layout { ragged-right= ##t }
15
16 ph =
17 #(define-music-function (parser location p1 p2 p3 p4 p5)
18   (ly:pitch? ly:pitch? ly:pitch? ly:pitch? ly:pitch?)
19   (make-relative (p1 p2 p3 p4 p5) p1
20    #{
21      \repeat unfold 2 { $p1 2 } |
22      \repeat unfold 2 { r16 $p2 8. ~ $p2 4 } |
23      \repeat unfold 2 { r8 $p3 16 $p4 $p5 $p3 $p4 $p5 } |
24    #}))
25
26 \parallelMusic #'(low middle high)
27 {
28   \ph c' e' g' c'' e''
29   R1*7 | \skip 1*7 | \oneVoice R1*7 \voiceOne |
30   \ph a c' e' g' c''
31   \voiceTwo | \change Staff = "down" \voiceOne | \oneVoice |
32   \ph d a d' fis' c''
33   \oneVoice R1*21 \voiceTwo | \skip 1*21 | R1*21 |
34   \ph c, c g bes e'
35   c,2~ c, | r16 c8. ~ c4 ~ c2
36   | r8 f16 a c' f' c' a c' a f a f d f d |
37   c,2~ c, | r16 b,8. ~ b,4 ~ b,2
38   | r8 g'16 b' d'' f'' d'' b' d'' b' g' b' d' f' e' d' |
39   c,1\fermata | c1 | <e' g' c''>1\fermata \bar "|." |
40 }
41
42 \score {
43   \new PianoStaff <<
44     \compressFullBarRests
45     \new Staff = "up" {
46       << \high \\ \middle >>
47     }
48     \new Staff = "down" {
49       \clef bass
50       \low
51     }
52   >>
53 }
54
55 \parallelMusic #'(low middle high)
56 \relative c' {
57   \ph c e g c e
58   R1*7 | \skip 1*7 | \oneVoice R1*7 \voiceOne |
59   \ph a c e g c
60   \voiceTwo | \change Staff = "down" \voiceOne | \oneVoice |
61   \ph d, a' d fis c'
62   \oneVoice R1*21 \voiceTwo | \skip 1*21 | R1*21 |
63   \ph c, c' g' bes e
64   c2~ c | r16 c'8. ~ c4 ~ c2
65   | r8 f16 a c f c' a c a f a f d f d |
66   c,,2~ c | r16 b'8. ~ b4 ~ b2
67   | r8 g'16 b d f d b d b g b d f e d |
68   c,,1\fermata | c'1 | <e' g c>1\fermata \bar "|." |
69 }
70
71 \score {
72   \new PianoStaff <<
73     \compressFullBarRests
74     \new Staff = "up" {
75       << \high \\ \middle >>
76     }
77     \new Staff = "down" {
78       \clef bass
79       \low
80     }
81   >>
82 }