3

Question (solutions below)

With version 2.24 there seems to be no more lilypond-windows.exe, which (without having to know details) did create PDFs, and/or in case of errors log-files.

Now, using v2.24, I have to link .ly-files to lilypond.exe. which works fine, even by doubleclicking .ly-files, but only if these files do not contain fatal errors. Otherwise all error messages disappear together with the command-line that appears for a split second, and no other output is generated. I would create a decent command with options for that, but the documentation on command line usage seem to be meant for Liunx users only since several options I tried in command line are answered with error messages.

lilypond --log-file [...] -> unrecognized option --log-file

lilypond -log-file [...] -> unknown log-level og-file (which I understand)

lilypond file.ly &>all.log -> "syntax error"

I don't use Frescobaldi as in the installation guide, for now I wanted to keep going with Notepad++ and use only the lilypond framework as I did before.

I'm not sure, if this part of Stack Exchange is the appropriate one, but my experience shows, that there are a lot of you knowing much more than just the basic usage of lilypond. I'd appreciate any help.

Possible solutions

1. using the answer from @Lazy I wrote a batch file lily.bat you can drag your .ly-file on, and which does the following:

  • change to my Lilypond directory
  • execute lilypond with generating a log file in the folder of the .ly-file
  • move the generated music-sheet PDF (if it exists) from the lilypond folder to the folder of the .ly-file
G:
cd "\Lilypond 2.24.0\bin"
lilypond.exe %1 1>"%~dpn1".log 2>&1
if exist "%~n1".pdf ( move "%~n1".pdf "%~dpn1".pdf )

2. using the answer from @ABOU SAMRA Jean I made a shortcut from lilypond.exe, you can drag your .ly-file on.

  • In the shortcut-properties I specified the target as "G:\Lilypond 2.24.0\bin\lilypond.exe" -dlog-file=out"
  • In the field Start in I simply put %cd%

This generates the music-sheet PDF and a log file in the folder of the .ly-file. Unfortunately, for the log-file's name I (due to a pure lack of knowledge) cannot use the name from the .ly-file. If anyone knows how, I gladly edit this section again.

2
  • 1
    The expansion flags can be combined, you don't need to write "%~d1%~p1%~n1", only %~dpn1.
    – ksnortum
    Feb 11, 2023 at 17:42
  • @ksnortum Thanks, did not know that. I edited my post.
    – Peder
    Feb 11, 2023 at 17:55

2 Answers 2

5

The log-file option is documented here: https://lilypond.org/doc/v2.24/Documentation/usage/command_002dline-usage.html#advanced-command-line-options-for-lilypond. As explained at the beginning of that section, the correct syntax is

lilypond -dlog-file=x file.ly
2
  • Thank you! This is a line that can be used in windows shortcuts and is therefore my favourite method. It still isn't perfect, but nevertheless my favourite solution. (Details in my initial questions - I added your answer as a possible solution to my question)
    – Peder
    Feb 11, 2023 at 13:38
  • Just as an explanation: Both answers are equally usable and I had a hard time to decide which answer should be "the one". But since I seem to be using this solution now, I vote for this one. No other reason.
    – Peder
    Feb 12, 2023 at 15:02
3

lilypond.exe file.ly 1>all.log 2>&1 should do it I believe.

3
  • Does Windows recognize that syntax? That's something that would work in bash or other Unix shells, but I wouldn't expect it to work in Windows.
    – Ramillies
    Feb 11, 2023 at 10:17
  • @Ramillies Yes, it does.
    – Lazy
    Feb 11, 2023 at 11:44
  • This works and I used it in a batch file (.ly-file can be drag&dropped). I added this as a possible solution to my initial question. Thank you!
    – Peder
    Feb 11, 2023 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.