lilypond-user
[Top][All Lists]
Advanced

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

Re: Combining roughly 70 separate files into a single book


From: Jacques Menu
Subject: Re: Combining roughly 70 separate files into a single book
Date: Mon, 4 May 2020 09:52:12 +0200

Hello Brent,

I you use the same names in numerous files, you can change them automatically in all of them with a script of some sort to make them distinct, to avoid cumbersome manual editing.

JM

Le 4 mai 2020 à 06:39, Brent Annable <address@hidden> a écrit :

Hi Federico,

Your strategy seems like good advice, and I've changed the files around so I can do it. But the master file is getting very long and complicated with all the \score blocks, so I have a question: can you put a \score block into a variable, to avoid all the extra code in the master file? Whenever I try to do that I get an error message, using the syntax below:

myScore = { \score { \new Staff [etc.] } }

\myScore

Is there some special way of putting the \score block into a variable so it doesn't produce an error?

Regards,

Brent.

On Wed, 29 Apr 2020 at 06:37, Federico Bruni <address@hidden> wrote:
Il giorno mer 29 apr 2020 alle 02:36, Brent Annable
<address@hidden> ha scritto:
> Does that do page numbers as well?  I'd really like to eliminate any
> extra steps if possible; my goal is to have a master file that I can
> adjust as necessary, and then just press a button to spit the whole
> thing out every time I need a new version.
>
> Based on Jerry's suggestion I've done a little experimenting. Using a
> structure like this:
>
> \book {
> \bookpart {\include "O-Welt-ich-muss-dich.ly"}
> \bookpart {\include "O-Welt-ich-muss-dich.ly"}
> }
>
> does produce scores in sequence with headings, etc. in place, but the
> music processing is full of errors and the output is nonsensical (see
> attachment). Can someone explain to me why this approach doesn't
> work? I thought that anything in a \bookpart block should be
> independent of everything around it, is that not the case? I even
> tried it with multiple \book blocks, but that produced nothing at all.

IIRC the reason is that you cannot include, within a bookpart, a file
which contains top level expressions.
This means that, even if you remove the top level expressions (such as
\score), in any case you'll need an extra file to produce the PDF of
the single piece.

I usually follow this strategy:

- Piece-Name.ily: file containing only music variables (doesn't produce
any output), including a variable for the \score block. You'd better
use variable names which are unique within your project.
- Piece-Name.ly: here I include above file and call the \score
variable, to print a single PDF.
- If the piece is part of a collection, the collection.ly file will
include only the .ily file and call the \score variable.

HTH
Federico




reply via email to

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