-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.py
90 lines (69 loc) · 2.87 KB
/
notes.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
83
84
85
86
87
88
89
90
import ui
from utility import Utility
from config_layout import cl
from config import Config
class Notes():
something = 2
octaves = [-60, -48, -24, -12, 0, 12, 24, 36, 48, 60]
upper_limit = -25
lower_limit = 25
note_list = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"]
# all_notes = note_list * cl["defaults"]["keyboard_count"]
all_notes = []
for i in range(0, cl["defaults"]["keyboard_count"]):
for n in note_list:
text = str(n) + str(i)
all_notes.append(text)
octaves = [-36, -24, -12, 0, 12, 24, 36]
root = note_list.index(Config.ROOT_NOTE)
def get_root_note():
return Notes.root
def set_root_note(data_two):
Notes.root = data_two
def set_upper_limit(data_two):
Notes.upper_limit = data_two
def set_lower_limit(data_two):
Notes.lower_limit = data_two
def get_upper_limit():
return Notes.upper_limit
def get_lower_limit():
return Notes.lower_limit
# def display_limits():
# Timing.begin_message(f"Lower Limit: {Notes.lower_limit} - Upper Limit: {Notes.upper_limit}")
def root_name():
return Notes.note_list[Notes.root]
class Scales(Notes):
# major_scale = [0, 2, 4, 5, 7, 9, 11, 12, ]
# natural_scale =[0, 2, 3, 5, 7, 8, 10, 12,]
# harmonic_scale = [0, 2, 3, 5, 7, 8, 11, 12,]
# dorian_scale = [0, 2, 3, 5, 7, 9, 10, 12, 14,]
# mixolydian_scale = [0, 2, 4, 5, 7, 9, 10, 12,]
# min_pent_scale = [0, 3, 5, 7, 10, 12, 15, 17,]
# c c# d d# e f f# G G# A A# B C
major_scale = [0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19, 21, 23]
natural_scale =[0, 2, 3, 5, 7, 8, 10, 12, 14, 15, 17, 19, 20, 22]
harmonic_scale = [0, 2, 3, 5, 7, 8, 11, 12, 14, 15, 17, 19, 20, 23]
dorian_scale = [0, 2, 3, 5, 7, 9, 10, 12, 14, 15, 17, 19, 21, 22]
mixolydian_scale = [0, 2, 4, 5, 7, 9, 10, 12, 14, 16, 17, 19, 21, 22]
min_pent_scale = [0, 3, 5, 7, 10, 12, 15, 17, 19, 22, 24, 27, 29, 31]
chromatic_scale = [i for i in range(0, 145)]
scales = [major_scale, natural_scale, harmonic_scale, dorian_scale, mixolydian_scale, min_pent_scale, chromatic_scale]
scale_names = ["Major", "Natural Minor", "Harmonic Minor", "Dorian", "Mixolydian", "Minor Pentatonic", "Chromatic"]
scale_choice = scale_names.index(Config.SCALE)
def set_scale(data_two):
Scales.scale_choice = data_two
def set_scale_by_name(name):
Scales.scale_choice = Scales.scale_names.index(name)
def increment_scale():
Scales.scale_choice += 1
if Scales.scale_choice >= len(Scales.scales):
Scales.scale_choice = 0
def get_scale_choice():
print(Scales.scale_choice)
return Scales.scale_choice
def scale_message(data_two):
return ui.setHintMsg(Scales.scale_names[int(mapvalues(self.data_two, 0, len(Scales.scale_names)-1, 0, 127))])
def get_scale_name():
return Scales.scale_names[Scales.scale_choice]
def display_scale():
return Timing.begin_message(f"Root: {Notes.root_name(Notes.get_root_note())} Scale: {Scales.scale_name(Scales.get_scale_choice())}")