lilypond-user
[Top][All Lists]
Advanced

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

Re: Moving note in three-voice context


From: Jakob Pedersen
Subject: Re: Moving note in three-voice context
Date: Thu, 18 May 2023 22:11:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Betterbird/102.11.0

Dear Valentin

This is really splendid. Thank you for explaining the limitations of extra-space-height and how to overcome them.

I agree that lilypond requires but a small tweak, I'm typesetting some simple chorales at the moment, and there's really very little to tweak!

Jakob

On 18.05.2023 13.03, Valentin Petzel wrote:
Hello Jakob,

try to do something like this:

\tweak extra-spacing-width #'(-1.5 . 0) a'

this will tell Lilypond to add 1.5 spaces to the left of the stem for spacing. 
In this case this will work out, but say if the d and the f# the beat before 
were an octave higher there would be no collision, so Lilypond won’t apply 
this width. In this case one might need to do

\tweak extra-spacing-height #'(-inf.0 . +inf.0)
\tweak extra-spacing-width #'(-1.5 . 0) a'

which tells Lilypond to handle that Stem as if it was infinitely long in both 
directions (up and down).

But keep in mind that Lilypond does not really require this tweak as much as 
the original, as it aligns the Voice follower line centered on the Stem. See 
for yourself:


\version "2.24.1"
\language "deutsch"

global = {
   \key g \major
   \time 4/4
   \showStaffSwitch
   \override VoiceFollower.style = #'dashed-line
}

rightOne = \relative c'' {
   \global \voiceOne h4 h a g | fis!2 f'~ | f4 f e d |
}

rightTwo = \relative c'' {
   \global \voiceTwo g4 f e2 | \voiceThree d2 d'~ | d h |
}

leftOneA = \relative c' {
   \global \voiceOne e4 d c h |
   a \change Staff = "right" \voiceTwo 
   \once\override VoiceFollower.bound-details.left.Y = #1
   \once\override VoiceFollower.bound-details.left.attach-dir = #RIGHT
   \once\override VoiceFollower.bound-details.right.Y = #0.5
   \once\override VoiceFollower.bound-details.right.attach-dir = #LEFT
   a' gis a | h2 e, |

}

leftOneB = \relative c' {
   \global \voiceOne e4 d c h |
   a \change Staff = "right" \voiceTwo 
   \once\override VoiceFollower.bound-details.left.Y = #1
   \once\override VoiceFollower.bound-details.left.attach-dir = #RIGHT
   \once\override VoiceFollower.bound-details.right.Y = #0.5
   \once\override VoiceFollower.bound-details.right.attach-dir = #LEFT
   \tweak extra-spacing-width #'(-1.5 . 0)
   \tweak extra-spacing-height #'(-inf.0 . +inf.0)
   a' gis a | h2 e, |

}

leftOneC = \relative c' {
   \global \voiceOne e4 d c h |
   a \change Staff = "right" \voiceTwo 
   a' gis a | h2 e, |

}

leftOneD = \relative c' {
   \global \voiceOne e4 d c h |
   a \change Staff = "right" \voiceTwo 
   \tweak extra-spacing-width #'(-1.5 . 0)
   \tweak extra-spacing-height #'(-inf.0 . +inf.0)
   a' gis a | h2 e, |

}


leftTwo = \relative c' {
   \global \voiceTwo e,2 a | d,2. c4 | h2 h' |
}

pedal = \relative c {
   \global c1~ | c4 c h a | gis2 gis' |
}

\markup\large "Like original without extra space"

\score {
   <<
     \new PianoStaff <<
       \new Staff = "right" << \rightOne \\ \rightTwo >>
       \new Staff = "left" { \clef bass << \leftOneA \\ \leftTwo >> }
     >>
     \new Staff = "pedal"
     << \clef bass \pedal >>
   >>
   \layout { ragged-first = ##f }
}

\markup\large "Like original with extra space"

\score {
   <<
     \new PianoStaff <<
       \new Staff = "right" << \rightOne \\ \rightTwo >>
       \new Staff = "left" { \clef bass << \leftOneB \\ \leftTwo >> }
     >>
     \new Staff = "pedal"
     << \clef bass \pedal >>
   >>
   \layout { ragged-first = ##f }
}

\markup\large "Lilypond default"

\score {
   <<
     \new PianoStaff <<
       \new Staff = "right" << \rightOne \\ \rightTwo >>
       \new Staff = "left" { \clef bass << \leftOneC \\ \leftTwo >> }
     >>
     \new Staff = "pedal"
     << \clef bass \pedal >>
   >>
   \layout { ragged-first = ##f }
}

\markup\large "Lilypond default with extra space"

\score {
   <<
     \new PianoStaff <<
       \new Staff = "right" << \rightOne \\ \rightTwo >>
       \new Staff = "left" { \clef bass << \leftOneD \\ \leftTwo >> }
     >>
     \new Staff = "pedal"
     << \clef bass \pedal >>
   >>
   \layout { ragged-first = ##f }
}


Cheers,
Valentin

Am Mittwoch, 17. Mai 2023, 19:33:13 CEST schrieb Jakob Pedersen:
Greetings!

I'm attempting to move a note horizontally to fix a poorly placed
voice-leading line.

Breitkopf fixes it by nudging the a following the staff change to the
right, and I'd like to copy that.



A minimal example from my score:

\version "2.24.1"
\language "deutsch"

global = {
   \key g \major
   \time 4/4
   \showStaffSwitch
   \override VoiceFollower.style = #'dashed-line
}

rightOne = \relative c'' {
   \global \voiceOne h4 h a g | fis!2 f'~ | f4 f e d |
}

rightTwo = \relative c'' {
   \global \voiceTwo g4 f e2 | \voiceThree d2 d'~ | d h |
}

leftOne = \relative c' {
   \global \voiceOne e4 d c h |
   a \change Staff = "right" \voiceTwo \once \override
NoteColumn.force-hshift = #3 a' gis a | h2 e, |

}

leftTwo = \relative c' {
   \global \voiceTwo e,2 a | d,2. c4 | h2 h' |
}

pedal = \relative c {
   \global c1~ | c4 c h a | gis2 gis' |
}

\score {
   <<
     \new PianoStaff <<
       \new Staff = "right" << \rightOne \\ \rightTwo >>
       \new Staff = "left" { \clef bass << \leftOne \\ \leftTwo >> }
     >>
     \new Staff = "pedal"
     << \clef bass \pedal >>
   >>
   \layout { ragged-first = ##f }
}

I've included a couple of extra bars because I wasn't sure if it was
related to something in those.

\once \override NoteColumn.force-hshift = #3 doesn't seem to work.  (3
was just an arbitrary number to see if it would move.) I can nudge the
notes at the beginning of the bar to the left, except the force-hshift
fails to work on the tied d in the bass line.

I'm sure there's a simple explanation, but I've been unable to figure it
out so far.


Best wishes,

Jakob Pedersen


ps. There's a free imaginary balloon to anyone who recognises the piece.

    


reply via email to

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