From: David Kastrup Date: Mon, 25 Nov 2013 11:17:03 +0000 (+0100) Subject: Add regtest for copy/modify semantics of make-relative macro X-Git-Tag: release/2.19.0-1~113 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6ff742af060254905c714ae099dc64dc439746e5;p=lilypond.git Add regtest for copy/modify semantics of make-relative macro --- diff --git a/input/regression/make-relative-copies.ly b/input/regression/make-relative-copies.ly new file mode 100644 index 0000000000..93c9fe9c8e --- /dev/null +++ b/input/regression/make-relative-copies.ly @@ -0,0 +1,29 @@ +\header { + texidoc = "@code{make-relative} has to copy its argument expressions +in case the generated music expression is getting copied and modified. + +The code here defines a @code{\\reltranspose} function working inside +of @code{\\relative} and uses it. Both staves should appear +identical." +} + +\layout { + ragged-right = ##t +} + +reltranspose = +#(define-music-function (parser location from to music) + (ly:pitch? ly:pitch? ly:music?) + (make-relative (music) music + #{ \transpose #from #to $music #})) + +mus = +\reltranspose c g { + \partial 4. c8 e g | + c2 r8 c, e g c1 | \bar "|." +} + +<< + \new Staff \relative \mus + \new Staff \relative \mus +>>