... OK, now I found it!
It is a matter of order: If the edition-engraver is consisted before the
Timing the timing-information is not updated and so the last reported
timestep is used in the start-translation-timestep slot of the engraver.
A lot of the mods are applied in that stage of translation.
So if you move the timing engravers *before* consisting the EE, the mods
are applied at the right timestep.
I don't know, if it is possible to change the order of
engravers/translators after they have been consisted. But I hope this
info helps for now.
Jan-Peter
Am 22.08.2017 um 11:06 schrieb Jan-Peter Voigt:
Hi Kieren,
the issue is not fixed (yet), but I found a hint. The EE uses the
context-properties currentBarNumber and measurePosition to collect
current mods from the tree. Somehow these values are laid back inside
the EE code so they report the preceding moment when the Timing is moved
away from the Score context.
I have to build a MWE to expose the bug and to solve it.
Jan-Peter
Am 16.08.2017 um 15:55 schrieb Kieren MacMillan:
Hi David,
I'll try it in my "real-world" score and report back.
Here is a screenshot of a portion of my current engraving:
As you can see, the second staff is [correctly] displaying 36@0, and
the third staff is [correctly] displaying 35@1/4.
*HOWEVER*: the edition-engraver tweak required to color the notes in
the PianoStaff had to be set at 35@1/8 [!!] in order to correctly
start at the moment which is obviously 35@1/4. I feel certain this is
a flaw in the edition-engraver, and not with your
Current_moment_engraver code — I'm hoping your Current_moment_engraver
code [found two messages earlier in this thread] might help Jan-Peter
fix the edition-engraver (ASAP!) so that it correctly targets moments
in polymetric scores.
Many thanks,
Kieren.
________________________________
Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info <http://www.kierenmacmillan.info>
‣ email: i...@kierenmacmillan.info <mailto:i...@kierenmacmillan.info>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
\version "2.19.65"
\include "oll-core/package.ily"
\loadPackage edition-engraver
#(define (moment->string mom)
(if (zero? (ly:moment-grace mom))
(number->string (ly:moment-main mom))
(format "~sG~a" (ly:moment-main mom) (ly:moment-grace mom))))
Current_moment_engraver =
#(make-engraver
(acknowledgers
((text-script-interface self grob origin)
(let ((ctx (ly:translator-context self)))
(if (equal? (ly:grob-property grob 'text) "@")
(set! (ly:grob-property grob 'text)
#{ \markup \with-color #red
#(format "~a@~a" (ly:context-property ctx 'currentBarNumber)
(moment->string (ly:context-property ctx 'measurePosition))) #}))))))
#(ly:register-translator
Current_moment_engraver 'Current_moment_engraver
'((description . "\
This engraver replaces text scripts with a text of @code{@@} with
a red currentBarNumber@measurePosition indicator.")))
% first move the Timing_translator
\layout {
\context {
\Score
\remove "Timing_translator"
\remove "Default_bar_line_engraver"
}
\context {
\Staff
\consists "Timing_translator"
\consists "Default_bar_line_engraver"
}
}
% consist the edition engraver after/behind the timing_translator
\consistToContexts #edition-engraver Staff
\addEdition test
\editionMod test 1 1/16 Staff \once \override NoteHead.color = #red
\new Staff \with { \consists "Current_moment_engraver" }
\relative c' { c16 d-"@" f g a c d e }
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user