lilypond-user
[Top][All Lists]
Advanced

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

Re: Controlling compilation


From: David Sumbler
Subject: Re: Controlling compilation
Date: Fri, 15 Apr 2016 18:46:41 +0100

David Sumbler <address@hidden> writes:

> As an experiment, I produced this:
>
> File: experimentNotes.ly
>
> \version "2.19.24" 
>
> compileA =
> \score {
>   \new Staff {
>    a' a' a' a'
>   }
>   \layout { }
> }

[...]

> #(if sectionA #{ \compileA #} )


From: David Kastrup <address@hidden>
> > Date: Mon, 11 Apr 2016 09:29:40 +0200
> > 
> > #... at top level is executed and the result ignored to allow for
> > #(set! ...) and similar expressions with usually unspecified return
> > #codes.  Just try
> > 
> > $(if sectionA compileA)
> > 
> > instead.

This is wonderfully elegant, and is just what I was looking for.

I confess, though, that I have looked at the relevant section of the
"Extending" manual, and I could never have figured this out for myself.



> > From: Urs Liska <address@hidden>
> > Date: Mon, 11 Apr 2016 09:13:12 +0200
> > 
> > Hi David,
> > 
> > I'm sure this could be made work, with some more complex Scheme code.
> > But If I'm understanding you correctly there seems to be a simpler way.
> > 
> > You seem to be ready to *do* some manual changes to your master file
> > (e.g. defining a variable or not). So you could simply put your
> > different scores in individual include files and comment in/out these
> > includes.
> > If you are creating independent scores (or score/part/whatever) you
> > should consider including the scores in \bookpart expressions to
> > guarantee a page break if you compile more than one sub-score in one go.

On the face of it, this seems to me to be rather more complex than what
I was trying to do.  (I do, incidentally, use \bookpart in my full
score.)  But I would be interested to see a detailed example of how this
can be made to work.  By "detailed", I mean showing everything important
that is in each file apart from the actual music itself.


> > From: Jan-Peter Voigt <address@hidden>
> > Date: Mon, 11 Apr 2016 09:16:30 +0200
> > 
> > Hi David,
> > 
> > compileA is not compiled, because it is just a music-expression inside a 
> > scheme-expression.
> > But if you add it to the current book, it will appear. So your example 
> > will work with a tiny extension:
> > 
> > #(if sectionA (add-score #{ \compileA #} ))
> > 
> > But you should look around for templating mechanics.

I think you are suggesting something similar to what Urs described.  Can
you point me to an example of the sort of thing you are thinking of?


Thanks to all for your suggestions.

David




reply via email to

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