On Tue, Jun 27, 2023 at 2:35 AM Valentin Petzel <[email protected]> wrote:

> Hello Knute,
>
> I do not think this behaviour is particularly weird, rather the input is
> weird.
>

Thanks for your replies.  Here is my slightly convoluted use-case.  Maybe
there's a better way to do it.

I am engraving collections of pieces, such as Bach's 15 two-part
inventions.  I want to be able to create a "book" with all the pieces in
one PDF, but also to be able to print each piece individually.  And I want
to be able to tweak the MIDI output, so I use \keepWithTag to do that.  So
I have an "include" file something like this:

inventionOneMusic =
\score {
  \keepWithTag layout
  % Notes
  \layout {}
}

inventionOneMidi =
\score {
  \keepWithTag midi
  % Notes
  \midi {}
}

So now I can have a file called "invention-one.ly" that looks like this:

\inventionOneMusic
\inventionOneMidi

...and another that is the "book" called "15-two-part-inventions.ly" like
this:

\inventionOneMusic
\inventionTwoMusic
% etc

\inventionOneMidi
\inventionTwoMidi
% etc

But now there's a problem.  I want one PDF but also the individual MIDI
files named correctly.  As it stands I get files named like this:

15-two-part-inventions.pdf
15-two-part-inventions.midi
15-two-part-inventions-1.midi
etc

It's hard to tell which MIDI file belongs to which invention.  What I want
is:

15-two-part-inventions.pdf
invention-one.midi
invention-two.midi
etc

The only way I could think of doing that is to wrap the MIDI score in a
book and use \bookoutputFile:

inventionOneMidi =
\book {
  \bookOutputFile "invention-one"
  \score {
    \keepWithTag midi
    % Notes
    \midi {}
  }
}

So that's my use-case.  Maybe that isn't the best solution and one of you
can come up with a better one.  Thanks for reading this long post.

Reply via email to