Jump to content

Repeat with upbeat and different durations in the alternatives

From LilyPond wiki
Revision as of 18:53, 16 November 2025 by Jean Abou Samra (talk | contribs) (Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series)

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
}