lilypond-user
[Top][All Lists]
Advanced

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

Re: Hook like \AtEndDocument


From: Urs Liska
Subject: Re: Hook like \AtEndDocument
Date: Tue, 03 Dec 2013 11:12:50 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

Am 03.12.2013 10:16, schrieb David Kastrup:
Urs Liska <address@hidden> writes:

Hi all,

is there a way to hook into the compilation process that allows me to
do something when all parsing has been done?

Concretely I want to use a Scheme function to collect information
during the parsing (something like a log) and want to output this in
sorted form to an external file.

I see two ways to accompish this:

a) write the log to an internal structure, then at the end sort it and
write it to the file
b) write it to the file immediately and call an external script at the end.

Both approaches (I strongly prefer a) because I'd prefer not to rely
on an external script) would need a trigger (or listener?) that calls
a function when everything has been parsed (or when the whole
compilation process has been finished).
b) could be worked around by wrapping the lilypond call itself into a
script, but as said I'd prefer a) anyway.

Any ideas?
Check out <URL:http://lsr.dsi.unimi.it/LSR/Item?id=630>.

OK, trying to digest this.
Do I get this  right when I say:

- write a function "annotate" to be used in the main input file.
This function saves some information (say location plus a comment) to an internal
  structure that is defined public.
- use this function in the input files to annotate items in the score
- write another function "process-annotations".
  This function uses the technique described in the snippet to make a new
score from itself which will then be processed after the current score has been finished. This new score contains a function that can read the data from the previously defined
  data structure from the original "annotate" function.
(Or alternatively this new score doesn't do more than calling an external script when "annotate" would have written everything to a temporary file immediately.)
?

Urs




reply via email to

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