|
|
@ -40,63 +40,57 @@ public class KeyboardSpec { |
|
|
|
|
|
|
|
|
|
|
|
public static KeyboardSpec make2Row() { |
|
|
|
public static KeyboardSpec make2Row() { |
|
|
|
KeyboardSpec ks = new KeyboardSpec(12, 84, 24); |
|
|
|
KeyboardSpec ks = new KeyboardSpec(12, 84, 24); |
|
|
|
final int w = Color.WHITE; |
|
|
|
ks.addKey(0, 12, 12, 12, W); // C
|
|
|
|
final int b = Color.BLACK; |
|
|
|
ks.addKey(6, 0, 12, 12, B); // C#
|
|
|
|
ks.addKey(0, 12, 12, 12, w); // C
|
|
|
|
ks.addKey(12, 12, 12, 12, W); // D
|
|
|
|
ks.addKey(6, 0, 12, 12, b); // C#
|
|
|
|
ks.addKey(18, 0, 12, 12, B); // D#
|
|
|
|
ks.addKey(12, 12, 12, 12, w); // D
|
|
|
|
ks.addKey(24, 12, 12, 12, W); // E
|
|
|
|
ks.addKey(18, 0, 12, 12, b); // D#
|
|
|
|
ks.addKey(36, 12, 12, 12, W); // F
|
|
|
|
ks.addKey(24, 12, 12, 12, w); // E
|
|
|
|
ks.addKey(42, 0, 12, 12, B); // F#
|
|
|
|
ks.addKey(36, 12, 12, 12, w); // F
|
|
|
|
ks.addKey(48, 12, 12, 12, W); // G
|
|
|
|
ks.addKey(42, 0, 12, 12, b); // F#
|
|
|
|
ks.addKey(54, 0, 12, 12, B); // G#
|
|
|
|
ks.addKey(48, 12, 12, 12, w); // G
|
|
|
|
ks.addKey(60, 12, 12, 12, W); // A
|
|
|
|
ks.addKey(54, 0, 12, 12, b); // G#
|
|
|
|
ks.addKey(66, 0, 12, 12, B); // A#
|
|
|
|
ks.addKey(60, 12, 12, 12, w); // A
|
|
|
|
ks.addKey(72, 12, 12, 12, W); // B
|
|
|
|
ks.addKey(66, 0, 12, 12, b); // A#
|
|
|
|
|
|
|
|
ks.addKey(72, 12, 12, 12, w); // B
|
|
|
|
|
|
|
|
return ks; |
|
|
|
return ks; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static KeyboardSpec make3Row() { |
|
|
|
public static KeyboardSpec make3Row() { |
|
|
|
KeyboardSpec ks = new KeyboardSpec(24, 84, 32); |
|
|
|
KeyboardSpec ks = new KeyboardSpec(24, 84, 32); |
|
|
|
final int w = Color.WHITE; |
|
|
|
|
|
|
|
final int b = Color.BLACK; |
|
|
|
|
|
|
|
for (int oct = 0; oct < 2; oct++) { |
|
|
|
for (int oct = 0; oct < 2; oct++) { |
|
|
|
float x0 = 42 * oct; |
|
|
|
float x0 = 42 * oct; |
|
|
|
float y1 = 20 - 12 * oct; |
|
|
|
float y1 = 20 - 12 * oct; |
|
|
|
float y2 = 28 - y1; |
|
|
|
float y2 = 28 - y1; |
|
|
|
ks.addKey(x0 + 0, y1, 12, 12, w); // C
|
|
|
|
ks.addKey(x0 + 0, y1, 12, 12, W); // C
|
|
|
|
ks.addKey(x0 + 4, 0, 8, 8, b); // C#
|
|
|
|
ks.addKey(x0 + 4, 0, 8, 8, B); // C#
|
|
|
|
ks.addKey(x0 + 6, y2, 12, 12, w); // D
|
|
|
|
ks.addKey(x0 + 6, y2, 12, 12, W); // D
|
|
|
|
ks.addKey(x0 + 12, 0, 8, 8, b); // D#
|
|
|
|
ks.addKey(x0 + 12, 0, 8, 8, B); // D#
|
|
|
|
ks.addKey(x0 + 12, y1, 12, 12, w); // E
|
|
|
|
ks.addKey(x0 + 12, y1, 12, 12, W); // E
|
|
|
|
ks.addKey(x0 + 18, y2, 12, 12, w); // F
|
|
|
|
ks.addKey(x0 + 18, y2, 12, 12, W); // F
|
|
|
|
ks.addKey(x0 + 21, 0, 8, 8, b); // F#
|
|
|
|
ks.addKey(x0 + 21, 0, 8, 8, B); // F#
|
|
|
|
ks.addKey(x0 + 24, y1, 12, 12, w); // G
|
|
|
|
ks.addKey(x0 + 24, y1, 12, 12, W); // G
|
|
|
|
ks.addKey(x0 + 29, 0, 8, 8, b); // G#
|
|
|
|
ks.addKey(x0 + 29, 0, 8, 8, B); // G#
|
|
|
|
ks.addKey(x0 + 30, y2, 12, 12, w); // A
|
|
|
|
ks.addKey(x0 + 30, y2, 12, 12, W); // A
|
|
|
|
ks.addKey(x0 + 37, 0, 8, 8, b); // A#
|
|
|
|
ks.addKey(x0 + 37, 0, 8, 8, B); // A#
|
|
|
|
ks.addKey(x0 + 36, y1, 12, 12, w); // B
|
|
|
|
ks.addKey(x0 + 36, y1, 12, 12, W); // B
|
|
|
|
} |
|
|
|
} |
|
|
|
return ks; |
|
|
|
return ks; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static KeyboardSpec make3RowChromatic() { |
|
|
|
public static KeyboardSpec make3RowChromatic() { |
|
|
|
KeyboardSpec ks = new KeyboardSpec(12, 12, 9); |
|
|
|
KeyboardSpec ks = new KeyboardSpec(12, 12, 9); |
|
|
|
final int w = Color.WHITE; |
|
|
|
ks.addKey(0, 6, 3, 3, W); // C
|
|
|
|
final int b = Color.BLACK; |
|
|
|
ks.addKey(1, 3, 3, 3, B); // C#
|
|
|
|
ks.addKey(0, 6, 3, 3, w); // C
|
|
|
|
ks.addKey(2, 0, 3, 3, W); // D
|
|
|
|
ks.addKey(1, 3, 3, 3, b); // C#
|
|
|
|
ks.addKey(3, 6, 3, 3, B); // D#
|
|
|
|
ks.addKey(2, 0, 3, 3, w); // D
|
|
|
|
ks.addKey(4, 3, 3, 3, W); // E
|
|
|
|
ks.addKey(3, 6, 3, 3, b); // D#
|
|
|
|
ks.addKey(5, 0, 3, 3, W); // F
|
|
|
|
ks.addKey(4, 3, 3, 3, w); // E
|
|
|
|
ks.addKey(6, 6, 3, 3, B); // F#
|
|
|
|
ks.addKey(5, 0, 3, 3, w); // F
|
|
|
|
ks.addKey(7, 3, 3, 3, W); // G
|
|
|
|
ks.addKey(6, 6, 3, 3, b); // F#
|
|
|
|
ks.addKey(8, 0, 3, 3, B); // G#
|
|
|
|
ks.addKey(7, 3, 3, 3, w); // G
|
|
|
|
ks.addKey(9, 6, 3, 3, W); // A
|
|
|
|
ks.addKey(8, 0, 3, 3, b); // G#
|
|
|
|
ks.addKey(10, 3, 3, 3, B); // A#
|
|
|
|
ks.addKey(9, 6, 3, 3, w); // A
|
|
|
|
ks.addKey(11, 0, 3, 3, W); // B
|
|
|
|
ks.addKey(10, 3, 3, 3, b); // A#
|
|
|
|
|
|
|
|
ks.addKey(11, 0, 3, 3, w); // B
|
|
|
|
|
|
|
|
return ks; |
|
|
|
return ks; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -117,4 +111,7 @@ public class KeyboardSpec { |
|
|
|
public float height; |
|
|
|
public float height; |
|
|
|
public float maxX; |
|
|
|
public float maxX; |
|
|
|
private int ix_; |
|
|
|
private int ix_; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final int B = Color.GRAY; |
|
|
|
|
|
|
|
private static final int W = Color.WHITE; |
|
|
|
} |
|
|
|
} |
|
|
|