Thank you Neil,

now I created the following time-signature engraver:
--snip--
\version "2.14.2"

#(define-public orff (lambda (context)
          (let ((time-signature '())
                (last-fraction #f))

               `((process-music
                  . ,(lambda (trans)
(let ((frac (ly:context-property context 'timeSignatureFraction)))
                               (if (and (null? time-signature)
                                        (not (equal? last-fraction frac))
                                        (pair? frac))
                                   (begin
(set! time-signature (ly:engraver-make-grob trans 'TimeSignature '())) (set! (ly:grob-property time-signature 'fraction) frac) (set! (ly:grob-property time-signature 'stencil) ly:text-interface::print) (set! (ly:grob-property time-signature 'text) (markup #:translate '(0 . 2) #:concat ( #:bold (format "~a " (car frac)) #:translate '(-2 . -2) #:draw-line '(3 . 3) #:translate '(-2 . -3.5) #:smaller #:smaller #:note (format "~a" (cdr frac)) UP)
                                     ))

                                     (and (not last-fraction)
(set! (ly:grob-property time-signature 'break-visibility) (ly:context-property context 'implicitTimeSignatureVisibility)))

                                     (set! last-fraction frac))))))

                (stop-translation-timestep
                  . ,(lambda (trans)
                          (set! time-signature '()))))
)))

meta = {
  \key bes \major \time 3/4 s2.*2
  \key a \minor \time 5/8 s8*5
  \key bes \major \time 3/4 s2.*2
}

mel = \relative c'' {
a8 bes c d c d | a bes c d c d | a c d c d | ees d c bes a bes | ees d c bes a bes |
}

\score {
  \new StaffGroup <<
    \new Dynamics \with {
      \consists \orff
      \override TimeSignature #'extra-offset = #'(-1 . 0)
    } { \meta }
    \new Staff \with {
      \remove "Time_signature_engraver"
    } <<
      \meta
      \new Voice = "mel" { \mel } >> >> % e-mail-compatible line breaks ;-)
}
--snip--

I will optimize and use overrides for this engraver - the markup is a first shot. If I have time and/or a need, I will look for another context than Dynamics.

Cheers,
Jan-Peter

Am 13.08.2011 16:31, schrieb Neil Puttock:
On 13 August 2011 10:27, Jan-Peter Voigt<jp.vo...@gmx.de>  wrote:

So my question is: How do I catch the right event and get the time sig probs to 
display?
There's no event* for time signatures; they're generated when certain
context properties change.

See the scheme engraver I posted here for an idea:

http://lists.gnu.org/archive/html/lilypond-user/2011-05/msg00468.html

* there is a music object (TimeSignatureMusic), but that's only used
for iteration so the relevant settings are accessible by
\displayLilyMusic

Cheers,
Neil



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

Reply via email to