lilypond-user
[Top][All Lists]
Advanced

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

[large/complex projects] conditional header values and/or book name


From: Kieren MacMillan
Subject: [large/complex projects] conditional header values and/or book name
Date: Mon, 22 Jan 2024 14:09:13 -0500

Hi all,

I have a big engraving use case — I’m neck-deep in an example of it right now! 
— and I’m hoping to do some brainstorming towards an optimal 
structure/toolchain/workflow, so any thoughts are appreciated.

One of the things I do most often is compose for musical theatre. Because of 
the way that particular industry works, there is a very large and complex set 
of inputs and outputs. I’m hoping to refine my tools and process(es) to give me 
the most flexible output options with the least effort and friction on the 
input side. 

There might be a large number of posts under this “rubric”, but I’ll keep it to 
one question per thread.

So without further ado…


QUESTION #1:

Let’s say I have a song which appears identically in both the “Full Version” 
and “Short Version” of the musical. The number of the song/cue within the show 
might change, but it might not — for example, the opening number would likely 
be #1 in both versions, but the finale could be #25 in the Full version and #17 
in the Short Version. And furthermore, for this specific question, let’s say I 
need to output one file per song (as opposed to a complete score containing the 
whole show).

If I’d prefer not to involve make (or similar extra-Lilypond tools) in my 
solution, is there any way to improve on simply having a single “top-level” 
(score-generating) file structured as follows:

%%  START FILE CONTENTS
\include [.ily files containing the notes, edition-engraver tweaks, etc.]

final_score =
  <<
    [contexts built from variables defined in \include-d files]
  >>

\header {
  [header parameters shared by both versions]
}

\book {
  \bookOutputName "MySong_full"
  \header {
    [header parameters specific to the Full Version, e.g., song number]
  }
  \score { \final_score }
}

\book {
  \bookOutputName "MySong_short"
  \header {
    [header parameters specific to the Short Version, e.g., song number]
  }
  \score { \final_score }
}
%%  END FILE CONTENTS

Is there a more efficient construct where the book name and header variables 
could be “injected” or “conditionalled” in? Or is that just overcomplicating 
this particular problem-space? (n.b., In future questions, the problem-space is 
naturally more complicated without any help from me!)

Thanks,
Kieren.


reply via email to

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