bug-lilypond
[Top][All Lists]
Advanced

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

Re: Old completion engraver bug


From: James Lowe
Subject: Re: Old completion engraver bug
Date: Fri, 21 Aug 2020 11:59:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 17/08/2020 21:41, Jon Arnold wrote:
Yes, this works well! Thanks very much.

On Sat, Aug 15, 2020 at 3:10 PM Thomas Morley <thomasmorley65@gmail.com>
wrote:

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

I've added this to

https://gitlab.com/lilypond/lilypond/-/issues/1928

Note that we no longer use sourceforge to track our issues.

Regards

James




reply via email to

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