File: polymetric-differing-notes.ly

package info (click to toggle)
lilypond 2.2.6-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 11,260 kB
  • ctags: 7,622
  • sloc: cpp: 47,787; lisp: 11,217; python: 11,203; sh: 3,290; yacc: 2,011; lex: 831; perl: 373; ansic: 309; makefile: 132; csh: 8
file content (54 lines) | stat: -rw-r--r-- 1,442 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
\version "2.2.0"

\header{ texidoc="

@cindex polymetric music

@cindex scaling durations

It is possible to have multiple time signatures, each one in an own staffs, 
at the same time, and have even a proper vertical alignment of the different 
durations.  This is done, firstly, by setting a common time signature for
each staff but replacing it manually using @code{timeSignatureFraction} to 
the desired fraction, and secondly, by scaling the printed durations to
the actual, polymetric durations.

In this example, music with the time signatures of 3/4, 9/8 and 10/8 are
used in parallel. In the second staff, shown durations are multiplied by 
2/3, so that 2/3 * 9/8 = 3/4, and in the third staff, shown durations are 
multiplied by 3/5, so that 3/5 * 10/8 = 3/4.

"

}

#(define ((scale-music-function fraction) x)
  (ly:music-compress x (ly:make-moment (car fraction) (cdr fraction))))




\score {
    \notes \relative c'  <<
    	\new Staff {
	    \time 3/4
	    c4 c c | c c c |
	}
    	\new Staff {
	    \time 3/4
	    \set Staff.timeSignatureFraction = #'(9 . 8)
	    \apply #(scale-music-function '(2 . 3))
	      \repeat unfold 6 { c8[ c c] }
	}
	
    	\new Staff {
	    \time 3/4
	    \set Staff.timeSignatureFraction = #'(10 . 8)
	    \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 }
}