-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
82 lines (75 loc) · 1.69 KB
/
app.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from utils import Graph
from colorama import Fore
from PyInquirer import prompt
graph = Graph()
selection = ""
graph.add_vertex("A")
graph.add_vertex("A#/Bb")
graph.add_vertex("B")
graph.add_vertex("C")
graph.add_vertex("C#/Db")
graph.add_vertex("D")
graph.add_vertex("D#/Eb")
graph.add_vertex("E")
graph.add_vertex("F")
graph.add_vertex("F#/Gb")
graph.add_vertex("G")
graph.add_vertex("G#/Ab")
graph.add_edge("A", "A#/Bb")
graph.add_edge("A#/Bb", "B")
graph.add_edge("B", "C")
graph.add_edge("C", "C#/Db")
graph.add_edge("C#/Db", "D")
graph.add_edge("D", "D#/Eb")
graph.add_edge("D#/Eb", "E")
graph.add_edge("E", "F")
graph.add_edge("F", "F#/Gb")
graph.add_edge("F#/Gb", "G")
graph.add_edge("G", "G#/Ab")
graph.add_edge("G#/Ab", "A")
root_note = [
{
"type": "list",
"name": "root",
"message": "Choose the root note of your scale:",
"choices": [
"A",
"A#/Bb",
"B",
"C",
"C#/Db",
"D",
"D#/Eb",
"E",
"F",
"F#/Gb",
"G",
"G#/Ab",
"Quit",
],
}
]
musical_scale = [
{
"type": "list",
"name": "scale",
"message": "Choose the scale you would like to view:",
"choices": [
"Ionian",
"Dorian",
"Phrygian",
"Lydian",
"Mixolydian",
"Aeolian",
"Locrian",
"Quit",
],
}
]
while not selection == "Quit":
selection = prompt(root_note)
root = selection["root"]
selection = prompt(musical_scale)
scale = selection["scale"]
graph.find_scale(root, scale)
selection = "Quit"