]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/make-relative-music.ly
Merge remote-tracking branch 'origin/translation' into staging
[lilypond.git] / input / regression / make-relative-music.ly
1 \version "2.19.0"
2
3 \header {
4   texidoc = "@code{make-relative} can make relativization on music
5 function calls behave as one would expect from looking at the
6 function's arguments rather than at the actually resulting
7 expressions.  This regtest defines an example function
8 @code{\\withOctave} which works equally well inside and outside of
9 @code{\\relative}." 
10 }
11
12 withOctave =
13 #(define-music-function (parser location music)
14   (ly:music?)
15   (make-relative
16    (music) music
17    #{ \context Bottom << $music \transpose c c' $music >> #}))
18
19 mus = {
20   \partial 4. c'8 e g |
21   c2 e,4 g |
22   c,8 c' b a <g d'> <f c'> <e b'> <d a'> |
23   <c g'>1 | \bar "|."
24 }
25
26 <<
27   \relative \new Staff { <>^"original" \mus }
28   \relative \new Staff { <>^\markup \typewriter "\\relative \\withOctave"
29                          \withOctave \mus }
30   \new Staff { <>^\markup \typewriter "\\withOctave \\relative"
31                \withOctave \relative \mus }
32 >>