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

2024-01-27 Thread Kieren MacMillan
 Hi Sam,

Thanks for these thoughts!

> I'm not sure if this fits under your umbrella of having a single top level 
> file, but what about this?
> 
>  song-FV.ly
> definedVariables = data
> \include song.ily
> 
>  song-SV.ly
> definedVariables = data
> \include song.ily
> 
>  song.ily
> \include [.ily files containing the notes, edition-engraver tweaks, etc.]

Different versions will share some tweaks and also have individual/unshared 
tweaks, so I can’t quite tell yet whether this structure would be sufficient 
(never mind optimal).

> \header {
>   [header parameters shared by both versions]
>   [differing header parameters defined in global variables]
> }
> 
> \score {
>   [contexts built from variables defined in \include-d files]
> }
> 
> 
> Optionally, you could use the output names and book blocks so that you can 
> compile the whole work from a FullVersion.ly and ShortVersion.ly which are 
> basically a series of includes of the applicable songs.

The full book (e.g. “Piano/Conductor Score” will definitely be a series of 
includes of applicable songs. I’m trying to figure out how to structure all 
this with the least amount of duplication (in note code, tweak code, and score 
code).

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




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

2024-01-23 Thread Sam Speer
Kieren,

I'm not sure if this fits under your umbrella of having a single top level
file, but what about this?

 song-FV.ly
definedVariables = data
\include song.ily

 song-SV.ly
definedVariables = data
\include song.ily

 song.ily
\include [.ily files containing the notes, edition-engraver tweaks, etc.]

\header {
  [header parameters shared by both versions]
  [differing header parameters defined in global variables]
}

\score {
  [contexts built from variables defined in \include-d files]
}


Optionally, you could use the output names and book blocks so that you can
compile the whole work from a FullVersion.ly and ShortVersion.ly which are
basically a series of includes of the applicable songs.

Hope some of these ideas help or at least spark others,
Sam


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

2024-01-23 Thread Kieren MacMillan
Hi Timothy,

> How about setting up some Scheme variables that are later used to build 
> variants of the score?

OOO I like this!

There are some further complications coming up that might render this 
unfeasible/impractical… but it’s a great suggestion, and I can definitely see 
where to use it in some of my less complex and/or complicated projects and 
workflows.

Thanks!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




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

2024-01-23 Thread Timothy Lanfear


On 22/01/2024 19:09, Kieren MacMillan wrote:

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.


How about setting up some Scheme variables that are later used to build 
variants of the score?


\version "2.24.2"

#(define variant 'full)
% or #(define variant 'short)

#(define bookname (format #f "MyScore_~a" variant))
#(define N (if (eq? variant 'full) 10 5))

notes = { c'4 d' e' f' }

final_score =
  <<
    \new Staff \notes
  >>

\header {
  composer = "Kieren MacMillan"
}

\book {
  \bookOutputName \bookname
  \header {
    title = #(format #f "~a. Song" N)
  }
  \score { \final_score }
}

--
Timothy Lanfear, Bristol, UK.


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

2024-01-22 Thread Kieren MacMillan
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.