lilypond-user
[Top][All Lists]
Advanced

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

Re: finding first page of score in scheme


From: Graham Percival
Subject: Re: finding first page of score in scheme
Date: Fri, 30 Jun 2006 08:50:21 -0700
User-agent: Thunderbird 1.5.0.4 (Macintosh/20060516)

Nicolas Sceaux wrote:
Graham Percival <address@hidden> writes:

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.

Ah, I remember the issue now.

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.

Ok, got it now.  Thanks for explaining it again.


I suppose that I could hard-code the numbers:

For the archives, here's that solution.



%%%  You can hide this stuff somewhere in your init files.
#(define (first-page-score layout props arg)
  (if (member (chain-assoc-get 'page:page-number props -1)
         FIRSTPAGES )
   (interpret-markup layout props arg)
   empty-stencil))
       %  (lyoutput-def-lookup layout 'first-page-number))

#(define (last-page-score layout props arg)
  (if (chain-assoc-get 'page:last? props #f)
   (interpret-markup layout props arg)
   empty-stencil))

\paper{
  oddFooterMarkup = \markup {
  \column {
    \fill-line {
%      \on-the-fly #first-page-score \fromproperty #'header:copyright
\on-the-fly #first-page-score \column { FIRST! fill up more more space}
    }
    \fill-line {
%      \on-the-fly #last-page-score \fromproperty #'header:tagline
      \on-the-fly #last-page-score LAST!
    }
  }
}
}



%%% this is your actual lilypond file
FIRSTPAGES = #'(2 4)
\header {
  title = "all title"
}
\paper {
  printallheaders = ##t
  ragged-last-bottom = ##t
}

\include "piece1.ly"
\include "piece2.ly"







reply via email to

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