MIDI Chord Helper機能追加版(GOは五度圏や碁盤の「ご」。別に移動式じゃありません)
Révision | 4fb0e1380c86357d4695c0e0749c3cb4bfad58e5 (tree) |
---|---|
l'heure | 2022-10-07 02:21:10 |
Auteur | k-hatano <kent.ruffle.mgj626@gmai...> |
Commiter | k-hatano |
ガイドを7とM7 6で分離、ハーモニックテーブルノートレイアウトを細かく
@@ -15,7 +15,8 @@ import javax.swing.JPopupMenu; | ||
15 | 15 | */ |
16 | 16 | public class ChordGuide extends JPanel { |
17 | 17 | public static enum Guide { |
18 | - GUIDE_76(76), | |
18 | + GUIDE_7(7), | |
19 | + GUIDE_6(6), | |
19 | 20 | GUIDE_5(5), |
20 | 21 | GUIDE_9(9); |
21 | 22 |
@@ -73,11 +74,19 @@ public class ChordGuide extends JPanel { | ||
73 | 74 | |
74 | 75 | } |
75 | 76 | |
76 | - private ChordGuideLabel guide76, guide5, guide9; | |
77 | + private ChordGuideLabel guide7, guide6, guide5, guide9; | |
77 | 78 | |
78 | 79 | public ChordGuide(ChordMatrix cm) { |
79 | 80 | setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); |
80 | - add(guide76 = new ChordGuideLabel(" 6 7 M7 ", cm) { | |
81 | + add(guide7 = new ChordGuideLabel(" 7 ", cm) { | |
82 | + { | |
83 | + setToolTipText("How to add 7th, major 7th, 6th"); | |
84 | + addMenu(new JMenuItem("7 = <RightClick>")); | |
85 | + addMenu(new JMenuItem("M7(maj7) = [Shift] <RightClick>")); | |
86 | + addMenu(new JMenuItem("6 = [Shift]")); | |
87 | + } | |
88 | + }); | |
89 | + add(guide6 = new ChordGuideLabel(" M7 6 ", cm) { | |
81 | 90 | { |
82 | 91 | setToolTipText("How to add 7th, major 7th, 6th"); |
83 | 92 | addMenu(new JMenuItem("7 = <RightClick>")); |
@@ -114,15 +123,19 @@ public class ChordGuide extends JPanel { | ||
114 | 123 | |
115 | 124 | public void setDarkMode(boolean is_dark) { |
116 | 125 | setBackground(is_dark ? Color.black : null); |
117 | - guide76.setDarkMode(is_dark); | |
126 | + guide7.setDarkMode(is_dark); | |
127 | + guide6.setDarkMode(is_dark); | |
118 | 128 | guide5.setDarkMode(is_dark); |
119 | 129 | guide9.setDarkMode(is_dark); |
120 | 130 | } |
121 | 131 | |
122 | 132 | public void changeActive(Guide which, boolean is_active) { |
123 | 133 | switch (which) { |
124 | - case GUIDE_76: | |
125 | - guide76.setActive(is_active); | |
134 | + case GUIDE_7: | |
135 | + guide7.setActive(is_active); | |
136 | + break; | |
137 | + case GUIDE_6: | |
138 | + guide6.setActive(is_active); | |
126 | 139 | break; |
127 | 140 | case GUIDE_5: |
128 | 141 | guide5.setActive(is_active); |
@@ -136,7 +149,8 @@ public class ChordGuide extends JPanel { | ||
136 | 149 | } |
137 | 150 | |
138 | 151 | public void deactivateAll() { |
139 | - guide76.setActive(false); | |
152 | + guide7.setActive(false); | |
153 | + guide6.setActive(false); | |
140 | 154 | guide5.setActive(false); |
141 | 155 | guide9.setActive(false); |
142 | 156 | } |
@@ -807,7 +807,7 @@ public class ChordMatrix extends JPanel | ||
807 | 807 | int keyCo5 = key.toCo5(); |
808 | 808 | |
809 | 809 | if (keyCode == KeyEvent.VK_SHIFT) { |
810 | - chordGuide.changeActive(ChordGuide.Guide.GUIDE_76, true); | |
810 | + chordGuide.changeActive(ChordGuide.Guide.GUIDE_6, true); | |
811 | 811 | return; |
812 | 812 | } |
813 | 813 | if (keyCode == KeyEvent.VK_ALT) { |
@@ -917,7 +917,7 @@ public class ChordMatrix extends JPanel | ||
917 | 917 | public void keyReleased(KeyEvent e) { |
918 | 918 | int keyCode = e.getKeyCode(); |
919 | 919 | if (keyCode == KeyEvent.VK_SHIFT) { |
920 | - chordGuide.changeActive(ChordGuide.Guide.GUIDE_76, false); | |
920 | + chordGuide.changeActive(ChordGuide.Guide.GUIDE_6, false); | |
921 | 921 | return; |
922 | 922 | } |
923 | 923 | if (keyCode == KeyEvent.VK_ALT) { |
@@ -165,10 +165,10 @@ public class CircularPitchSpace extends JPanel { | ||
165 | 165 | g.fillRect(0, 0, this.getWidth(), this.getHeight()); |
166 | 166 | } |
167 | 167 | |
168 | - Color[] lineColors = { new Color(0x20, 0xD0, 0xD0), | |
169 | - new Color(0xD0, 0xD0, 0x00), | |
170 | - new Color(0xF0, 0x20, 0xF0), | |
171 | - new Color(0xC0, 0xC0, 0xC0) | |
168 | + Color[] lineColors = { new Color(0x00, 0x00, 0xC0), | |
169 | + new Color(0xC0, 0xC0, 0x00), | |
170 | + new Color(0xC0, 0x00, 0x00), | |
171 | + new Color(0x80, 0x80, 0x80) | |
172 | 172 | }; |
173 | 173 | |
174 | 174 | for (int i = 0; i < 12; i++) { |
@@ -13,7 +13,7 @@ import javax.swing.JComponent; | ||
13 | 13 | import javax.swing.JPanel; |
14 | 14 | |
15 | 15 | public class HarmonicTableLayout extends JPanel { |
16 | - final int OVAL_WIDTH = 24; | |
16 | + final int OVAL_WIDTH = 20; | |
17 | 17 | |
18 | 18 | private HarmonicTableLayoutComponent component; |
19 | 19 | ArrayList<JComponent> views = new ArrayList<JComponent>(); |
@@ -83,8 +83,8 @@ public class HarmonicTableLayout extends JPanel { | ||
83 | 83 | |
84 | 84 | int offset = 120; |
85 | 85 | |
86 | - for (int iy = -2; iy < 12; iy++) { | |
87 | - for (int ix = -2; ix < 6; ix++) { | |
86 | + for (int iy = -2; iy < 14; iy++) { | |
87 | + for (int ix = -2; ix < 7; ix++) { | |
88 | 88 | if ((ix + iy) % 2 != 0) { |
89 | 89 | continue; |
90 | 90 | } |
@@ -151,8 +151,8 @@ public class HarmonicTableLayout extends JPanel { | ||
151 | 151 | new Color(0xFF, 0xFF, 0xA0) |
152 | 152 | }; |
153 | 153 | |
154 | - for (int iy = -2; iy < 12; iy++) { | |
155 | - for (int ix = -2; ix < 6; ix++) { | |
154 | + for (int iy = -2; iy < 14; iy++) { | |
155 | + for (int ix = -2; ix < 7; ix++) { | |
156 | 156 | if ((ix + iy) % 2 != 0) { |
157 | 157 | continue; |
158 | 158 | } |
@@ -232,8 +232,8 @@ public class HarmonicTableLayout extends JPanel { | ||
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
235 | - for (int iy = -2; iy < 12; iy++) { | |
236 | - for (int ix = -2; ix < 6; ix++) { | |
235 | + for (int iy = -2; iy < 14; iy++) { | |
236 | + for (int ix = -2; ix < 7; ix++) { | |
237 | 237 | if ((ix + iy) % 2 != 0) { |
238 | 238 | continue; |
239 | 239 | } |
@@ -251,7 +251,7 @@ public class HarmonicTableLayout extends JPanel { | ||
251 | 251 | g.setColor(Color.black); |
252 | 252 | g.drawOval(x - OVAL_WIDTH / 2, y - OVAL_WIDTH / 2, OVAL_WIDTH, OVAL_WIDTH); |
253 | 253 | g.setColor(Color.black); |
254 | - g.drawString(ix <= 1 ? notesLabelsWithFlat[noteIndex] : notesLabelsWithSharp[noteIndex], | |
254 | + g.drawString(ix <= 2 ? notesLabelsWithFlat[noteIndex] : notesLabelsWithSharp[noteIndex], | |
255 | 255 | x - 4, y + 6); |
256 | 256 | } else { |
257 | 257 | g.setColor(Color.black); |
@@ -259,7 +259,7 @@ public class HarmonicTableLayout extends JPanel { | ||
259 | 259 | g.setColor(Color.black); |
260 | 260 | g.drawOval(x - OVAL_WIDTH / 2, y - OVAL_WIDTH / 2, OVAL_WIDTH, OVAL_WIDTH); |
261 | 261 | g.setColor(Color.white); |
262 | - g.drawString(ix <= 1 ? notesLabelsWithFlat[noteIndex] : notesLabelsWithSharp[noteIndex], | |
262 | + g.drawString(ix <= 2 ? notesLabelsWithFlat[noteIndex] : notesLabelsWithSharp[noteIndex], | |
263 | 263 | x - 4, y + 6); |
264 | 264 | } |
265 | 265 | } else { |
@@ -267,13 +267,13 @@ public class HarmonicTableLayout extends JPanel { | ||
267 | 267 | g.setColor(new Color(214, 214, 214)); |
268 | 268 | g.fillOval(x - OVAL_WIDTH / 2, y - OVAL_WIDTH / 2, OVAL_WIDTH, OVAL_WIDTH); |
269 | 269 | g.setColor(new Color(254, 254, 254)); |
270 | - g.drawString(ix <= 1 ? notesLabelsWithFlat[noteIndex] : notesLabelsWithSharp[noteIndex], | |
270 | + g.drawString(ix <= 2 ? notesLabelsWithFlat[noteIndex] : notesLabelsWithSharp[noteIndex], | |
271 | 271 | x - 4, y + 6); |
272 | 272 | } else { |
273 | 273 | g.setColor(new Color(190, 190, 190)); |
274 | 274 | g.fillOval(x - OVAL_WIDTH / 2, y - OVAL_WIDTH / 2, OVAL_WIDTH, OVAL_WIDTH); |
275 | 275 | g.setColor(new Color(230, 230, 230)); |
276 | - g.drawString(ix <= 1 ? notesLabelsWithFlat[noteIndex] : notesLabelsWithSharp[noteIndex], | |
276 | + g.drawString(ix <= 2 ? notesLabelsWithFlat[noteIndex] : notesLabelsWithSharp[noteIndex], | |
277 | 277 | x - 4, y + 6); |
278 | 278 | } |
279 | 279 | } |