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.17.97-1~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b4d11bf267d4f66e372f9ba4ea3800161f0182bc;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..0947e72eac --- /dev/null +++ b/input/regression/make-relative-copies.ly @@ -0,0 +1,31 @@ +\version "2.17.97" + +\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 +>>