lilypond-user
[Top][All Lists]
Advanced

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

finding first page of score in scheme


From: Graham Percival
Subject: finding first page of score in scheme
Date: Tue, 27 Jun 2006 06:43:08 -0700
User-agent: Thunderbird 1.5.0.4 (Macintosh/20060516)

I'd like to display something in the footer of the first (and last) pages of each score in a book. From ly/title-init.ly I see the first-page and last-page functions:

#(define (first-page layout props arg)
 (if (= (chain-assoc-get 'page:page-number props -1)
(ly:output-def-lookup layout 'first-page-number)) (interpret-markup layout props arg)
  empty-stencil))

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

... but they seem to rely on special layout properties ('first-page-number and 'page:last? ), which I assume are calculated for the entire \book (instead of for each individual \score). How could I create scheme functions which tell me if I'm on the first/last page of a score?

My current thought is to create a function (called at the beginning of each score) that records the page number into some global variable(s), and then create a "first-page-score" function which checks to see if the current page number is equal to one of those numbers. This seems like a ugly hack, though. Can anybody see a nice solution?

Cheers,
- Graham




reply via email to

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