The reason for misalignment and spacing issues was a slight inaccuracy in
**lily/stem.cc, function Stem::extremal_heads**

This function is supposed to give back "lowest" and "highest" head of a chord.
Especially the note opposite the stem direction is used to determine the main 
column resp. the "correct" side of the stem when there are unisons or seconds 
in a chord and noteheads have to be displaced/shifted.

In the special case of unisons (i. e. notes of the same pitch) at the 
lower/upper end of a chord, Stem::extremal_heads did not give back the first of 
the lower unison notes, but the last.
This could lead to an X-aligning of grobs to the wrong notehead and it also 
messed up spacing.

Please find attached a comparative regtest showing the new 
chord-X-align-on-main-noteheads regtest file and two exiting tests showing the 
more natural spacing after the patch.

All the best,
Torsten


Attachments:

- 
[issue5413-regtest-comp.png](https://sourceforge.net/p/testlilyissues/issues/_discuss/thread/e4ff71df/470f/attachment/issue5413-regtest-comp.png)
 (130.9 kB; image/png)


---

** [issues:#5413] X-aligning problem with chords containing unisons**

**Status:** Started
**Created:** Wed Sep 05, 2018 06:30 PM UTC by Simon Albrecht
**Last Updated:** Wed Sep 05, 2018 07:54 PM UTC
**Owner:** Torsten Hämmerle
**Attachments:**

- 
[X-align-on-main-noteheads.png](https://sourceforge.net/p/testlilyissues/issues/5413/attachment/X-align-on-main-noteheads.png)
 (28.8 kB; image/png)


http://codereview.appspot.com/369840043

[Reported by Torsten 
Hämmerle:](https://lists.gnu.org/archive/html/bug-lilypond/2018-09/msg00000.html)

Chords containing unison highest/lowest notes will sometimes produce wrong
positioning of articulation marks, dynamics, slurs, etc.
These grobs should be centred on the notehead that is on the correct side of
the stem (as Gould put it).

Technically, the "correct" side of the stem is determined by the first note
in the chord, i.e. the note opposite the stem's direction.

If this extremal note happens to have a unison sibling, LilyPond currently
will pick the wrong notehead in some cases (stem up), thus causing a wrong
positioning of articulations, dynamics, slurs, …  The spacing will be
widened up a bit, too, as a chord-building side-effect.

The misplaced grobs are coloured in red and below, there's my proposed
solution for correct positioning.


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/testlilyissues/issues/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/testlilyissues/admin/issues/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Testlilyissues-auto mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/testlilyissues-auto
  • [Lilypond-... Auto mailings of changes to Lily Issues via Testlilyissues-auto
    • [Lily... Auto mailings of changes to Lily Issues via Testlilyissues-auto
    • [Lily... Auto mailings of changes to Lily Issues via Testlilyissues-auto
    • [Lily... Auto mailings of changes to Lily Issues via Testlilyissues-auto
    • [Lily... Auto mailings of changes to Lily Issues via Testlilyissues-auto
    • [Lily... Auto mailings of changes to Lily Issues via Testlilyissues-auto
    • [Lily... Auto mailings of changes to Lily Issues via Testlilyissues-auto
    • [Lily... Auto mailings of changes to Lily Issues via Testlilyissues-auto
    • [Lily... Auto mailings of changes to Lily Issues via Testlilyissues-auto

Reply via email to