-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmary.py
53 lines (41 loc) · 1.45 KB
/
mary.py
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
from note_util import transpose, GANote
M = [0, 4, 7]
root_c = 72
C = transpose(M, root_c)
F = transpose(M, root_c + 5)
chord_progression = [
F, F, C, F,
F, F, C, F,
F, F, C, F,
F, F, C, F,
]
# variable shortcuts for ease of writing
N = GANote
w = 4
h = 2
q = 1.
e = 0.5
s = 0.25
t = 2/3.0
d = 1.5
piece = [
[N(root_c + 9, q), N(root_c + 7, q), N(root_c + 5, q), N(root_c + 7, q)],
[N(root_c + 9, q), N(root_c + 9, q), N(root_c + 9, h)],
[N(root_c + 7, q), N(root_c + 7, q), N(root_c + 7, h)],
[N(root_c + 9, q), N(root_c + 12, q), N(root_c + 12, h)],
[N(root_c + 9, q), N(root_c + 7, q), N(root_c + 5, q), N(root_c + 7, q)],
[N(root_c + 9, q), N(root_c + 9, q), N(root_c + 9, q), N(root_c + 9, q)],
[N(root_c + 7, q), N(root_c + 7, q), N(root_c + 9, q), N(root_c + 7, q)],
[N(root_c + 5, w)],
# repeat
[N(root_c + 9, q), N(root_c + 7, q), N(root_c + 5, q), N(root_c + 7, q)],
[N(root_c + 9, q), N(root_c + 9, q), N(root_c + 9, h)],
[N(root_c + 7, q), N(root_c + 7, q), N(root_c + 7, h)],
[N(root_c + 9, q), N(root_c + 12, q), N(root_c + 12, h)],
[N(root_c + 9, q), N(root_c + 7, q), N(root_c + 5, q), N(root_c + 7, q)],
[N(root_c + 9, q), N(root_c + 9, q), N(root_c + 9, q), N(root_c + 9, q)],
[N(root_c + 7, q), N(root_c + 7, q), N(root_c + 9, q), N(root_c + 7, q)],
[N(root_c + 5, w)],
]
def getPiece():
return (piece, chord_progression, 'Mary Had A Little Lamb')