]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/make-relative-copies.ly
Merge branch 'translation' into 'master'
[lilypond.git] / input / regression / make-relative-copies.ly
1 \header {
2   texidoc = "@code{make-relative} has to copy its argument expressions
3 in case the generated music expression is getting copied and modified.
4
5 The code here defines a @code{\\reltranspose} function working inside
6 of @code{\\relative} and uses it.  Both staves should appear
7 identical."
8 }
9
10 \layout {
11   ragged-right = ##t
12 }
13
14 reltranspose =
15 #(define-music-function (parser location from to music)
16   (ly:pitch? ly:pitch? ly:music?)
17   (make-relative (music) music
18    #{ \transpose #from #to $music #}))
19
20 mus =
21 \reltranspose c g {
22   \partial 4. c8 e g |
23   c2 r8 c, e g c1 | \bar "|."
24 }
25
26 <<
27   \new Staff \relative \mus
28   \new Staff \relative \mus
29 >>