\version "2.19" autoextenders = #(define-music-function (lyrics) (ly:music?) (let* ((has-hyphen? (lambda (event) (let* ((art (ly:music-property event 'articulations)) (is-hyphen? (lambda (ev) (eq? (ly:music-property ev 'name) 'HyphenEvent)))) (find is-hyphen? art)))) (has-extender? (lambda (event) (let* ((art (ly:music-property event 'articulations)) (is-hyphen? (lambda (ev) (eq? (ly:music-property ev 'name) 'ExtenderEvent)))) (find is-hyphen? art)))) (add-extender! (lambda (event) (ly:music-set-property! event 'articulations (append (ly:music-property event 'articulations) (list (make-music 'ExtenderEvent)))) event))) (music-map (lambda (event) (if (and (eq? (ly:music-property event 'name) 'LyricEvent) ; do not add extenders below hyphens (not (has-hyphen? event)) ; do not duplicate extenders (not (has-extender? event)) ; do not add additional extenders after _ (internally equivalent to " ") ; to avoid killed extenders (not (equal? (ly:music-property event 'text) " ")) ; do not add extenders after "" to allow ending extenders ; within _ _ _ _ skip sequences with _ _ "" _ _ (not (equal? (ly:music-property event 'text) "")) ; ditto, with _ _ \markup{|null} _ _ (not (equal? (ly:music-property event 'text) (markup #:null))) ) (add-extender! event)) event) lyrics))) \score { << \new Staff << \new Voice = "melody" \relative { \voiceOne e'4 e8 e c4 c | c e8 d c2 } \new Voice = "splitpart" \relative { \voiceTwo e'4 c c c | c c c2 } >> \new Lyrics \lyricsto "melody" { They shall not o -- ver -- come, shall _ not! } \new Lyrics \lyricsto "splitpart" { \set stanza = "no extenders (old default)" We will _ _ _ will _ } \new Lyrics \lyricsto "splitpart" { \autoextenders { \set stanza = "with extenders" We will _ _ _ will _ } } \new Lyrics \lyricsto "splitpart" { \autoextenders { \set stanza = "with extenders, plus corrections" We __ \once \override LyricText.self-alignment-X = #LEFT will __ \markup{\null} _ _ \once \override LyricText.self-alignment-X = #LEFT will __ "" _ } } >> }