lilypond-user
[Top][All Lists]
Advanced

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

Re: Merging notes and shiftOn


From: Trevor Daniels
Subject: Re: Merging notes and shiftOn
Date: Sat, 12 May 2012 08:12:18 +0100

Nick Payne wrote Saturday, May 12, 2012 7:23 AM

On 12/05/12 16:06, Nick Payne wrote:
In the documentation on collision resolution (http://lilypond.org/doc/v2.15/Documentation/notation/multiple-voices#collision-resolution), it states: "The \shiftOn command allows (but does not force) the notes in a voice to be shifted. When \shiftOn is applied to a voice, a note or chord in that voice is shifted *only* if its stem would otherwise collide with a stem from another voice, and only if the colliding stems point in the same direction." (the emphasis on *only* is mine).

However, in the example below, where I have to use shiftOff in the middle voice (to get the two F notes to merge) and shiftOn in the treble voice (to prevent the merged half notes from having their heads filled in), the two A half notes in the treble voice *are* being shifted, though from my reading of the sentence quoted above, the shift is not needed.

\version "2.15.38"

treble = \relative c''' {
    \shiftOn
    a2 a
}

bass = \relative c' {
    f2 f
}

middle = \relative c' {
    \shiftOff f8[ c'] b c f,[ c'] b c
}

\score {
    \new Staff {
        \clef treble
        \mergeDifferentlyHeadedOn
<<
            \context Voice = "1" { \voiceOne \treble }
            \context Voice = "2" { \voiceTwo \bass }
            \context Voice = "3" { \voiceThree \middle }
>>
    }
    \layout { }
}

p.s. I have just found out that if I replace \shiftOn with \shiftOn \override NoteColumn #'force-hshift = #0, then the notes in the treble voice do not actually get moved, and I still get the correct merging of the notes in the other voices. However, it still seems that the documentation does not correctly describe how shiftOn actually behaves.

You're right.  In your example the stems don't actually collide
because of the large vertical separation, but their note columns
still clash.  Perhaps we should change "collide" to "align" and
"colliding" to "aligning" in the text.  Maybe we need to add a
bit about "force-hshift not being overridden" too, which seems
a good work-around in this situation.

Ideally the code should be amended to test for a vertical
separation sufficiently large to avoid the stems overlapping,
in which case a shift would not be needed, and then the text
as written would be correct.

Trevor




reply via email to

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