[Top][All Lists]

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

Assertion failure when using Melody_engraver and CueVoice

From: Jean Abou Samra
Subject: Assertion failure when using Melody_engraver and CueVoice
Date: Wed, 10 Feb 2021 20:30:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0

Hi there,

Thank you for all your work on LilyPond!

It appears to be impossible to use a Melody_engraver in a Voice that also
includes a CueVoice. Here’s a LilyPond example that illustrates the issue:

\version "2.22.0"
\new Voice \with {
   \consists "Melody_engraver"
   \override Stem.neutral-direction = #'()
} {
     { r }
     \new CueVoice { c'' }

LilyPond outputs:

GNU LilyPond 2.22.0
Processing `test.ly'
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...Assertion failed: (d == 1 || d == -1), function at, file
  line 35.

All the best,


The example can be reduced even further, showing
that the problem is not actually related to the
Melody_engraver or the CueVoice context:

\version "2.23.1"

\new Voice {
  \override Stem.neutral-direction = #'()
    { r }
    \new Voice { c }

Maybe try something like this to work around:

\version "2.23.1"

#(set-object-property! 'rest-neutral-direction 'backend-type? ly:dir?)

\layout {
  \context {
    \consists "Melody_engraver"
    \override Stem.neutral-direction = #'()
    \override Stem.rest-neutral-direction = #UP
    \override Stem.before-line-breaking =
       #(grob-transformer 'before-line-breaking
          (lambda (grob dummy)
            (let ((original (ly:stem::calc-default-direction grob)))
                (cond ((memv original '(-1 1))
                      ((null? (ly:grob-object grob 'rests))
                       (ly:grob-property grob 'neutral-direction))
                       (ly:grob-property grob 'rest-neutral-direction)))))))

\new Voice {
  \time 3/4
    { r }
    \new Voice \relative c'' {
      a8 b g f b g |
      c  b d c b c |

Jean Abou Samra

reply via email to

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