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.17.97-1~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b7a62eaa0af0eb10a95e61bd04960ec7ad07b315;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..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 } +>>