page-turning using correct page numbers

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

page-turning using correct page numbers

Joe Neeman-2
This is sort of a bug fix, but I thought I'd post it instead of
committing because it changes behaviour. In current lily CVS, it's
assumed that the first page of a book is always the left-hand page. This
is usually false: odd-numbered pages should go on the right and the
first page is usually page number 1. This patch fixes that. If the first
page number is odd, the page turn page-breaker will put its first page
turn after 1 page instead of after 2.

I also introduce the auto-first-page-number variable in the paper block.
If auto-first-page-number is true, the page-turn-page-breaker is allowed
to increase the first page number by one if it will improve page
spacing.

2006-09-30  Joe Neeman  <[hidden email]>

        * lily/page-turn-page-breaking.cc (calc_demerits): now that we allow
        put_systems_on_pages to return an empty result, we need to assign
        demerits properly in that case.
        (put_systems_on_pages): Make the number of pages depend on the
        evenness of page_number. Add auto-first-page-number.
        (calc_subproblem): ensure that the page-number is even for the
        left-hand page. Warn if the first page-turn doesn't fit onto the
        first (right-hand) page.

        * lily/page-spacing.cc (solve): bug: demerits_ would always be inf
        (min_page_count): make this publicly accessible
        (min_page_count): fix a bug when there are forced page breaks that
        was introduced when I made this loop run backwards
        (space_systems_on_n_pages, space_systems_on_n_or_one_more_pages):
        replace space_systems_on_min_pages with these two. The logic in
        space_systems_on_min_pages was getting too convoluted and is better
        contained in page-turn-page-breaking.

_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

tmp.patch (15K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: page-turning using correct page numbers

Han-Wen Nienhuys-2
Joe Neeman schreef:
> This is sort of a bug fix, but I thought I'd post it instead of
> committing because it changes behaviour. In current lily CVS, it's
> assumed that the first page of a book is always the left-hand page. This
> is usually false: odd-numbered pages should go on the right and the
> first page is usually page number 1. This patch fixes that. If the first
> page number is odd, the page turn page-breaker will put its first page
> turn after 1 page instead of after 2.

cool - I trust your judgement regarding the page breaking code, so feel
free to apply.

--

Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
  -- Code for Music Notation
http://www.lilypond-design.com



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: page-turning using correct page numbers

Joe Neeman-2
On Sat, 2006-09-30 at 11:47 +0200, Han-Wen Nienhuys wrote:

> Joe Neeman schreef:
> > This is sort of a bug fix, but I thought I'd post it instead of
> > committing because it changes behaviour. In current lily CVS, it's
> > assumed that the first page of a book is always the left-hand page. This
> > is usually false: odd-numbered pages should go on the right and the
> > first page is usually page number 1. This patch fixes that. If the first
> > page number is odd, the page turn page-breaker will put its first page
> > turn after 1 page instead of after 2.
>
> cool - I trust your judgement regarding the page breaking code, so feel
> free to apply.
Done. And here is some suggested documentation.

_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

tmp.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: page-turning using correct page numbers

Graham Percival-2
Joe Neeman wrote:

> Done. And here is some suggested documentation.

Thanks!  I rewrote it a bit (see below); please commit.

Cheers,
- Graham

> ------------------------------------------------------------------------
>
> Index: ChangeLog
> ===================================================================
> RCS file: /sources/lilypond/lilypond/ChangeLog,v
> retrieving revision 1.5344
> diff -u -r1.5344 ChangeLog
> --- ChangeLog 30 Sep 2006 20:59:53 -0000 1.5344
> +++ ChangeLog 30 Sep 2006 21:46:26 -0000
> @@ -1,5 +1,8 @@
>  2006-10-01  Joe Neeman  <[hidden email]>
>  
> + * Documentation/user/page.itely (Page formatting):
> + document auto-first-page-number
> +
>   * lily/page-spacing.cc (compress_lines, uncompress_solution):
>   handle correctly the case where there are multiple \noPageBreaks
>   in a row.
> Index: Documentation/user/page.itely
> ===================================================================
> RCS file: /sources/lilypond/lilypond/Documentation/user/page.itely,v
> retrieving revision 1.11
> diff -u -r1.11 page.itely
> --- Documentation/user/page.itely 22 Sep 2006 08:12:22 -0000 1.11
> +++ Documentation/user/page.itely 30 Sep 2006 21:46:26 -0000
> @@ -268,6 +268,14 @@
>  spacing. High values will make page spacing more important. Default
>  value is 1.
>  
> +@funindex auto-first-page-number
> +@item auto-first-page-number

The page breaking algorithm is affected by the first page number being
odd or even.  If this variable is set to #t, the page breaking algorithm
will decide whether to start with an odd or even number.  This will
result in the first page number remaining as is or being increased by one.



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: page-turning using correct page numbers

Joe Neeman-2
In reply to this post by Joe Neeman-2


On 1/15/07, Anthony W. Youngman <[hidden email]> wrote:
In message <[hidden email]>, Joe Neeman
<[hidden email]> writes
>This is sort of a bug fix, but I thought I'd post it instead of
>committing because it changes behaviour. In current lily CVS, it's
>assumed that the first page of a book is always the left-hand page. This
>is usually false: odd-numbered pages should go on the right and the
>first page is usually page number 1. This patch fixes that. If the first
>page number is odd, the page turn page-breaker will put its first page
>turn after 1 page instead of after 2.

Very late response I know, but ... (I'm catching up on the email and
haven't read the latest manual :-(

What you say may be true for scores, but is often false for parts. If
the piece being formatted is less than or equal to four pages, then I
couldn't care less so long as the page turn is at a break. If there's a
nice rest in the middle of the piece, I'll print pages 1 and 2 2-up one
side, then turn for the other two. Or if there are convenient breaks
after pages 1 and 3, I'll break "conventionally". Oh - and which one is
preferable depends on conditions - will I be trying to turn a page
that's pegged onto the stand to prevent it blowing away in the wind ...

I hope you've probably already made it choosable, but it needs to be
user-specified whether the page-turn-page-breaker is invoked after odd
or even page numbers. Making the default odd pages sounds right ... is
auto-first-page-number true by default?

Currently auto-first-page-number is false by default, but it will print a warning if it can't find a convenient break after the first page suggesting that you set the first page number to an even number.
 

I think it should be. (Just
don't alter the page number that actually prints - a part with pages 2-5
2-up on A3 double-sided would look WELL odd :-)

This is why I didn't set it to true by default: it /does/ change the page number that actually prints. This is consistent with all the parts I looked at that start on the left-hand page, but I can see that it would look strange if there are only a few pages.

There was a request a while back about making the places for page turns more flexible. With the solution I have in mind for this, you would be able to say that it should turn only after even pages and the first page should be page 1 (this would give what you want, yes?). I have other things I want to do first, but I should manage it before 2.12.

Cheers,
Joe

_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: page-turning using correct page numbers

Anthony W. Youngman
In message <[hidden email]>,
Joe Neeman <[hidden email]> writes
>There was a request a while back about making the places for page turns
>more flexible. With the solution I have in mind for this, you would be
>able to say that it should turn only after even pages and the first
>page should be page 1 (this would give what you want, yes?). I have
>other things I want to do first, but I should manage it before 2.12.

Yup, perfect :-)

Cheers,
Wol
--
Anthony W. Youngman - [hidden email]



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel