5 @cindex polymetric music
7 @cindex scaling durations
9 It is possible to have multiple time signatures, each one in an own staffs,
10 at the same time, and have even a proper vertical alignment of the different
11 durations. This is done, firstly, by setting a common time signature for
12 each staff but replacing it manually using @code{timeSignatureFraction} to
13 the desired fraction, and secondly, by scaling the printed durations to
14 the actual, polymetric durations.
16 In this example, music with the time signatures of 3/4, 9/8 and 10/8 are
17 used in parallel. In the second staff, shown durations are multiplied by
18 2/3, so that 2/3 * 9/8 = 3/4, and in the third staff, shown durations are
19 multiplied by 3/5, so that 3/5 * 10/8 = 3/4.
26 #(define (scale-one-music m fraction)
27 "Maybe we should just export Music::compress to Scheme?"
29 ((dur (ly:music-property m 'duration)))
31 (if (ly:duration? dur)
33 ((l (ly:duration-log dur))
34 (d (ly:duration-dot-count dur))
35 (factor (ly:duration-factor dur)))
37 (ly:music-set-property! m 'duration
39 (* (car fraction) (car factor))
40 (* (cdr fraction) (cdr factor))))))
44 #(define (scale-music-function fraction)
46 (music-map (lambda (y) (scale-one-music y fraction)) x)))
51 \notes \relative c' <<
58 \set Staff.timeSignatureFraction = #'(9 . 8)
59 \apply #display-music \apply #(scale-music-function '(2 . 3))
60 \repeat unfold 6 { c8[ c c] }
65 \set Staff.timeSignatureFraction = #'(10 . 8)
66 \apply #display-music \apply #(scale-music-function '(3 . 5))
67 { \repeat unfold 2 { c8[ c c] }
68 \repeat unfold 2 { c8[ c] }
69 | c4. c4. \times 2/3 { c8 c c } c4 }
72 \paper { raggedright = ##t }