bug-lilypond
[Top][All Lists]
Advanced

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

Failing !is_empty assertion and tremolos


From: Aaron Hill
Subject: Failing !is_empty assertion and tremolos
Date: Sat, 23 Mar 2019 19:46:09 -0700
User-agent: Roundcube Webmail/1.3.8

I think I have narrowed down the source of the problem.

From stem-tremolo.cc:175-177:

 Interval ph = stem->pure_y_extent (stem, 0, INT_MAX);
 Stem_info si = Stem::get_stem_info (stem);
 ph[-dir] = si.shortest_y_;

There is an implicit assumption that si.shortest_y_ will always be within the interval ph. Otherwise, the final line will produce an inverted interval. And later on in the function, the !is_empty assertion will fail when ph.center() is called.

Here is a snippet where I have \overridden Stem.stem-info with a procedure that detects and corrects the value that ultimately leads to an invalid interval:

%%%%
\version "2.19.82"
\relative a {
  \override Stem.stem-info = #(lambda (grob)
    (define msg "\nwarning: shortest_y ~a outside interval ~a")
    (let ((si (ly:stem::calc-stem-info grob))
          (ph (ly:stem::pure-height grob 0 0)))
      (if (not (<= (car ph) (cadr si) (cdr ph)))
        (format #t msg (cadr si) ph))
      (list (car si) (max (car ph) (min (cdr ph) (cadr si))))))
  a32 8..:32 b32 8..:32 c32 8..:32 d32 8..:32 e32 8..:32
  f32 8..:32 g32 8..:32 a32 8..:32 b32 8..:32 c32 8..:32
  d32 8..:32 e32 8..:32 f32 8..:32 g32 8..:32 a32 8..:32
}
%%%%

Of course, this is not to say that Stem::calc_stem_info is definitely in the wrong, but its output is not always what Stem_tremolo::pure_height would seem to expect.


-- Aaron Hill



reply via email to

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