5

I am using LilyPond with Frescobaldi editor. It sometimes happens that Frescobaldi stops working, that is: If I change something in the .ly file (e.g. some string) and hit the Lilypond button (or press CTRL+M), nothing happens. The preview does not update, and no files are generated/updated.

I use:

  • Linux Mint 20.2 Cinnamon, Version 5.0.5, Linux Kernel 5.4.0-80-generic.
  • GNU LilyPond 2.20.0.
  • Frescobaldi Version 3.0.0.

Until now I managed to get rid of this problem by closing and reopening Frescobaldi, but it does not help any more. I even removed and reinstalled Frescobaldi, restarted my computer, removed the config file... but nothing helps. Frescobaldi just does not work anymore.

Any ideas what I can do to make it work again?

If not, I'd already be happy if someone can give a clue to what is going on here. Currently, this is just (evil) magic to me...


Here is a simple example LilyPond file newFile.ly:

\version "2.20.0"

title = "title"
music = { \relative { c' d e f g } }

\bookpart {
  \header {
    title = \title
  }
  \score {
    \music
    \layout { }
  }
}

If I run lilypond newFile.ly in the console, I get the following output in the console:

GNU LilyPond 2.20.0
Processing `newFile.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `/tmp/lilypond-NKnbRf'...
Converting to `newFile.pdf'...
Deleting `/tmp/lilypond-NKnbRf'...
Success: compilation successfully completed

A pdf is generated (or overwritten if already present).

If I open newFile.ly in Frescobaldi, change the string value of title to "title2", save and then press CTRL+M, I get this:

enter image description here

No preview window is opened, no pdf is generated, and the Lilypond log inside Frescobaldi is suspiciously short: it contains only three entries (Processing, Parsing, Success), unlike the Lilypond log in the console after a direct lilypond call.

Before Frescobaldi stopped working, I always got a long log just like when using lilypond in the console.

I wonder: If Frescobaldi merely calls lilypond under the hood, why are all the other steps (Interpreting, Preprocessing, ...) omitted? And why were they not omitted before (when Frescobaldi still worked)?

0

2 Answers 2

4

I found the answer for the current "broken-ness":

If there is a file init.ly inside the folder of the main file (main file = the one to be compiled), console lilypond doesn't mind but Frescobaldi can't cope with it and will behave as described in the question. Even if that init.ly file isn't even \included anywhere!

I guess this is worth a Frescobaldi bug report. Anyone who wants to do that - go ahead!


How did that happen?

I use \include, and I named one of the included files (which consists solely of variable assignments) init.ly. Didn't know that was a bad name choice. I went on working on my main file, and after I added the \include "init.ly" statement and compiled with console lilypond, the error message there

/usr/share/lilypond/2.20.0/ly/init.ly:43:1: error: \maininput not allowed outside init files

made me suspicious, so I renamed my init.ly file and voila, Frescobaldi was back to normal.

0

I don't think this is a Frescobaldi problem but a misunderstanding about LilyPond include files and Frescobaldi's include paths (Edit -> Preferences -> LilyPond Preferences tab at the bottom).

There already is a file called init.ly in LilyPond. Depending on how your include paths are setup, you may get this file or the file you created. If you get LilyPond's init.ly file, then things go haywire.

Notice your error message:

/usr/share/lilypond/2.20.0/ly/init.ly:43:1: error: \maininput not allowed outside init files

See that you are including LilyPond's init.ly file, not yours. If you include the full path of the file, the problem goes away:

include "/full/path/to/your/init.ly"
5
  • If I have a file of a certain name X in the same folder as the file that I'm compiling (and I'm NOT including X in the main file!), and I use lilypond compiler, there is no problem at all. It just does not matter that X is there. That is, in my opinion, the correct behaviour. Frescobaldi on the other hand DOES care about the presence of X: It simply does not compile. How can this not be a Frescobaldi issue?
    – Kjara
    Commented Oct 4, 2021 at 18:15
  • Well, the comments of StackExchange are too small for me you post examples. The long and the short of it is, I don't get the behavior you're seeing with my test files. Why don't we pickup the conversation on the Frescobaldi discussion group?
    – ksnortum
    Commented Oct 4, 2021 at 22:25
  • I created a post in the Frescobaldi discussion group here that explains what I did. You may be asked to formal join the group -- it's been so long since I first posted there I forget.
    – ksnortum
    Commented Oct 4, 2021 at 23:02
  • Don't want to join google groups, sorry. But you didn't do what I did. Here's what you should check: Create foo.ly file without any includes. It should be compilable (i.e. have no errors). Create init.ly file in the same folder. It can contain anything you want, or stay empty. Then compile foo.ly with command line lilypond. There shouldn't be any issues. Now open foo.ly in Frescobaldi and compile from there. Does it compile and generate pdf? Or do you only get the short log of just three entries (Processing, Parsing, Success)? If the latter, then you have reproduced my issue.
    – Kjara
    Commented Oct 5, 2021 at 18:07
  • Following your instructions, I get no errors with LilyPond at the command line nor with Frescobaldi.
    – ksnortum
    Commented Oct 7, 2021 at 16:22

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.