lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

relative music inside music functions explodes when used twice


From: Janek Warchoł
Subject: relative music inside music functions explodes when used twice
Date: Sat, 11 Oct 2014 20:03:19 +0200

Hi,

i have a function that takes music as an argument and uses it twice - each time with a different tag appended, so that later on i can decide what to output:

voiceDivisi =
#(define-music-function (parser location m1 m2) (ly:music? ly:music?)
   #{
     \tag divI \context Voice = "divI" { #m1 }
     \tag divII \context Voice = "divII" { #m2 }
     \tag together \context Voice = "both" << #m1 #m2 >>
   #})

The problem is that when used with relative mode, the output gets crazy:

music = \relative c' {
  \voiceDivisi {
    c4 d e f
  }
  {
    e4 f g a
  }
}

\new Staff \keepWithTag divI \music
\new Staff \keepWithTag divII \music
\new Staff \keepWithTag together \music

(see attachment)

I have checked that the problem disappears when the function uses the arguments (m1 and m2) only once.  Is this a bug?  Can i work around it, or maybe i should be doing this in an altogether different way?

best,
Janek

Attachment: exploding octaves.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]