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: David Kastrup
Subject: Re: compound timesig in all staves?
Date: Thu, 29 May 2014 22:03:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Orm Finnendahl <address@hidden> writes:

> 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?
>
> --
> Orm
>
> \version "2.19.5"
>
> \relative c' {
>   << 
>     \new Staff = "timesigs" {
>        \compoundMeter #'((3 2 4)) 
>        \repeat unfold 10 s4 }
>     \new Staff { \repeat unfold 10 c4 }    
>     \new Staff { \repeat unfold 10 c4 }    
>   >>
> }

The definition of compoundMeter is

compoundMeter =
#(define-music-function (parser location args) (pair?)
  (_i "Create compound time signatures. The argument is a Scheme list of
lists. Each list describes one fraction, with the last entry being the
denominator, while the first entries describe the summands in the
enumerator. If the time signature consists of just one fraction,
the list can be given directly, i.e. not as a list containing a single list.
For example, a time signature of (3+1)/8 + 2/4 would be created as
@code{\\compoundMeter #'((3 1 8) (2 4))}, and a time signature of (3+2)/8
as @code{\\compoundMeter #'((3 2 8))} or shorter
@code{\\compoundMeter #'(3 2 8)}.")
  (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 Staff.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
  #} ))

I think the \override Staff.TimeSignature.stencil bit should rather be
\override Timing.TimeDignature.stencil instead.  You can copy and fix
this definition locally, but it's likely worth fixing in LilyPond itself
as well.

-- 
David Kastrup



reply via email to

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