Tie at end of first repeat

Revision as of 22:47, 26 October 2025 by Jean Abou Samra (talk | contribs) (Import snippet from LSR)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A LaissezVibrer tie can be used to tie a note from the end of the first repeat back to the start of the repeated section. The length of the tie can be tweaked.

\version "2.24.0"

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

% contributed by harm6
% discussed: http://old.nabble.com/Tie-at-end-of-first-repeat-td33246568.html

% 'extendLV' is taken from LSR-snippet http://lsr.di.unimi.it/LSR/Item?id=715
 extendLV = #(define-music-function (further) (number?) 
#{
   \once \override LaissezVibrerTie.X-extent = #'(0 . 0)
   \once \override LaissezVibrerTie.details.note-head-gap = #(/ further -2)
   \once \override LaissezVibrerTie.extra-offset = #(cons (/ further 2) 0)
#})

\relative c' {
  c1~
  \repeat volta 2 { c2 c2 }
  \alternative {
    { c2 \extendLV #3 c2 \laissezVibrer }
    { d2 d2 }
  }
  c2 c2 \bar "|."
}