[Top][All Lists]

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

Aligning note to different voice across staves

From: Thibaut Horel
Subject: Aligning note to different voice across staves
Date: Tue, 2 Feb 2021 13:10:10 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

When trying to typeset the attached bit of music (this is bar 18 of the Fugue in BWV 881), I encountered a problem captured by the following minimal example:

\version "2.22.0"
\new PianoStaff <<
   \new Staff << \relative{e'16 f g e} \\ d'4 >>
   \new Staff { \clef bass e8[ g] }

In this example, I would like the e8 in the lower staff to be aligned with the d4 in the upper staff. However, because of a note head collision, the d4 in the upper staff is shifted to the right, and the e8 from the lower staff is instead aligned with the e16 in the upper staff.

I was able to obtain the correct behavior by adding \once\override NoteColumn.X-offset = 1.25 before the e8 in the lower staff. But there are two things I don't like about this solution:

1. if I understand correctly, X-offset is measured in staff-space, so I am worried this might not scale properly when changing the note head size (for example by using a different font). It would be nicer to be able to express the offset in note head width, as for the force-hshift property for example.

2. My solution requires trial and error to find the correct value for the X-offset, whereas what I am trying to achieve can be expressed easily at the semantic level: I would like the e8 in the lower staff to be considered part of the second voice of the upper staff for vertical alignment purposes (in particular it should be shifted at the same time in case of a collision).

Is there a better way to achieve what I am trying to do? Any insight into this problem would be greatly appreciated.


Attachment: bar.png
Description: PNG image

reply via email to

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