-
Notifications
You must be signed in to change notification settings - Fork 0
/
music_constants.py
69 lines (53 loc) · 2.18 KB
/
music_constants.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
chrom_scale = ['C', 'C#/Db', 'D', 'D#/Eb', 'E', 'F', 'F#/Gb', 'G', 'G#/Ab', 'A', 'A#/Bb', 'B']
chrom_scale_no_acc = ['C', 'C/D', 'D', 'D/E', 'E', 'F', 'F/G', 'G', 'G/A', 'A', 'A/B', 'B']
scale_degrees = ["1", "♭2", "2", "♭3", "3", "4", "♯4/♭5", "5", "♯5/♭6", "6", "♭7", "7"]
flat = u'\u266D'
sharp = u'\u266F'
scale_highlights = {
"": 0b100000000000,
"All": 0b111111111111,
"R": 0b100000000000,
"R, 3": 0b100110000000,
"R, 5": 0b100000110000,
"R, 3, 5": 0b100110110000,
}
# rest = u'\u1D13x'
standard_tuning = (28, 33, 38, 43, 47, 52)
chord_names_to_nums = {
'Major' : 0b100010010000, 'Major 6': 0b100010010100, 'Major 7': 0b100010010001,
'Major 9' : 0b101010010001, 'Major 11': 0b101011010001,
'Minor' : 0b100100010000, 'Minor 6': 0b100100010100, 'Minor 7': 0b100100010010,
'Minor 9' : 0b101100010010, 'Minor 11': 0b101101010010, 'Minor Major 7': 0b100100010001,
'Dominant 7': 0b100010010010, 'Dominant 9': 0b101010010010, 'Dominant 11': 0b101011010010,
'Sus 2' : 0b101000010000, 'Sus 4': 0b100001010000,
'Diminished': 0b100100100000, 'Diminished 7': 0b100100100100,
'Augmented' : 0b100010001000, 'Augmented 7': 0b100010001010,
}
basic_chord_names_to_nums = {
'Major': 0b100010010000,
'Minor': 0b100100010000,
'Diminished': 0b100100100000,
'Augmented': 0b100010001000,
'Dominant 7': 0b100010010010,
'Sus 2': 0b101000010000,
}
major_chord_shapes = {
'Major' : 0b100010010000, 'Major 6': 0b100010010100, 'Major 7': 0b100010010001,
'Major 9': 0b101010010001, 'Major 11': 0b101011010001,
}
minor_chord_shapes = {
'Minor' : 0b100100010000, 'Minor 6': 0b100100010100, 'Minor 7': 0b100100010010,
'Minor 9': 0b101100010010, 'Minor 11': 0b101101010010, 'Minor Major 7': 0b100100010001,
}
dom_chord_shapes = {
'Dominant 7': 0b100010010010, 'Dominant 9': 0b101010010010, 'Dominant 11': 0b101011010010,
}
sus_chord_shapes = {
'Sus 2': 0b101000010000, 'Sus 4': 0b100001010000,
}
dim_chord_shapes = {
'Diminished': 0b100100100000, 'Diminished 7': 0b100100100100,
}
aug_chord_shapes = {
'Augmented': 0b100010001000, 'Augmented 7': 0b100010001010,
}