lilypond-user
[Top][All Lists]
Advanced

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

Re: headers, and what include doesn't do


From: David Wright
Subject: Re: headers, and what include doesn't do
Date: Fri, 16 Oct 2020 22:45:04 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Fri 16 Oct 2020 at 15:50:55 (+0200), Jean Abou Samra wrote:

> > It's seems very likely from the way you've expressed your problem that
> > you think LP attaches some meaning to \include. It doesn't. Writing
> > \include "foo.ly"   just pastes the contents of foo.ly into the source
> > at that point. After all the \include files have been copied in, then
> > LP processes the resulting big/gigantic file that results. (You could
> > perfectly well do the same assembly job with cut&paste in an editor.)
> 
> Kind of, but not exactly. For example, LilyPond will still warn you about
> a missing \version statement in your main file even if an \included file
> contains one.
> 
> In practice, this is the only difference from copy-pasting that I'm aware
> of, though.

The reason for that is that \version, like \include, has nothing to do
with LP's functionality. \version is just a syntax property of the
file containing it. Used sensibly, it allows convert-ly to convert a
collection of files of different syntax vintages automatically,
without your having to specify the vintage of each file in the command
line. (It just reads the \version contained in each file.)

Yes, LP warns about the top-level file not containing a \version,
and generates an error message (and sets a return code) whenever
it meets a version number greater than its own. But so long as the
actual syntax encountered does not violate its own version, LP's
processing is unaffected, which is the point I'm trying to make.

Were the OP to carry out the cut&paste as I suggested, and possibly
reduce each movement to, say, a dozen measures, it might be easier
to appreciate the logical structure of the sonata's source without
being confused by the irrelevant physical structure of the files.
That's why I posted the two example files demonstrating which
lines in foo.ly generate which annotations in foo.pdf. (One hopes
that the OP is using an editor that can re-indent the pasted-together
source, which might also help to clarify the overall structure.)

> (For technical reasons, \header should come after the music inside \score.)

That's right, \score must begin with a music expression.

Cheers,
David.



reply via email to

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