On Sat, Jun 6, 2009 at 3:22 AM, Mark Polesky<markpole...@yahoo.com> 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. ------Jay _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel