Thank you kindly, Kieran. I appreciate your time.
I agree about the structure. Thank you for the example. I'll follow that.
Whatever else needs adjusting I'm sure I can force-\tweak into place.
Jakob
On 17.12.2023 15.49, Kieren MacMillan wrote:
Hi Jakob,
Does anyone know how to align VoiceOne (green) further left to match the
horizontal position of VoiceFour (red)?
You could switch the \voiceTwo and \voiceFour commands… but that creates an
even less pleasing result [IMO].
There are also ways to tweak the horizontal position of the noteheads; I just
don’t have time right now to give examples (sorry!).
In the final bar, is it possible to align VoiceTwo (blue) and VoiceFour (red),
without causing them to share a stem?
Something like this?
leftTwo = \relative c {
\global << { \voiceFour \override NoteHead.color = #red c4 c' h a | h g a h
| \tweak Stem.length #5 c a8\rest c h a h g }
\new Voice { \voiceTwo \override NoteHead.color = #blue c,2 h4 a | h g
a h | \tweak NoteColumn.force-hshift -0.5 c2 g\rest } >>
}
For what it’s worth, I would suggest a restructuring of your code, to (a) avoid
potential potential issues if you start adding things [especially things with
timing!] to the \global variable, and (b) to improve [at least IMO] readability
and maintainability. Here’s a possibility I quickly whipped up:
%%% SUGGESTED STRUCTURE (BEGIN) %%%
\version "2.25.11"
\language "deutsch"
global = {
\key c \major
\time 4/4
}
rightOne = \relative c'' {
c8 d e fis g d e fis | g d g4. f16 e d8 f~| f e16 d e8 r r2 |
}
rightTwo = \relative c'' {
g4. a8 h4 c | h4. h8 a4. g8 | c2 r2 |
}
leftOne = \relative c' {
\override NoteHead.color = #green
e4 r d c | d2 c4 d | g, f'\rest r2 |
}
leftTwo = \relative c' {
\override NoteHead.color = #blue
c,2 h4 a | h g a h | \tweak NoteColumn.force-hshift -0.5 c2 g\rest
}
leftFour = \relative c {
\override NoteHead.color = #red
c4 c' h a | h g a h | \tweak Stem.length #5 c a8\rest c h a h g
}
\score {
\new PianoStaff <<
\new Staff = "right" <<
\global
<<
{ \voiceOne \rightOne }
\\ \new Voice { \voiceTwo \rightTwo }
>>
>>
\new Staff = "left" <<
\global \clef bass
<<
{ \voiceOne \leftOne }
\\ \new Voice { \voiceTwo \leftTwo }
\\ \new Voice { \voiceFour \leftFour }
>>
>>
>>
}
%%% SUGGESTED STRUCTURE (END) %%%
Here, almost all presentation decisions are left as late as possible (i.e., in
the \score area), with the exception of the colour setting(s) and the
voice-specific \tweaks (which I would personally also take out of the content
code and add to the presentation layer, likely by way of the edition-engraver,
if this were a “real piece“ of mine). This structure also puts all of the
voice-splitting in the same place in the code, rather than having some in the
variable definition area and some in the score area.
Hope all of this helps!
Kieren.
______________________________________________
My work day may look different than your work day. Please do not feel obligated
to read or respond to this email outside of your normal working hours.