lilypond-user
[Top][All Lists]
Advanced

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

Re: problem with compound meter


From: Stefan Thomas
Subject: Re: problem with compound meter
Date: Sun, 9 Oct 2011 11:08:24 +0200

Dear Colin,
Your suggestion could be quite good, but in my case it is not the ideal solution.
I have a larger score with frenched staves.
The global variable is part of a TimeSig context and I expcted, that (like with normal time-signatures) the compound meters are would be valid for all staves.
But in music-functions-init.ly I've found the key to my solution:

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 Score.TimeSignature #'stencil = #(lambda (grob) % I've changed the context from Staff to Score!
        (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
  #} ))


On 11-10-08 09:13 AM, Stefan Thomas wrote:
> Dear community,
> I have a problem with the compoundMeter command.
> In the below quoted snippet the compound meter is displayed only in
> the very high staff, but not in the following one!
>
> \version "2.14.1"
> global= { \compoundMeter #'((1 4) (5 16)) s4 s16*5  }
> UPstaff = { c' 16 d' e' f' g' a' b' c'' d'' }
> Downstaff = { c'' b' a' g' f' e' d' c' b }
>
> \score {
> <<
>     \new Staff { \context Voice << {\global} {\UPstaff }>> }
>     \new Staff { \Downstaff }
> >>
> }
>


You have your meter defined in a variable, but you don't connect it to
your music.  If you put it inside the music variables, you'll be fine:

\version "2.14.1"

global= { \compoundMeter #'((1 4) (5 16)) s4 s16*5 }

UPstaff = { \global c' 16 d' e' f' g' a' b' c'' d'' }

Downstaff = { \global c'' b' a' g' f' e' d' c' b }

\score {

<<

\new Staff { \UPstaff }

\new Staff { \Downstaff }

reply via email to

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