I am trying to make Lilypond create a MIDI output file whose name corresponds song title, but I didn't succeed so far. Maybe someone can help?
From the Lilypond notation reference (https://lilypond.org/doc/v2.20/Documentation/notation/creating-output-file-metadata):
For each type of output file, only the \header definitions of blocks that define separate files of that type, and blocks higher in the block hierarchy, will be consulted. Therefore, [...] for MIDI files, all headers above or at the \score level are used.
Here is my code:
\music = { \relative c'4 d e f}
\bookpart {
\header {
title = "my Title"
}
\score {
\music
\midi { }
}
}
I expected to get a midi file named my Title.midi
, but instead, I get a file whose name is the name of the lilypond file (so if myLilypondFile.ly
, then myLilypondFile.midi
).
From the same source:
The title variable sets also the sequence name for MIDI. The midititle variable can be used to set the sequence name independently of the value used for typeset output.
So I tried adding midititle
to my existing header:
\header {
title = "my Title"
midititle = "my midi Title"
}
but it did not change anything. It seems the midititle
variable isn't even known (I use Frescobaldi and it does not syntax highlight that variable).
My lilypond file is version 2.20.0 and I have also installed GNU lilypond 2.20.0.
myLilypondFile.midi
out ofmyLilypondFile.ly
sounds very reasonable (apart frommyLilypondFile
being a very unhelpful file name). I don't even think Lilypond can put things into arbitrarily named files. Btw. "sequence name" is a name stored within the MIDI. Some MIDI players, like timidity, will show it while playing, some (most?) will not.myLilypondFile.midi
,myLilypondFile-1.midi
,myLilypondFile-2.midi
and so on. But with this, it is hard to find the right file for a certain song.\bookOutputSuffix
(which would change the-1
,-2
etc. to something else -- one use could bemySong-soprano.midi
,mySong-alto.midi
etc.), but the answer below is more universal.