[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
When (in seconds) does each page begin?
From: |
Matt Wallis |
Subject: |
When (in seconds) does each page begin? |
Date: |
Thu, 28 May 2020 17:24:49 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 |
I would like to obtain timing information to tell me at how many seconds
into the score each page begins. I have had a go at this, and failed. So
I'm now looking for answers to two questions:
1. How to obtain this output from lilypond (e.g. a file listing the
number of seconds into the score at which each page begins.), and
2. Why does my attempt (see below) not work? I'm new to this type of
deeper digging into lilypond, and I hope to learn from my mistakes.
What have I tried so far?
I guessed that the page-break-event might occur at the times of interest
to me.
Looking at
http://lilypond.org/doc/v2.19/Documentation/notation/saving-music-events-to-a-file,
I modified event-listener.ly in an attempt to catch the
page-break-event, like so:
----
% New function to handle the event:
#(define (format-page engraver event)
(print-line engraver
"page"))
% add a listener for the event:
#(define event-listener-engraver
(make-engraver
(listeners
(page-break-event . format-page)
(tempo-change-event . format-tempo)
(rest-event . format-rest)
etc ...
----
This didn't produce the output I was looking for (no 'page' in the
generated .notes files)
So I wondered (just guessing) if I needed to change the context to which
event-listener-engraver was being added, do I changed that as follows:
----
\layout {
\context {
%\Voice %% try a broader context :Score:
\Score
\consists #event-listener-engraver
}
}
----
No joy.
My final hack was to add handling for the line-break-event and
page-turn-event. Again no joy.
I am out of my depth. Have I perhaps just exposed the fact that I don't
properly understand the interplay between events, contexts and
engravers? Is there some difference between the page-break-event and the
the events that are properly handled by event-listener.ly ?
Matt
- When (in seconds) does each page begin?,
Matt Wallis <=