lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Does the optimal-page-breaker work?


From: Keith OHara
Subject: Does the optimal-page-breaker work?
Date: Sun, 26 May 2013 20:31:17 -0700
User-agent: Opera Mail/12.15 (Win32)

For a long time, since version 2.10 or before, LilyPond has broken music into 
lines while also estimating how many lines will fit on each page.  From helping 
with bug-fixes I know these estimates are messy and difficult.  When these 
estimates are wrong, in either direction, we get poor page-breaking.

I can imagine some benefits from determining page-breaks and line-breaks 
together
 1) putting more or less music on each line depending on the tightness of a page
 2) choosing line-breaks to maximize the removal of empty staves in scores
 3) ending the last line on each odd page where there is time to turn the page
but I do not see any of these good effects in the default output.

If I force page breaks in specific places, LilyPond places 8 bars per line, 
regardless of how crowded the page is vertically:
  \new Staff {
    \repeat unfold 175 {b4 e' g'2 \noPageBreak } R1 \pageBreak\allowPageTurn
    \repeat unfold 150 {b4 e' g'2 } R1 \pageBreak\allowPageTurn
    \repeat unfold 100 {b4 e' g'2 } R1 \pageBreak\allowPageTurn }
After some experimenting, I find that
  \paper { page-breaking =#ly:page-turn-breaking }
does adjust the horizontal spacing to help with the vertical spacing.

Neither option seems to take advantage of empty staves:
  \new StaffGroup <<
     \new Staff \repeat unfold 12 \repeat unfold 16 {b4 e' g'2 }
     \new Staff \with { \RemoveEmptyStaves }
     \repeat unfold 12 {
       \repeat unfold 8 b1
       \repeat unfold 8 R1 } >>

ly:page-turn-breaking seems to work as described, but I find it easier to 
generate a draft .pdf and manually choose page-turns, rather than mark the 
potential page-turns in the beginning.

It seems the default ly:optimal-page-breaking gives no benefits from LilyPond 
choosing line- & page- breaks simultaneously, but suffers its side effect of 
occasional bad choices for page-breaks.

What I have started to do now is: 1) use ly:minimal-breaking to avoid the poor 
page-breaks, 2) insert \allowPageTurn where I want them, and 3) set the final 
output with ly:page-turn-breaking, hoping to get slightly better spacing given 
my manually-chosen page turns.

Has anyone ever seen LilyPond's default method choose line-breaks that might 
fit better on the pages, compared to the breaks she would choose if the music 
was all on one tall page of the same width?   Does anyone let LilyPond choose 
page-turns for them?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]