[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Output to single PDF and multiple MIDI files
From: |
Jérôme Plût |
Subject: |
Output to single PDF and multiple MIDI files |
Date: |
Thu, 20 Jul 2017 23:40:25 +0200 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
I am typesetting a multi-movement work. I want the paper output to be
in a single file (say work.pdf) and the MIDI output to be in separate
files (work-1.pdf, work-2.pdf). Is there a simple and local way to do
this?
I can do it in a not-simple-enough way:
first = \relative { c'4 c c c }
second = \relative { c'4 d e f }
\book {
\score { \new Staff << \first >> }
\score { \new Staff << \second >> } % here
}
\book { \bookOutputSuffix "1"
\score { \new Staff << \first >> \midi { } } }
\book { \bookOutputSuffix "2"
\score { \new Staff << \second >> \midi { } } } % and here
However, this is not *local*. What I mean is that if I want to comment
out, say, the second movement (for a test run), I need to comment two
places at once (marked “here” “and here” in the source above). For
consistency and efficiency, I want all lines relating to a single
movement to be grouped together. Besides, I also have some reasons to
want to group the source of the music with the \score commands; my
preferred file structure would be:
% first movement
music = \relative { ... }
\score { ... } % paper output to work.pdf
\score { ... } % MIDI output to work-1.midi
% second movement
music = \relative { ... }
\score { ... } % paper output appended to work.pdf
\score { ... } % MIDI output to work-2.midi
I also tried a variant, resetting the name of the book:
\book { \bookOutputName "work" \score { \new Staff << \first >> } }
\book { \bookOutputName "work" \score { \new Staff << \second >> } }
There would be two consistent ways to act here: the second score
could either overwrite the first one or add some extra pages.
(Concatenation would be more useful, obviously). However lilypond
chooses a bizarre third option: the code above produces two files
named work.pdf and work-1.pdf .
Does this problem have any solution?
Thanks,
--
Jérôme Plût
- Output to single PDF and multiple MIDI files,
Jérôme Plût <=