Jump to content

Using an extra voice for breaks: Difference between revisions

From LilyPond wiki
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
m New category
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
This pattern becomes especially helpful when overriding <code>line-break-system-details</code> and the other useful but long properties of the <code>NonMusicalPaperColumn</code> grob.
This pattern becomes especially helpful when overriding <code>line-break-system-details</code> and the other useful but long properties of the <code>NonMusicalPaperColumn</code> grob.


<lilypond version="2.24" full>
<lilypond version="2.24">
music = \relative c'' { c4 c c c }
music = \relative c'' { c4 c c c }


Line 33: Line 33:
[[Category:Specific notation]]
[[Category:Specific notation]]
[[Category:Workaround]]
[[Category:Workaround]]
[[Category:Snippet]]

Latest revision as of 23:29, 21 November 2025

Often it is easier to manage line and page-breaking information by keeping it separate from the music by introducing an extra voice containing only skips along with the \break, \pageBreak, and other layout information.

This pattern becomes especially helpful when overriding line-break-system-details and the other useful but long properties of the NonMusicalPaperColumn grob.

\version "2.24"

music = \relative c'' { c4 c c c }

\score {
  \new Staff <<
    \new Voice {
      s1*2 \break
      s1*3 \break
      s1*4 \break
      s1*5 \break
    }
    \new Voice {
      \repeat unfold 2 { \music }
      \repeat unfold 3 { \music }
      \repeat unfold 4 { \music }
      \repeat unfold 5 { \music }
    }
  >>
}

\paper {
  indent = 0
  line-width = 140\mm
  ragged-right = ##t
}