lilypond-user
[Top][All Lists]
Advanced

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

Re: multiple time signatures


From: Han-Wen Nienhuys
Subject: Re: multiple time signatures
Date: Sat, 26 Jul 2003 16:01:28 +0200

address@hidden writes:
> On Fri, 25 Jul 2003 21:14:39 -0500, "David Hughes" wrote:
> > 
> > Is LilyPond able to create multiple time signatures occurring
> > at the same time on separate staves?
> 
> I have a similar problem that I've come close to solving.

the following example (which might work on 1.6 too, if
you strip some of the ly: prefixes) puts 3/4, 9/8 and 10/8
aligned per measure:







#(define (scale-one-music m fraction)
  "Maybe we should just export Music::compress to Scheme?"
  (let*
   ((dur (ly:get-mus-property m 'duration)))
   
   (if (ly:duration? dur)
    (let*
     ((l (ly:duration-log dur))
      (d (ly:duration-dot-count dur))
      (factor (ly:duration-factor dur)))

      (ly:set-mus-property! m 'duration
                            (ly:make-duration l d
                             (* (car fraction) (car factor))
                             (* (cdr fraction) (cdr factor))))))
   
   m))

#(define (scale-music-function fraction)
  (lambda (x) 
   (music-map (lambda (y) (scale-one-music y fraction)) x)))



\score {
    \notes \relative c'  <
        \context Staff= AS {
            \time 3/4
            c4 c c | c c c |
        }
        \context Staff= BS {
            \time 3/4
            \property Staff.timeSignatureFraction= #'(9 . 8)
            \apply #display-music \apply #(scale-music-function '(2 . 3))
              \repeat unfold 6 { c8-[ c c-] }
        }
        
        \context Staff= DS {
            \time 3/4
            \property Staff.timeSignatureFraction= #'(10 . 8)
            \apply #display-music \apply #(scale-music-function '(3 . 5))
              { \repeat unfold 2 { c8-[ c c-] }
                \repeat unfold 2 { c8-[  c-] }
                |  c4. c4. \times 2/3 { c8 c c } c4  }
        }
        } >
        \paper { raggedright = ##t }
}


-- 

Han-Wen Nienhuys   |   address@hidden   |   http://www.xs4all.nl/~hanwen 




reply via email to

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