lilypond-user
[Top][All Lists]
Advanced

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

Re: #(define (bookGenerator please))


From: Pierre-Luc Gauthier
Subject: Re: #(define (bookGenerator please))
Date: Mon, 27 Jun 2016 12:56:11 -0400

Greetings,

Sorry about the late follow up (about 7 months later).

The orchestra I work with came down to a halt for the summer and I now
have some time to set stuff up for the next season.

Many thanks to you Urs and David; your explanations certainly helped
me understand more of what was going on especially about quasi-quotes.

Here is what I got so far.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\version "2.19.44"

\language "english"

\header {title = "Such title."}

scoreA = \score {\header {piece = "Piece A"} a'4}

scoreB = \score {\header {piece = "Piece B"} b'4}

scores = #(list scoreA scoreB)

#(define bookGenerator
   (define-void-function
    (
      scoreList
      bookSuffix
      ;; header
      paperBlock
      layoutBlock
      )
    (list? string? scheme? scheme?) ;; add scheme? here
    (let* (
            (book (apply ly:make-book
                    paperBlock
                    #f ;; header
                    (reverse scoreList)))
            )
      (ly:book-process book paperBlock layoutBlock bookSuffix))
    ))

\bookGenerator
\scores
"violinI"
%\header {instrument = "Violin I"}
\paper {}
\layout {}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

It works fine and I am pretty excited about this
¡¡¡So long, 500+ lines of inflexible and unmaintainable book definitions!!!
Well, my problem is with the header.
I have not found a way to pass a header to the function ly:make-book.
I found #f to make the function compile... which obviously is not much
of a suitable header.

How can I pass a header (and the global header) to ly:make-book?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A few side questions,

Also, How can I make my function be more "indentable" by using, for
example, curly braces e.g. \bookGenerator { stuff } ?

Why do I have to pass a paperBlock to ly:make-book AND to ly:book-process ?
Is there a way to only have one?
Doesn't the ly:make-book already contains the paperBlock ?

OT discussion; Frescobaldi can not, currently, get a hold of those PDF
generated with lower level commands
As this [1] comment stated, the LilyPond output could be a fail-safe
way to track down every generated PDFs instead of reverse engineering
the generated filenames as it is (I think) currently the case.

[1] https://github.com/wbsoft/frescobaldi/issues/546#issuecomment-155148714


-- 
Pierre-Luc Gauthier

Attachment: bookGenerator_ML01.ly
Description: Text Data


reply via email to

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