-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandom_chord.py
68 lines (57 loc) · 1.54 KB
/
random_chord.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/python3
"""
Created on Tue Aug 28 22:00:19 2018
@author: Eve
"""
import random
import time
def do_loop(tones, types, wait=5):
loop = 100
for i in range(loop):
rtone = random.choice(tones)
rtype = random.choice(types)
chord = "{}{}".format(rtone, rtype)
print(chord)
time.sleep(wait)
def ex1():
wait = 5
tones = ["G", "C"]
types = ["7", "M7", "m7", "m7b5", "dim7", "6", "m6"]
do_loop(tones, types, wait)
def ex2():
wait = 5
tones = ["G", "C", "D", "A"]
types = ["7", "M7", "m7", "m7b5", "dim7", "6", "m6"]
do_loop(tones, types, wait)
def ex3():
# D strings chords
wait = 5
tones = ["F"]
types = ["7", "M7", "m7", "m7b5", "dim7", "6", "m6"]
do_loop(tones, types, wait)
def ex4():
# 3 strings variants, with 9 chords
wait = 5
tones = ["G", "C", "F"]
types = ["7", "M7", "m7", "m7b5", "dim7", "6", "m6", "9", "m9", "9", "m9"]
do_loop(tones, types, wait)
def ex5():
# 3 strings, 2 positions (3 and 5)
wait = 5
tones = ["G", "A", "C", "D", "F", "E"]
types = ["7", "M7", "m7", "m7b5", "dim7", "6", "m6", "9", "m9"]
do_loop(tones, types, wait)
def ex6():
# Other positions (2 and 5)
wait = 5
tones = ["F#", "A", "B", "D", "E"]
types = ["7", "M7", "m7", "m7b5", "dim7", "6", "m6", "9", "m9"]
do_loop(tones, types, wait)
def ex7():
# New chord types
wait = 10
tones = ["G", "C", "F"]
types = ["7sus4", "6/9", "7b9", "7#9"]
do_loop(tones, types, wait)
if __name__ == '__main__':
ex7()