lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: End of file event


From: Maurits Lamers
Subject: Re: End of file event
Date: Thu, 22 Feb 2018 07:44:01 +0100

Hi, 

Thanks for your suggestion! Do I understand from your reply that you don't think there is a dynamic option, ie without adjusting the lilypond code being processed? 

To clarify the context a bit: what I am doing is reviewing homework by students. This means that I am running my reviewer script (lilypond file with embedded guile with event listeners) as a side-load script through the -dinclude-settings option on the lilypond code files they provided.
It is of course possible to preprocess the input files by appending such a scheme call (automatically). If I can have a dynamic option (such as listening to an event), I would rather like to have that option as it reduces the amount of things that can go wrong during processing.

cheers

Maurits


Hi Maurits,


Am 21.02.2018 um 20:52 schrieb Maurits Lamers:
Hi all,

I would like to execute some (embedded scheme) code at the end of an input file, that is after the last score block.

My current problem is that I am parsing score blocks, but some of the input is given as a single score block and the content in other files is put in many score blocks.
During my processing of this content I gather some statistics, and I would like to write them out to a file at the end of the file. In the current solution, I am running the export at the end of the finalize event on a score block, which of course causes the writing of the data to happen at the end of the parsing of every score block.

What would be the best way to only write out the statistics at the end of the file?

Can you somehow create an explicit \book{ } block?
Code after a book block will be executed after the PDF has been completely written, i.e. really after the score has been processed completely. But if you don't write that explicit \book block LilyPond will automatically wrap the whole document in one.

\version "2.19.80"

\book {
  \score {
    \new Staff { c' }
  }
}

#(ly:message "I'm executed after compilation")

You'll see from the log that the message is printed only after the PDF file has been finished.

HTH
Urs


Thanks in advance!

Maurits
_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user





_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

[Prev in Thread] Current Thread [Next in Thread]