From b7a62eaa0af0eb10a95e61bd04960ec7ad07b315 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Fri, 22 Nov 2013 13:36:56 +0100 Subject: [PATCH] Add regtest for music argument semantics of make-relative macro --- input/regression/make-relative-music.ly | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 input/regression/make-relative-music.ly diff --git a/input/regression/make-relative-music.ly b/input/regression/make-relative-music.ly new file mode 100644 index 0000000000..25941d290c --- /dev/null +++ b/input/regression/make-relative-music.ly @@ -0,0 +1,32 @@ +\version "2.17.97" + +\header { + texidoc = "@code{make-relative} can make relativization on music +function calls behave as one would expect from looking at the +function's arguments rather than at the actually resulting +expressions. This regtest defines an example function +@code{\\withOctave} which works equally well inside and outside of +@code{\\relative}." +} + +withOctave = +#(define-music-function (parser location music) + (ly:music?) + (make-relative + (music) music + #{ \context Bottom << $music \transpose c c' $music >> #})) + +mus = { + \partial 4. c'8 e g | + c2 e,4 g | + c,8 c' b a | + 1 | \bar "|." +} + +<< + \relative \new Staff { <>^"original" \mus } + \relative \new Staff { <>^\markup \typewriter "\\relative \\withOctave" + \withOctave \mus } + \new Staff { <>^\markup \typewriter "\\withOctave \\relative" + \withOctave \relative \mus } +>> -- 2.39.2