lilypond-devel
[Top][All Lists]
Advanced

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

Re: Page turning in song book: Only \scores with more than 1 page should


From: Johannes Maibaum
Subject: Re: Page turning in song book: Only \scores with more than 1 page should be forced to start on even page number
Date: Fri, 24 Feb 2023 21:34:21 +0100
User-agent: Evolution 3.46.3 (3.46.3-1.module_f37+15877+cf3308f9)

Hello Valentin,

returning here after another year (and what a year...).

I wanted to ask if it would be possible to improve the page-turn-
breaking algorithm for the case where the user also has ragged-bottom
set to #t (which you correctly assumed I was trying to use as well).

Am Donnerstag, dem 24.02.2022 um 00:43 +0100 schrieb Valentin Petzel:
> Hello Johannes,
> 
> using page-turn-breaking only acts like this if ragged-bottom is set to #t 
> (which should be considered as weird behaviour). I suppose what’s happening 
> there is that with ragged-bottom set to #t there is no demerit for short 
> pages, as the pages are not stretched out (which is the thing that would get 
> demerits). This means that there is no demerit to breaking in every possible 
> place, which I think is one of the first solutions tried by the breaking 
> algorithm. Thus even if we find a shorter solution of equal demerit we won’t 
> use it.
> 
> I’d suggest we should add a very small demerit for solutions with lots of 
> pages so that with configurations with the same overall demerit the one with 
> less pages is preferred.
> 
> E.g. changing line 124 in page-turn-page-breaking.cc to
> ret.demerits_ = result.demerits_ + static_cast<Real>(ret.page_count_)/1000;
> we do already get better behaviour (although probably not the best, for some 
> weird reason it allows compression of pages when it is not nescessary, like 
> here

Would this be line 129 today, i.e. in
Page_turn_page_breaking::put_systems_on_pages()?

https://gitlab.com/lilypond/lilypond/-/blob/master/lily/page-turn-page-breaking.cc#L129

> 
> \paper {
>   page-breaking = #ly:page-turn-breaking
>   ragged-bottom = ##t
> }
> 
> {\repeat unfold 20 c1 }
> {\repeat unfold 20 c1 }
> {\repeat unfold 20 c1 }
> {\repeat unfold 40 c1 }
> {\repeat unfold 20 c1 }
> {\repeat unfold 100 c1 }
> {\repeat unfold 20 c1 }
> {\repeat unfold 20 c1 }
> {\repeat unfold 20 c1 }
> {\repeat unfold 20 c1 }
> {\repeat unfold 200 c1 }
> 
> on page 2). It might also be sensible to add a small demerit depending on the 
> free whitespace to enforce a more even distribution of whitespace.
> 
> Cheers,
> Valentin
> 
> Am Mittwoch, 23. Februar 2022, 18:13:15 CET schrieb Johannes Maibaum:
> > Hello,
> > 
> > I am working on a lead-sheet song book (i.e. one \book with many short
> > \scores inside), and I was looking for a way to optimize page turning
> > for musicians playing tunes from the book. Most songs fit on a single
> > page, but there are a few songs which span 2 or more pages.
> > 
> > I want to make sure that all songs which more than 1 page start on an
> > even page, but all 1-page songs should be allowed to start on an even or
> > an odd page.
> > 
> > Looking through the documentation, and testing the built-in page-
> > breaking algorithms, there doesn't seem to be a turn-key solution for my
> > use-case. The default optimal-breaking algorithm starts every \score on
> > the next page (even or odd), and page-turn-breaking forces every \score
> > to start on an even page, which causes (almost) blank pages (the last
> > line is put on the odd page) after all tunes which would happily fit on
> > 1 page.
> > 
> > I tried fiddling with the different blank-page-*-penalties, but so far I
> > wasn't able to achieve my goal. Is it possible after all?
> > 
> > 
> > Best,
> > Johannes
> 



reply via email to

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