From: David Kastrup Date: Fri, 22 Nov 2013 12:36:56 +0000 (+0100) Subject: Add regtest for music argument semantics of make-relative macro X-Git-Tag: release/2.19.0-1~114 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7ff630a9ce8254adeaa9417dc4d927408ce47d47;p=lilypond.git Add regtest for music argument semantics of make-relative macro --- diff --git a/input/regression/make-relative-music.ly b/input/regression/make-relative-music.ly new file mode 100644 index 0000000000..58266b2b35 --- /dev/null +++ b/input/regression/make-relative-music.ly @@ -0,0 +1,32 @@ +\version "2.19.0" + +\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 } +>>