When I work on my LilyPond scores, especially in the end when I just tweak on some graphical settings, it would be quite nice if it was possible to skip the Midi generation, even though it is not very time consuming. Is this possible from the command-line in a similar way then to skip the pdf generation?
Again I have not been able to find something in the LilyPond Documentary section about the Command-Line Options.
Update:
if I had the \midi {}
block only in one line, I could simply comment it out by using sed
from the command-line, with something like: sed -i 's/\\midi\ {}/%&/g' file.ly
. While the option -i
stands for inplace-editing. Without the option sed
is going to print to stdout
. You could also use wildcarts to batch process a bunch of files: *.ly
would process all files ending with .ly
in the current directory.
It would get more difficult, if the \midi
block was bigger then a single line, like here with setting the tempo:
\version "2.18.2"
\score {
<<
\new Staff = "celloI" \with { midiInstrument = #"cello" }
\relative c {
\clef bass
c4( d e f
g1) \bar "|."
}
\new Staff = "celloII" \with { midiInstrument = #"cello" }
\relative c, {
\clef bass
c4( d e f
g1) \bar "|."
}
>>
\layout {}
\midi {
\tempo 2 = 120
}
}
sed
likesed -i 's/\\midi\ {}/%&/g' file.ly
to comment out the\midi
block. Though this would only work if the the block did not have multible lines.