[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: finding first page of score in scheme
From: |
Nicolas Sceaux |
Subject: |
Re: finding first page of score in scheme |
Date: |
Thu, 29 Jun 2006 21:50:30 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) |
Graham Percival <address@hidden> writes:
> Nicolas Sceaux wrote:
>> Graham Percival <address@hidden> writes:
>>
>>> I'd like to display something in the footer of the first (and last)
>>> pages of each score in a book.
>>>
>> You may have to hack the function that builds the pages (the
>> page-breaking function set in the \paper block).
>> See scm/layout-page-layout.scm. But this is not trivial.
>> A page is created, then filled with lines (text or music systems).
>> When the page is created, the footer and header are also created (using
>> the markups defined in ly/titling-init.ly), so that the spacing function
>> should know how much space is left on the page for the lines.
>
> But doesn't lilypond know when it's compiling a new \score ? I guess
> I don't know enough about how \books are produced. This code
> (lyoutput-def-lookup layout 'first-page-number)
This property is entered by the user, or defaults to 1. Knowing the first
page number of a book is trivial.
> returns the first page of the \book. Isn't there another function
> that returns the first page of the \score ?
No. for the following reason: you have to call the page breaking
function to know on what pages a score will be placed. At the time the
footer and header markups are created by the page breaking function, the
score is not placed on it yet.
> I suppose that I could hard-code the numbers:
> #(define (first-page-score layout props arg)
> (if (= (chain-assoc-get 'page:page-number props -1)
> 3|5|7 )
> *** I know that's not proper scheme
You can do that, sure.
This problematics also arise when one wants to make a table of contents.
nicolas