lilypond-user
[Top][All Lists]
Advanced

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

Re: compound timesig in all staves?


From: Thomas Morley
Subject: Re: compound timesig in all staves?
Date: Thu, 29 May 2014 22:00:16 +0200

2014-05-29 21:16 GMT+02:00 Orm Finnendahl <address@hidden>:
> Hi,
>
>  in the following example, the compound timesignature is only shown on
> the top staff. Is there a mechanism to show it in all staffs with the
> "2+3/4" without wxplicitely having to restate the compundMeter
> statement in each staff?
[...]

'compoundMeter' uses
\once \override Staff.TimeSignature.stencil = ...
to explecitely limit the stemcil-override to current Staff. Otherwise
the following code would return wrong output:

\score {
  \relative c' <<
    \new Staff {
      \compoundMeter #'((3 2 4))
      c4 c c c c
      c4 c c c c
    }
    \new Staff {
      \time 6/8
      \repeat unfold 4 {
      c4.
      }
      \time 4/4
      c2 c
    }
  >>
  \layout {
    \context {
      \Score
      \remove "Timing_translator"
      \remove "Default_bar_line_engraver"
    }
    \context {
      \Staff
      \consists "Timing_translator"
      \consists "Default_bar_line_engraver"
    }
  }
}

OTOH, it's possible to redefine 'compoundMeter':

compoundMeter =
#(define-music-function (parser location ctx args) ((string? "Staff") pair?)
  (let* ((mlen (calculate-compound-measure-length args))
         (beat (calculate-compound-base-beat args))
         (beatGrouping (calculate-compound-beat-grouping args))
         (timesig (cons (ly:moment-main-numerator mlen)
                        (ly:moment-main-denominator mlen))))
  #{
    \once \override $ctx .TimeSignature.stencil = #(lambda (grob)
      (grob-interpret-markup grob (format-compound-time args)))
    \set Timing.timeSignatureFraction = #timesig
    \set Timing.baseMoment = #beat
    \set Timing.beatStructure = #beatGrouping
    \set Timing.beamExceptions = #'()
    \set Timing.measureLength = #mlen
  #} ))


Now \compoundMeter #'((3 2 4)) is limited to current Staff, whereas
\compoundMeter Score #'((3 2 4)) is applied to the whole Score.


HTH,
  Harm



reply via email to

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