On 2025-12-20 22:37, David Zelinsky wrote:
I'm transcribing a part and want to copy the line breaks for easy
comparison. In order to be able to turn them off easily I'm putting the
line breaks in a separate voice with spacers. This works fine, except
that when there are grace notes attached to a note at the start of a
measure, and that measure is after a line break, the grace notes appear
at the end of the preceding line. When I put the \break in the voice
with the grace notes, this does not happen.
Why does this happen, and how can I fix it?
I found a workaround by putting a spacer grace note in the voice with
the breaks. But this is very fussy. Is there a better way?
Or, is there a better way overall to do what I'm trying to do?
Hi David,
I don't know if this is a "better" way, but here's how I would go about it:
\version "2.25.0"
\paper { ragged-right = ##t }
mbrk = { }
mbrk = { \break }
music = \relative c'' {
c1 \mbrk \grace {a16 b} c1
d1 \grace{b16 c} d1
e1 \grace{c16 d} e1 }
\new StaffGroup \with { \RemoveEmptyStaves }
{
\autoBreaksOff
\new Staff
\new Voice \music
}
As shown here the second definition of \mbrk takes effect, acting as a
line break. Once you're done entering things in and checking it over,
comment out the second \mbrk, leaving the first to be an empty value.
This will let Lilypond do its magic with its own line breaking.
I can't take credit for coming up with this - I saw this somewhere some
time back, and have been using it ever since. It's simple, and has
worked well for me.
--
Michael