From 6ff742af060254905c714ae099dc64dc439746e5 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Mon, 25 Nov 2013 12:17:03 +0100 Subject: [PATCH] Add regtest for copy/modify semantics of make-relative macro --- input/regression/make-relative-copies.ly | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 input/regression/make-relative-copies.ly 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 +>> -- 2.39.2