lilypond-devel
[Top][All Lists]
Advanced

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

Re: unexpected \unfoldRepeats behavior


From: Paul Scott
Subject: Re: unexpected \unfoldRepeats behavior
Date: Sat, 06 Jun 2009 16:53:30 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20081204 Iceape/1.1.14 (Debian-1.1.14-1)

Jay Anderson wrote:
On Sat, Jun 6, 2009 at 3:22 AM, Mark Polesky<address@hidden> wrote:
I tried to answer a question on -user but hit a brick wall.
\unfoldRepeats failed to work when the music block was funneled from 2
separate expressions. Can someone explain this to me? Why does the
following code work for voiceA but not for voiceB?

Thanks.
- Mark

_____________________________________


\version "2.13.1"

voiceA = \new Voice = "A" \relative {
 \time 1/4
 \repeat volta 2 { a' }
 \alternative { { b } { c } }
}


% voiceB is built from 2 separate expressions funneled into one voice,
% but otherwise ought to be identical to voiceA, it seems:
voiceBrepeats = {
 \time 1/4
 \repeat volta 2 { s }
 \alternative { { s } { s } }
}
voiceBnotes = \relative { \time 1/4 a' b c }
voiceB = \new Voice = "B" { << \voiceBrepeats \voiceBnotes >> }


% using \unfoldRepeats produces the expected MIDI output with voiceA,
% but not with voiceB. Why?
\score {
 \unfoldRepeats \voiceA % change to \voiceB to test.
 \midi { }
}

This is the expected behavior. Only the spacers will be unfolded in
voiceB. The repeat needs to be around the actual notes. Use
\displayMusic and you'll see why.

If you really do want this to work you're going to need some sort of
flatten function: '\flatten << \voiceBrepeats \voiceBnotes >>' which
would recursively combine the contents of nested parallel sections
into one SequentialMusic section. This would be tricky. It's easiest
to just put the repeats in all voices.

Which is kind of ridiculous if you're writing an ensemble piece with many (even more than one) voices/parts. How can a midi of a multi-voice work with any repeats be done? I don't mind having a separate file for the midi output but not being able to factor out the common timing and dynamics costs a lot of input time and makes it a lot harder to make sure I haven't dropped a bar somewhere.

Paul Scott







reply via email to

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