I am trying to make a book page for explaining different notes and their durations. What I currently get is this:
How can I align the notes vertically? (i.e., spacing in each line should be as in the first.)
Hint: I need some space on the right side to add explanatory text/images. That's why I chose ragged-right
to be #t
, but there might be other options.
Here is my code:
\version "2.20.0"
\paper {
indent = #0
}
\bookpart {
\score {
\relative {
c'1 d e f g a b c r \break
c,2. d e f g a b c r \break
c,2 d e f g a b c r \break
c,4. d e f g a b c r \break
c,4 d e f g a b c r \break
c,8 d e[ f] g_[ a b] c r \break
}
\layout {
ragged-right = ##t
\context {
\Staff
\remove "Time_signature_engraver"
\remove "Clef_engraver"
\remove "Bar_engraver"
%\remove "Staff_symbol_engraver"
}
\context {
\Score
\remove "Bar_number_engraver"
}
}
}
}
One way I tried was this:
- add time signatures so that each note has its own measure.
- Utilizing this snippet to force the width of all measures to be equal.
But the notes were still not aligned: Notes of different duration have a different distance from the left end of their measure.
I also tried this, i.e. I added
\override Score.SpacingSpanner.strict-note-spacing = ##t
\override Score.SpacingSpanner.shortest-duration-space = #8
\override Score.SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/8)
or any subset of these three lines into my Score
context. But it did not change a thing.
s4
? I tried, but they result in far too much space between the notes.