Hi Paolo, Hi Jean,

\unfoldRepeats does do the trick, but it is rather hard to read structurally. 
If I look at something like

{ \partA \transition \partB \partA \ending }

The structure is immediately clear. Instead if we have

\unfoldRepeats {
\repeat unfold 2 {
 many lines of code
}
\alternative {
 many more lines of code
}

the structural intention is much obscurer, thus one needs to know what’s 
happening to understand it.

But in case we have many more parts (like in a rondo) this might be useful for 
doing

\unfoldRepeats {
\repeat unfold 5 \partA
\alternative { \partB \partC \partD \partE \ending }
}

or something.

Cheers,
Valentin


Am Donnerstag, 6. Jänner 2022, 22:50:39 CET schrieb Jean Abou Samra:
> Le 06/01/2022 à 21:36, Paulo Matos a écrit :
> > Hi,
> > 
> > I have some music I want to transcribe that has 2 parts: A and B the
> > music goes:
> > part A
> > part B
> > part A with special ending
> > 
> > I could of course define variables like:
> > \partA =
> > \partAtransition =
> > \partAending =
> > \partB =
> > 
> > and then write the music as
> > \partA
> > \partAtransition
> > \partB
> > \partA
> > \partAending
> > 
> > However, I would like to simplify the final score. What's the best way
> > to write this? I saw repeats but that doesn't seem to be exactly what I
> > need.
> > 
> > However the partA with different endings sound like it could be where I
> > could use \alternative, but unsure how to put it all together. Any
> > suggestions?
> 
> You can use \unfoldRepeats for this purpose. It
> takes repeats notated with repeat bars and volta
> brackets (or, in very recent and unreleased versions,
> segno repeats), and just unfolds them to make them
> written out.
> 
> \version "2.22.1"
> 
> \unfoldRepeats {
>    \repeat unfold 2 {
>      c'1 %% Part A
>    }
>    \alternative {
>      { d'1 } %% Part A transition and part B
>      { e'1 } %% Part A Ending
>    }
> }
> 
> 
> This command is primarily meant for MIDI output,
> so it is documented here:
> https://lilypond.org/doc/v2.23/Documentation/notation/using-repeats-with-mid
> i
> 
> If you need a more complex structure, you might
> want the \volta command introduced in version
> 2.23. It is more flexible than the traditional
> way to write \alternative blocks, allowing to
> write, e.g.
> 
> \alternative {
>    \volta 1,2 { ... }
>    \volta 3 { ... }
> }
> 
> See
> https://lilypond.org/doc/v2.23/Documentation/notation/long-repeats.html#alte
> rnative-endings
> 
> Best,
> Jean

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to