[Top][All Lists]

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

Re: Lilypond crash related to tuplets

From: Aaron Hill
Subject: Re: Lilypond crash related to tuplets
Date: Sat, 23 Mar 2019 17:07:31 -0700
User-agent: Roundcube Webmail/1.3.8

On 2019-03-23 3:39 pm, Thomas Morley wrote:
Am Sa., 23. März 2019 um 21:41 Uhr schrieb Aaron Hill
   \override TupletBracket.X-positions = #(lambda (grob)
     (let ((xpos (ly:tuplet-bracket::calc-x-positions grob)))
       (if (> (car xpos) (cdr xpos))
         (format #t "\nwarning: Inverted X-positions ~a" xpos))

We have `ordered-cons´ for:

(cons (min (car xpos) (cdr xpos)) (max (car xpos) (cdr xpos)))))

Thanks, Harm. Would it be reasonable for Internals to include documentation on the various helper functions in lily-library.scm? Some have documentation strings already, but even just a list of all define-public procedures could be useful. That, or I just need to review that file enough to commit it to memory.


Here's a pathological example to trigger bad behavior:

\version "2.19.82"
\paper { indent = 0 ragged-right = ##t }
\layout {
  \set tupletFullLength = ##t
  \set tupletFullLengthNote = ##t
  \override Staff.TupletBracket.X-positions = #(lambda (grob)
    (let ((xpos (ly:tuplet-bracket::calc-x-positions grob)))
      (if (> (car xpos) (cdr xpos))
        (format #t "\nwarning: Inverted X-positions ~a" xpos))
      (ordered-cons (car xpos) (cdr xpos))))
{ \tuplet 1/1 { b'1 } \break <b' c''>4 }

It should be possible to avoid this with the following change to tuplet-bracket.cc:

<           coord = max (coord, x_span[LEFT]);
<           x_span[d] = coord - padding;
          x_span[d] = max (coord - padding, x_span[LEFT]);

This does make break-overshoot take priority over full-length-padding, as the left bound is computed first.

-- Aaron Hill

reply via email to

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