Thanks for the trick, Simon! That's a very useful example of repeats'
capabilities and flexibility. At the same times it seems so obvious and
hidden.

If I may make the reasoning behind this trick clear, is the following
expanded and commented code correct?

%%Code starts
\version "2.24.0"
\relative { \repeat unfold 6 {
  g'8 ( \alternative { % the first volta is repeated as needed to satisfy
the remaining repeat count
     a % first to third voltas
     c % last but two (i.e, 4)
     d % last but one (i.e, 5)
     fis, % last volta (i.e, 6)
   } % end of alternative
  b a) } % end of repeat unfold
g2 r } % end of mus exp
%%Code ends

Em seg., 15 de set. de 2025, 12:08, Mats Bengtsson <matsboxergr...@gmail.com>
escreveu:

>
> On 2025-09-14 13:33, Simon Albrecht wrote:
> > Hi everyone,
> >
> > just figured I’d recommend a bit of trickery with LilyPond input
> > syntax that makes my work transcribing music a lot easier and more
> > pleasant. This is about repetitive structures with small variations,
> > and I suspect many might not be aware of these possibilities (yet).
> >
> > Want to use \repeat unfold, but the first note has a different
> > articulation or a slur starting? Insert a zero-duration empty chord to
> > add these articulations/spanners to:
> >
> > \version "2.25.28"
> > { <>(-> \repeat unfold 6 { c'8 c'' } c'4) r }
>
> Yes, zero duration chords are useful every now and then. You may also
> find the \after command (which was added in version 2.24) very useful in
> these situations, for example:
>
> { \after 1 ( \repeat unfold 6 { c'8 c'' } c'4) r }
>
> However, if you for example want to add both a starting slur and an
> articulation, you have to combine that with your trick with a
> zero-duration chord:
>
> { \after 1 <>(-> \repeat unfold 6 { c'8 c'' } c'4) r }
>
>      /Mats
>
>
>

Reply via email to