|
From: | Urs Liska |
Subject: | Re: end of file event |
Date: | Thu, 22 Feb 2018 00:18:45 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |