]> git.donarmstrong.com Git - lilypond.git/blob - input/test/polymetric-differing-notes.ly
* scripts/convert-ly.py (conv): remove \notes.
[lilypond.git] / input / test / polymetric-differing-notes.ly
1 \version "2.3.4"
2
3 \header{ texidoc="
4
5 @cindex polymetric music
6
7 @cindex scaling durations
8
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.
15
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.
20
21 "
22
23 }
24
25 #(define ((scale-music-function fraction) x)
26   (ly:music-compress x (ly:make-moment (car fraction) (cdr fraction))))
27
28
29
30
31 \score {
32      \relative c'  <<
33         \new Staff {
34             \time 3/4
35             c4 c c | c c c |
36         }
37         \new Staff {
38             \time 3/4
39             \set Staff.timeSignatureFraction = #'(9 . 8)
40             \applymusic #(scale-music-function '(2 . 3))
41               \repeat unfold 6 { c8[ c c] }
42         }
43         
44         \new Staff {
45             \time 3/4
46             \set Staff.timeSignatureFraction = #'(10 . 8)
47             \applymusic #(scale-music-function '(3 . 5))
48               { \repeat unfold 2 { c8[ c c] }
49                 \repeat unfold 2 { c8[  c] }
50                 |  c4. c4. \times 2/3 { c8 c c } c4  }
51         }
52         >>
53         \paper { raggedright = ##t }
54 }