Hello everyone, I have been unable to understand the cause of the following behavior, meaning I currently lack a solution.
I moved the Mark_Engraver to the Dynamic context, so that in the chamber music score I'm working with I could put a Dynamic context both above the piano and above all the other instruments. Then I stored all the contents for this Dynamic staff (consisting of tempo indications and different text spanners) in a variable so that I would only have to write them once. Example code in the end of this message.
The problem with this approach is that I get inconsistent vertical spacing (see attached images for examples).
How can I correct this?
One thing I tried that helped somewhat is using the function ly:music-deep-copy instead of just using the variable. This makes it so that most of the time the vertical spacing is fine, but there are exceptions like the ones in the images I provided that I don't know how to solve.
Thank you in advance.
Example code follows (lilypond version 2.19.52)
My layout block:
\layout {
\context {
\PianoStaff
connectArpeggios = ##t
\accidentalStyle piano
}
\context {
\Staff
\consists "Staff_collecting_engraver"
printKeyCancellation = ##f
\accidentalStyle modern
}
\context {
\Dynamics
\consists "Staff_collecting_engraver"
\consists "Mark_engraver"
\consists "Metronome_mark_engraver"
\override RehearsalMark #'self-alignment-X = #LEFT
}
\context {
\Score
\remove "Staff_collecting_engraver"
\remove "Mark_engraver"
\remove "Metronome_mark_engraver"
\override DynamicTextSpanner.style = #'none
\override DynamicLineSpanner.staff-padding = #4
\override TextScript.staff-padding = #1
\override TextSpanner.to-barline = ##t
\numericTimeSignature
\mergeDifferentlyDottedOn
tieWaitForNote = ##t
harmonicDots = ##t
}
}
My score block:
movCFullScore = \new Score {
<<
\new GrandStaff <<
\new Dynamics = "ScoreCelloTempo" \with {
fontSize = #(magnification->font-size 0.7142)
} {
#(ly:music-deep-copy #{ \movCInputTempo #})
}
\new Staff = "ScoreCelloStaff" \with {
\magnifyStaff #5/7 } {
\movCInputCello
}
>>
\new PianoStaff <<
\new Dynamics = "ScorePianoTempo" {
#(ly:music-deep-copy #{ \movCInputTempo #})
}
\new Staff = "ScorePianoRHStaff" {
\movCInputPianoRH
}
\new Dynamics = "ScorePianoDyn" {
\movCInputPianoDyn
}
\new Staff = "ScorePianoLHStaff" {
\movCInputPianoLH
}
\new Dynamics = "ScorePianoPed" {
\movCInputPianoPed
}
>>
>>
}