\version "2.16.0" % get the current output name myname = #(ly:parser-output-name parser) % process a score with ly:book-process % score - the score writeScoreOddEven = #(define-void-function (parser location score) (ly:score?) (let ((book #{ \book { \score { $score } } #}))) ; process with first-number 1 (ly:output-def-set-variable! (ly:book-paper book) 'first-page-number 1) (ly:book-process book #{ \paper {} #} #{ \layout {} #} myname) ; process with first-number 2 (ly:output-def-set-variable! (ly:book-paper book) 'first-page-number 2) (ly:book-process book #{ \paper {} #} #{ \layout {} #} (format "~A-even" myname))) % Let the first page number be visible (to see the result) \paper { print-first-page-number = ##t } % Call the function \writeScoreOddEven \score { \relative c'' { c b a g c1 } }