lilypond-user
[Top][All Lists]
Advanced

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

Re: Notes on wrong side of stem in triads


From: Paul
Subject: Re: Notes on wrong side of stem in triads
Date: Sun, 23 Oct 2016 00:01:43 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

On 10/18/2016 12:23 PM, David Kastrup wrote:

Mark Knoop <address@hidden> writes:
At 17:05 on 18 Oct 2016, Davide Liessi wrote:
I reproduced the issue with this:

\version "2.19.47"
\layout { #(layout-set-staff-size 19) }
{ <c'' e'' g''> }

Using #(set-global-staff-size 19) instead works as expected.
I couldn't find a bug report for this.
Any ideas?
Very weird, and certainly a bug. This works as expected also:

\version "2.19.47"
\layout { #(layout-set-staff-size 19.000000000001) }
{ <c'' e'' g''> }
Well, _that_ looks like the distance between noteheads is used as a
factor for deciding about the arrangement in a manner that is
numerically fragile.  Like looking whether their distance is smaller
than 1.0 staff line distances.

Indeed, the distance between note heads is calculated (via calls to Staff_symbol_referencer::get_position for each note head) and that distance determines whether a note head is moved to the other side of the stem. See stem.cc line 553 and following where "dy" is the distance between note heads:
http://git.savannah.gnu.org/cgit/lilypond.git/tree/lily/stem.cc#n553

I tried editing line 565 (the comparison involving "dy" that leads to moving a note head) and if you remove the 0.1 "safety margin" this fixes the problem (while also breaking the placement for some notes that are only a second interval apart). So it does appear to be a mysterious problem of numerical fragility.

Some weirdness: if you add \stemUp or \stemDown this fixes the problem, but only for chords where the command reverses the default direction of the stem. (!?)

Also, the problem (at size 19 at least) seems to only happen for notes at certain staff positions, for example on treble staff, notes at E line, A space, C space, and F line (symmetrical pattern around center / zero point of staff).

That's as far as I've gotten. (Won't have time to do any more for at least a week.)

-Paul




reply via email to

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