Skip to content

Commit 7c8ce96

Browse files
committed
More scales, scale/mode duplicate checker, CONTRIBUTORS file
1 parent 9fc474a commit 7c8ce96

File tree

3 files changed

+133
-13
lines changed

3 files changed

+133
-13
lines changed

CONTRIBUTORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Grady O'Connell <github.com/flipcoder>
2+
Andy Klise <github.com/kungfoomanchu>

midimech.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,25 @@ def __init__(self):
10541054
except yaml.YAMLError as exc:
10551055
error('Cannot load scales.yaml')
10561056

1057+
dups = {}
1058+
for scale in self.scale_db:
1059+
notes = scale['notes']
1060+
count = notes.count('x')
1061+
dupes = (scale.get('duplicates') is True) or False
1062+
if not dupes:
1063+
for i in range(count):
1064+
mode_notes = self.rotate_mode(notes, i)
1065+
try:
1066+
name = scale['name'] + ' ' + scale['modes'][i]
1067+
except:
1068+
name = scale['name'] + ' Mode ' + str(i+1)
1069+
if mode_notes in dups:
1070+
print('Duplicate scale: ', dups[mode_notes], ' and ', name)
1071+
break
1072+
else:
1073+
# print(mode_notes, name)
1074+
dups[mode_notes] = name
1075+
10571076
# print(self.scale_db)
10581077

10591078
self.options = Options()
@@ -2035,7 +2054,7 @@ def render(self):
20352054
textpos.y = self.screen_h - self.status_sz*3/4
20362055
self.screen.surface.blit(text, textpos)
20372056

2038-
text = self.font.render(self.mode_name.capitalize(), True, ivec3(127))
2057+
text = self.font.render(self.mode_name, True, ivec3(127))
20392058
textpos = text.get_rect()
20402059
textpos.x = self.screen_w*2/4 - textpos[2]/2
20412060
textpos.y = self.screen_h - self.status_sz*3/4

scales.yaml

Lines changed: 111 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,124 @@
11
- name: Diatonic
22
notes: 'x.x.xx.x.x.x'
33
modes:
4-
- major
5-
- dorian
6-
- phyrigian
7-
- lydian
8-
- mixolydian
9-
- minor
10-
- locrian
4+
- Major
5+
- Dorian
6+
- Phyrigian
7+
- Lydian
8+
- Mixolydian
9+
- Minor
10+
- Locrian
1111
- name: Pentatonic
1212
notes: 'x.x..x.x.x..'
13+
modes:
14+
- Yo
15+
- Minor Pentatonic
16+
- Major Pentatonic
17+
- Egyption
18+
- Man Gong
1319
- name: Blues
1420
notes: 'x..x.xxx..x.'
1521
- name: Melodic Minor
1622
notes: 'x.xx.x.x.x.x'
17-
- name: Neapoliton Minor
18-
notes: 'xx.x.x.xx..x'
23+
modes:
24+
- Melodic Minor
25+
- Assyrian
26+
- Lydian Augmented
27+
- Acoustic
28+
- Melodic Major
29+
- Half Dim
30+
- Altered
31+
- name: Neapolitan Major
32+
notes: 'xx.x.x.x.x.x'
33+
modes:
34+
- Neapolitan Major
35+
- Leading Whole Tone
36+
- Lydian Aug Dom
37+
- Minor Lydian
38+
- Major Locrian
39+
- Semilocrian b4
40+
- Superlocrian bb3
1941
- name: Harmonic Minor
2042
notes: 'x.xx.x.xx..x'
43+
modes:
44+
- Harmonic Minor
45+
- Locrian n6
46+
- Ionian Aug
47+
- 'Dorian #4'
48+
- Phrygiain Minor
49+
- 'Lydian #9'
50+
- Altered bb7
2151
- name: Harmonic Major
2252
notes: 'x.x.xx.xx..x'
23-
- name: Neapoliton Major
24-
notes: 'xx.x.x.x.x.x'
25-
53+
modes:
54+
- Harmonic Major
55+
- Dorian b5
56+
- Phyrigian b4
57+
- Lydian b3
58+
- Mixolydian b2
59+
- 'Lydian Aug #2'
60+
- Locrian bb7
61+
- name: Neapolitan Minor
62+
notes: 'xx.x.x.xx..x'
63+
modes:
64+
- Neopolitan Minor
65+
- 'Lydian #6'
66+
- Mixolydian Aug
67+
- Romani Minor
68+
- Locrian Dom
69+
- 'Ionian #2'
70+
- Ultralocrian bb3
71+
- name: Double Harmonic
72+
notes: 'xx..xx.xx..x'
73+
modes:
74+
- Double Harmonic
75+
- 'Lydian #2 #6'
76+
- Ultraphyrigian
77+
- Hungarian Minor
78+
- Oriental
79+
- 'Ionian #2 #5'
80+
- Locrian b3 bb7
81+
- name: Algerian
82+
notes: 'x.xx.xxxx..x'
83+
- name: Eight Tone Spanish
84+
notes: 'xx.xxxx.x.x.'
85+
- name: Iberian
86+
notes: 'xx..xx.x..x.'
87+
- name: Hungarian Major
88+
notes: 'x..xx.xx.xx.'
89+
- name: Balinese
90+
notes: 'xx.x...xx...'
91+
- name: Chinese
92+
notes: 'x...x.xx...x'
93+
modes:
94+
- Chinese
95+
- Hirajoshi
96+
- Iwato
97+
- name: Japanese
98+
notes: 'xx...x.x..x.'
99+
modes:
100+
- Insen
101+
- name: Augmented
102+
notes: 'x..xx..xx..x'
103+
duplicates: true
104+
- name: Prometheus
105+
notes: 'x.x.x.x..xx.'
106+
- name: Diminished
107+
notes: 'x.xx.xx.xx.x'
108+
duplicates: true
109+
modes:
110+
- Diminished
111+
- Dominant Diminished
112+
- Diminished (2)
113+
- Dominant Diminished (2)
114+
- Diminished (3)
115+
- Dominant Diminished (3)
116+
- Diminished (4)
117+
- Dominant Diminished (4)
118+
- name: Whole Tone
119+
notes: 'x.x.x.x.x.x.'
120+
duplicates: true
121+
- name: Major Bebop
122+
notes: 'x.x.xx.xxx.x'
123+
- name: Minor Bebop
124+
notes: 'x.xxxx.x.xx.'

0 commit comments

Comments
 (0)