Am 15.04.2016 um 19:46 schrieb David Sumbler:
>>> 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.
Maybe the others' solutions are simpler. I would have thought there's
more to be done in Scheme ...
> (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.
>
>
OK, probably I'd need several examples for different use cases (as I'm
not fully clear what you *really* want to do). But I'll show you one
pattern that I like pretty much: Actually it's one set-up and two
patterns/uses
###
musicA.ily:
violin = {
c''1
}
viola = {
c'1
}
cello = {
\clef bass
c1
}
###
musicB.ily:
violin = {
d''1
}
viola = {
d'1
}
cello = {
\clef bass
d1
}
###
violinStaff.ily
violinStaff = \new Staff \violin
### etc. violaStaff.ily and celloStaff.ily
###
partViolin.ily
\include "violinStaff.ily"
\bookpart {
\score {
\violinStaff
}
}
### etc. for viola and cello
###
score.ily
\include "violinStaff.ily"
\include "violaStaff.ily"
\include "celloStaff.ily"
\bookpart {
\score {
<<
\violinStaff
\violaStaff
\celloStaff
>>
}
}
Now your actual main.ly:
\include "musicA.ily"
%\include "musicB.ily"
\include "partViolin.ily"
%\include "partViola.ily"
%\include "partCello.ily"
\include "score.ily"
#################
Now you can:
- comment out one of the alternative music files (using A or B)
- comment out any combination of part/score files.
The key to this is that you define alternative music files with
variables of the same name. Then you define scores/parts etc. that *use*
these variables. If you set this up properly you can easily switch
between musics and scores.
Depending on the use case one can make this even more sophisticated by
plugging in "adaptor" files.
HTH
Urs
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user