MIDI Chord Helper機能追加版(GOは五度圏や碁盤の「ご」。別に移動式じゃありません)
Revisão | f02089621d0cd30929f69a47ac9bb8418ba09a18 (tree) |
---|---|
Hora | 2022-07-01 02:36:30 |
Autor | k-hatano <kent.ruffle.mgj626@gmai...> |
Commiter | k-hatano |
ハーモニックテーブルノートレイアウトを上下逆に
@@ -81,16 +81,16 @@ public class HarmonicTableLayout extends JPanel { | ||
81 | 81 | g.fillRect(0, 0, this.getWidth(), this.getHeight()); |
82 | 82 | } |
83 | 83 | |
84 | - int offset = 152; | |
85 | - | |
84 | + int offset = 120; | |
85 | + | |
86 | 86 | for (int iy = -2; iy < 12; iy++) { |
87 | 87 | for (int ix = -2; ix < 6; ix++) { |
88 | 88 | if ((ix + iy) % 2 != 0) { |
89 | 89 | continue; |
90 | 90 | } |
91 | - int noteIndex1 = (ix + iy * 7 + offset) / 2 % 12; | |
92 | - int noteIndex2 = (noteIndex1 + 4) % 12; | |
93 | - int noteIndex3 = (noteIndex1 + 7) % 12; | |
91 | + int noteIndex1 = (ix * 13 + iy * 5 + offset) / 2 % 12; // かなりマジックナンバー | |
92 | + int noteIndex2 = (noteIndex1 + 9) % 12; | |
93 | + int noteIndex3 = (noteIndex1 + 5) % 12; | |
94 | 94 | |
95 | 95 | int x1 = (ix + 1) * (OVAL_WIDTH - 3) * 3 / 2; |
96 | 96 | int x2 = (ix + 1 + 1) * (OVAL_WIDTH - 3) * 3 / 2; |
@@ -98,32 +98,32 @@ public class HarmonicTableLayout extends JPanel { | ||
98 | 98 | int y1 = (iy + 1) * OVAL_WIDTH * 3 / 4; |
99 | 99 | int y2 = (iy + 1 + 1) * OVAL_WIDTH * 3 / 4; |
100 | 100 | int y3 = (iy + 1 + 2) * OVAL_WIDTH * 3 / 4; |
101 | - int keyDistance1 = (noteIndex1 - key + 12) % 12; | |
102 | - int keyDistance2 = (noteIndex2 - key + 12) % 12; | |
103 | - int keyDistance3 = (noteIndex3 - key + 12) % 12; | |
104 | - | |
105 | - int noteIndex4 = (noteIndex1 + 3) % 12; | |
106 | - int keyDistance4 = (noteIndex4 - key + 12) % 12; | |
101 | + int keyDistance1 = (noteIndex1 - key + 24) % 12; | |
102 | + int keyDistance2 = (noteIndex2 - key + 24) % 12; | |
103 | + int keyDistance3 = (noteIndex3 - key + 24) % 12; | |
104 | + | |
105 | + int noteIndex4 = (noteIndex1 + 8) % 12; | |
106 | + int keyDistance4 = (noteIndex4 - key + 24) % 12; | |
107 | 107 | |
108 | 108 | int x4 = (ix + 1 - 1) * (OVAL_WIDTH - 3) * 3 / 2; |
109 | 109 | int y4 = (iy + 1 + 1) * OVAL_WIDTH * 3 / 4; |
110 | 110 | |
111 | - if ((keyDistance1 == 5 || keyDistance1 == 0 || keyDistance1 == 7) | |
111 | + if ((keyDistance3 == 5 || keyDistance3 == 0 || keyDistance3 == 7) // 3が根音という罠 | |
112 | 112 | && Arrays.asList(diatonicDistances).contains(keyDistance1) |
113 | 113 | && Arrays.asList(diatonicDistances).contains(keyDistance2) |
114 | 114 | && Arrays.asList(diatonicDistances).contains(keyDistance3)) { |
115 | - | |
115 | + | |
116 | 116 | int xs[] = {x1, x2, x3}; |
117 | 117 | int ys[] = {y1, y2, y3}; |
118 | 118 | g.setColor(new Color(250, 250, 250)); |
119 | 119 | g.fillPolygon(xs, ys, 3); |
120 | 120 | } |
121 | 121 | |
122 | - if ((keyDistance1 == 2 || keyDistance1 == 9 || keyDistance1 == 4) | |
122 | + if ((keyDistance3 == 2 || keyDistance3 == 9 || keyDistance3 == 4) | |
123 | 123 | && Arrays.asList(diatonicDistances).contains(keyDistance1) |
124 | 124 | && Arrays.asList(diatonicDistances).contains(keyDistance4) |
125 | 125 | && Arrays.asList(diatonicDistances).contains(keyDistance3)) { |
126 | - | |
126 | + | |
127 | 127 | int xs[] = {x1, x4, x3}; |
128 | 128 | int ys[] = {y1, y4, y3}; |
129 | 129 | g.setColor(new Color(250, 250, 250)); |
@@ -137,14 +137,14 @@ public class HarmonicTableLayout extends JPanel { | ||
137 | 137 | int x = (ix + 1) * (OVAL_WIDTH - 3) * 3 / 2; |
138 | 138 | g.drawLine(x, 0, x, this.getHeight()); |
139 | 139 | } |
140 | - | |
140 | + | |
141 | 141 | for (int iy = -2; iy < 24; iy += 2) { |
142 | 142 | int y = (iy) * OVAL_WIDTH * 3 / 4; |
143 | 143 | g.drawLine(0, y, (OVAL_WIDTH - 3) * 10, y + OVAL_WIDTH * 5); |
144 | 144 | g.drawLine(0, y, (OVAL_WIDTH - 3) * 10, y - OVAL_WIDTH * 5); |
145 | 145 | } |
146 | 146 | |
147 | - Color[] triangleColors = { | |
147 | + Color[] triangleColors = { | |
148 | 148 | new Color(0xC0, 0xFF, 0xB0), |
149 | 149 | new Color(0xA0, 0xF0, 0xFF), |
150 | 150 | new Color(0xFF, 0xC0, 0xF0), |
@@ -157,9 +157,9 @@ public class HarmonicTableLayout extends JPanel { | ||
157 | 157 | continue; |
158 | 158 | } |
159 | 159 | |
160 | - int noteIndex1 = (ix + iy * 7 + offset) / 2 % 12; | |
161 | - int noteIndex2 = (noteIndex1 + 4) % 12; | |
162 | - int noteIndex3 = (noteIndex1 + 7) % 12; | |
160 | + int noteIndex1 = (ix * 13 + iy * 5 + offset) / 2 % 12; | |
161 | + int noteIndex2 = (noteIndex1 + 9) % 12; | |
162 | + int noteIndex3 = (noteIndex1 + 5) % 12; | |
163 | 163 | |
164 | 164 | int x1 = (ix + 1) * (OVAL_WIDTH - 3) * 3 / 2; |
165 | 165 | int x2 = (ix + 1 + 1) * (OVAL_WIDTH - 3) * 3 / 2; |
@@ -167,33 +167,33 @@ public class HarmonicTableLayout extends JPanel { | ||
167 | 167 | int y1 = (iy + 1) * OVAL_WIDTH * 3 / 4; |
168 | 168 | int y2 = (iy + 1 + 1) * OVAL_WIDTH * 3 / 4; |
169 | 169 | int y3 = (iy + 1 + 2) * OVAL_WIDTH * 3 / 4; |
170 | - int keyDistance1 = (noteIndex1 - key + 12) % 12; | |
171 | - int keyDistance2 = (noteIndex2 - key + 12) % 12; | |
172 | - int keyDistance3 = (noteIndex3 - key + 12) % 12; | |
170 | + int keyDistance1 = (noteIndex1 - key + 24) % 12; | |
171 | + int keyDistance2 = (noteIndex2 - key + 24) % 12; | |
172 | + int keyDistance3 = (noteIndex3 - key + 24) % 12; | |
173 | 173 | |
174 | 174 | if (noteWeights[noteIndex1] > 0 && noteWeights[noteIndex2] > 0 && noteWeights[noteIndex3] > 0) { |
175 | 175 | int xs[] = {x1, x2, x3}; |
176 | 176 | int ys[] = {y1, y2, y3}; |
177 | 177 | |
178 | - switch (keyDistance1) { | |
178 | + switch (keyDistance3) { | |
179 | 179 | case 5: case 0: case 7: |
180 | 180 | g.setColor(triangleColors[2]); |
181 | 181 | break; |
182 | 182 | case 2: case 9: case 4: |
183 | 183 | g.setColor(triangleColors[3]); |
184 | - break; | |
184 | + break; | |
185 | 185 | case 11: case 6: case 1: |
186 | 186 | g.setColor(triangleColors[0]); |
187 | - break; | |
187 | + break; | |
188 | 188 | case 8: case 3: case 10: |
189 | 189 | g.setColor(triangleColors[1]); |
190 | - break; | |
190 | + break; | |
191 | 191 | } |
192 | 192 | g.fillPolygon(xs, ys, 3); |
193 | - } | |
194 | - | |
195 | - int noteIndex4 = (noteIndex1 + 3) % 12; | |
196 | - int keyDistance4 = (noteIndex4 - key + 12) % 12; | |
193 | + } | |
194 | + | |
195 | + int noteIndex4 = (noteIndex1 + 8) % 12; | |
196 | + int keyDistance4 = (noteIndex4 - key + 24) % 12; | |
197 | 197 | |
198 | 198 | int x4 = (ix + 1 - 1) * (OVAL_WIDTH - 3) * 3 / 2; |
199 | 199 | int y4 = (iy + 1 + 1) * OVAL_WIDTH * 3 / 4; |
@@ -202,19 +202,19 @@ public class HarmonicTableLayout extends JPanel { | ||
202 | 202 | int xs[] = {x1, x4, x3}; |
203 | 203 | int ys[] = {y1, y4, y3}; |
204 | 204 | |
205 | - switch (keyDistance1) { | |
205 | + switch (keyDistance3) { | |
206 | 206 | case 5: case 0: case 7: |
207 | 207 | g.setColor(triangleColors[1]); |
208 | 208 | break; |
209 | 209 | case 2: case 9: case 4: |
210 | 210 | g.setColor(triangleColors[2]); |
211 | - break; | |
211 | + break; | |
212 | 212 | case 11: case 6: case 1: |
213 | 213 | g.setColor(triangleColors[3]); |
214 | - break; | |
214 | + break; | |
215 | 215 | case 8: case 3: case 10: |
216 | 216 | g.setColor(triangleColors[0]); |
217 | - break; | |
217 | + break; | |
218 | 218 | } |
219 | 219 | g.fillPolygon(xs, ys, 3); |
220 | 220 | } |
@@ -238,8 +238,8 @@ public class HarmonicTableLayout extends JPanel { | ||
238 | 238 | continue; |
239 | 239 | } |
240 | 240 | |
241 | - int noteIndex = (ix + iy * 7 + offset) / 2 % 12; | |
242 | - int keyDistance = (noteIndex - key + 12) % 12; | |
241 | + int noteIndex = (ix * 13 + iy * 5 + offset) / 2 % 12; | |
242 | + int keyDistance = (noteIndex - key + 24) % 12; | |
243 | 243 | |
244 | 244 | int x = (ix + 1) * (OVAL_WIDTH - 3) * 3 / 2; |
245 | 245 | int y = (iy + 1) * OVAL_WIDTH * 3 / 4; |