Am 02.02.24 um 01:35 schrieb Leo Correia de Verdier:
If you want to avoid some of the jiggery pokery you could do something like:
%%%%%%%%%%%%%%%%%%%%
\version "2.25.12"

#(define ((time-alternate-time upa downa upb downb) grob)
    (grob-interpret-markup grob
                           (markup #:override '(baseline-skip . 0) #:number
                                   (#:line (
                                             (#:center-column (upa downa))
                                             (#:center-column (upb downb)))))))

global = {
   \override Score.TimeSignature.stencil =
   #(time-alternate-time "6" "8" "3" "4")
   \time 6/8 s2.
   \omit Score.TimeSignature
   \repeat unfold 5 {
     \time 3/4
     \set Timing.beamExceptions = #'() %so 3/4 isn't beamed in whole measures
     s2.
     \time 6/8 s2.
}}

\score {
   \new Staff <<
     \global
     { \repeat unfold 66 a'8 }
   >>
}
%%%%%%%%%%%%%%%%%%%%%%%%%

... and without any new insight, but with a healthy dose of syntactic sugar:

\version "2.25.9"

#(define-markup-command (timeSignature layout props fraction) (fraction?)
   (interpret-markup layout props
                     (markup #:override '(baseline-skip . 0)
                             #:number
                             #:center-column ((number->string (car
fraction))
                                              (number->string (cdr
fraction))))))


alternateTime =
#(define-music-function (one two) (fraction? fraction?)
   #{
     \once \override Timing.TimeSignature.stencil =
#ly:text-interface::print
     \once \override Timing.TimeSignature.text =
     \markup \line { \timeSignature #one \timeSignature #two }
     \time #one
   #})

secretTime = \tweak TimeSignature.stencil #f \time \etc

global = {
  \alternateTime 6/8 3/4
  s2.
  \repeat unfold 5 {
    \secretTime 3/4
    \set Timing.beamExceptions = #'()
    s2.
    \secretTime 6/8 s2.
  }
}

\new Staff
<<
  \global
  { \repeat unfold 66 a'8 }
>>

Lukas


Reply via email to