Jump to content

Repeat with upbeat and different durations in the alternatives

From LilyPond wiki
Revision as of 23:32, 21 November 2025 by Lemzwerg (talk | contribs) (New category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A volta repeat in a score with an upbeat may

  • end in a fraction of a measure
  • have different durations in the alternatives

This is done using \partial in the second alternative.

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=490

{
 \repeat volta 2 {
   \partial 4
   e'4
   \set Timing.measureLength = #(ly:make-moment 5/4)
   c'2
 }
 \alternative {
   {
     f'4
   }
   {
     a'2 
   }
 }
 \unset Timing.measureLength
 c'1
}