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