bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Old completion engraver bug


From: Thomas Morley
Subject: Re: Old completion engraver bug
Date: Sat, 15 Aug 2020 22:10:45 +0200

Am Sa., 15. Aug. 2020 um 18:49 Uhr schrieb Jon Arnold
<jonarnoldsemail@gmail.com>:
>
> Hi all-
>
> I'm working on 14 pieces for my dissertation that use the completion
> engravers heavily. I've just noticed a problem with lyrics alignment, which
> is documented in this old bug:
> https://sourceforge.net/p/testlilyissues/issues/1928/
>
> Is there any more current work around or hope of getting this fixed? It
> shows up all over my pieces, and I am really hoping not to have to fix it
> manually.
>
> Thanks!
>
> Jon Arnold
> _______________________________________________
> bug-lilypond mailing list
> bug-lilypond@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-lilypond

Hi,

probably below.
Please report back if it's a sufficient workaround worth adding to the issue


#(define lyric-text-at-splitted-notes
;; Left-align LyricText if the NoteHead is splitted by Completion_heads_engraver
  (lambda (grob)
    (let* (;; x-parent is usually NoteColumn
           (x-parent (ly:grob-parent grob X))
           ;; NoteHeads (as array)
           (x-parent-nhds-array (ly:grob-object x-parent 'note-heads))
           ;; NoteHeads (as list or #f)
           (x-parent-nhds
             (if (ly:grob-array? x-parent-nhds-array)
                 (ly:grob-array->list x-parent-nhds-array)
                 #f)))
      ;; If NoteHeads are splitted by Completion_heads_engraver, the
      ;; 'autosplit-end prob-property is true
      (if x-parent-nhds
          (for-each
            (lambda (nhd)
              (let* ((cause (ly:grob-property nhd 'cause))
                     (splitted? (ly:prob-property cause 'autosplit-end #f)))
                (if splitted?
                    (ly:grob-set-property! grob 'self-alignment-X LEFT))))
            x-parent-nhds)))))

\layout {
  \context {
      \Lyrics
      \override LyricText.before-line-breaking = #lyric-text-at-splitted-notes
  }
}

mel = \relative c'' {
  c2 d1 c1 c2
}

lyr = \lyricmode {
  One -- two __ three -- four.
}

\score {
  <<
    \new Staff \new Voice = "normal" \mel
    \new Lyrics \lyricsto "normal" \lyr

    \new Staff <<
      \new Voice = "completion"
        \with {
          \remove "Note_heads_engraver"
          \consists "Completion_heads_engraver"
        }
      \mel
    >>
    \new Lyrics \lyricsto "completion" \lyr

    \new Staff \new Voice = "revisited" \relative c'' { c2 c~ c c~ c c }
    \new Lyrics \lyricsto "revisited" \lyr
  >>
}

Cheers,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]