• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

MIDI Chord Helper機能追加版(GOは五度圏や碁盤の「ご」。別に移動式じゃありません)


Commit MetaInfo

Revisãof02089621d0cd30929f69a47ac9bb8418ba09a18 (tree)
Hora2022-07-01 02:36:30
Autork-hatano <kent.ruffle.mgj626@gmai...>
Commiterk-hatano

Mensagem de Log

ハーモニックテーブルノートレイアウトを上下逆に

Mudança Sumário

Diff

--- a/src/camidion/chordhelper/pitchspace/HarmonicTableLayout.java
+++ b/src/camidion/chordhelper/pitchspace/HarmonicTableLayout.java
@@ -81,16 +81,16 @@ public class HarmonicTableLayout extends JPanel {
8181 g.fillRect(0, 0, this.getWidth(), this.getHeight());
8282 }
8383
84- int offset = 152;
85-
84+ int offset = 120;
85+
8686 for (int iy = -2; iy < 12; iy++) {
8787 for (int ix = -2; ix < 6; ix++) {
8888 if ((ix + iy) % 2 != 0) {
8989 continue;
9090 }
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;
9494
9595 int x1 = (ix + 1) * (OVAL_WIDTH - 3) * 3 / 2;
9696 int x2 = (ix + 1 + 1) * (OVAL_WIDTH - 3) * 3 / 2;
@@ -98,32 +98,32 @@ public class HarmonicTableLayout extends JPanel {
9898 int y1 = (iy + 1) * OVAL_WIDTH * 3 / 4;
9999 int y2 = (iy + 1 + 1) * OVAL_WIDTH * 3 / 4;
100100 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;
107107
108108 int x4 = (ix + 1 - 1) * (OVAL_WIDTH - 3) * 3 / 2;
109109 int y4 = (iy + 1 + 1) * OVAL_WIDTH * 3 / 4;
110110
111- if ((keyDistance1 == 5 || keyDistance1 == 0 || keyDistance1 == 7)
111+ if ((keyDistance3 == 5 || keyDistance3 == 0 || keyDistance3 == 7) // 3が根音という罠
112112 && Arrays.asList(diatonicDistances).contains(keyDistance1)
113113 && Arrays.asList(diatonicDistances).contains(keyDistance2)
114114 && Arrays.asList(diatonicDistances).contains(keyDistance3)) {
115-
115+
116116 int xs[] = {x1, x2, x3};
117117 int ys[] = {y1, y2, y3};
118118 g.setColor(new Color(250, 250, 250));
119119 g.fillPolygon(xs, ys, 3);
120120 }
121121
122- if ((keyDistance1 == 2 || keyDistance1 == 9 || keyDistance1 == 4)
122+ if ((keyDistance3 == 2 || keyDistance3 == 9 || keyDistance3 == 4)
123123 && Arrays.asList(diatonicDistances).contains(keyDistance1)
124124 && Arrays.asList(diatonicDistances).contains(keyDistance4)
125125 && Arrays.asList(diatonicDistances).contains(keyDistance3)) {
126-
126+
127127 int xs[] = {x1, x4, x3};
128128 int ys[] = {y1, y4, y3};
129129 g.setColor(new Color(250, 250, 250));
@@ -137,14 +137,14 @@ public class HarmonicTableLayout extends JPanel {
137137 int x = (ix + 1) * (OVAL_WIDTH - 3) * 3 / 2;
138138 g.drawLine(x, 0, x, this.getHeight());
139139 }
140-
140+
141141 for (int iy = -2; iy < 24; iy += 2) {
142142 int y = (iy) * OVAL_WIDTH * 3 / 4;
143143 g.drawLine(0, y, (OVAL_WIDTH - 3) * 10, y + OVAL_WIDTH * 5);
144144 g.drawLine(0, y, (OVAL_WIDTH - 3) * 10, y - OVAL_WIDTH * 5);
145145 }
146146
147- Color[] triangleColors = {
147+ Color[] triangleColors = {
148148 new Color(0xC0, 0xFF, 0xB0),
149149 new Color(0xA0, 0xF0, 0xFF),
150150 new Color(0xFF, 0xC0, 0xF0),
@@ -157,9 +157,9 @@ public class HarmonicTableLayout extends JPanel {
157157 continue;
158158 }
159159
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;
163163
164164 int x1 = (ix + 1) * (OVAL_WIDTH - 3) * 3 / 2;
165165 int x2 = (ix + 1 + 1) * (OVAL_WIDTH - 3) * 3 / 2;
@@ -167,33 +167,33 @@ public class HarmonicTableLayout extends JPanel {
167167 int y1 = (iy + 1) * OVAL_WIDTH * 3 / 4;
168168 int y2 = (iy + 1 + 1) * OVAL_WIDTH * 3 / 4;
169169 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;
173173
174174 if (noteWeights[noteIndex1] > 0 && noteWeights[noteIndex2] > 0 && noteWeights[noteIndex3] > 0) {
175175 int xs[] = {x1, x2, x3};
176176 int ys[] = {y1, y2, y3};
177177
178- switch (keyDistance1) {
178+ switch (keyDistance3) {
179179 case 5: case 0: case 7:
180180 g.setColor(triangleColors[2]);
181181 break;
182182 case 2: case 9: case 4:
183183 g.setColor(triangleColors[3]);
184- break;
184+ break;
185185 case 11: case 6: case 1:
186186 g.setColor(triangleColors[0]);
187- break;
187+ break;
188188 case 8: case 3: case 10:
189189 g.setColor(triangleColors[1]);
190- break;
190+ break;
191191 }
192192 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;
197197
198198 int x4 = (ix + 1 - 1) * (OVAL_WIDTH - 3) * 3 / 2;
199199 int y4 = (iy + 1 + 1) * OVAL_WIDTH * 3 / 4;
@@ -202,19 +202,19 @@ public class HarmonicTableLayout extends JPanel {
202202 int xs[] = {x1, x4, x3};
203203 int ys[] = {y1, y4, y3};
204204
205- switch (keyDistance1) {
205+ switch (keyDistance3) {
206206 case 5: case 0: case 7:
207207 g.setColor(triangleColors[1]);
208208 break;
209209 case 2: case 9: case 4:
210210 g.setColor(triangleColors[2]);
211- break;
211+ break;
212212 case 11: case 6: case 1:
213213 g.setColor(triangleColors[3]);
214- break;
214+ break;
215215 case 8: case 3: case 10:
216216 g.setColor(triangleColors[0]);
217- break;
217+ break;
218218 }
219219 g.fillPolygon(xs, ys, 3);
220220 }
@@ -238,8 +238,8 @@ public class HarmonicTableLayout extends JPanel {
238238 continue;
239239 }
240240
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;
243243
244244 int x = (ix + 1) * (OVAL_WIDTH - 3) * 3 / 2;
245245 int y = (iy + 1) * OVAL_WIDTH * 3 / 4;