package sound;
public class Scales {
private static int CHROMATIC[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
private static int IONIAN[] = {
2, 2, 1, 2, 2, 2, 1
};
protected static int HARMONIC_MINOR[] = {
2, 1, 2, 2, 1, 3, 1
};
private static int GYPSY[] = {
1, 3, 1, 1, 2, 1, 3, 1
};
public static void testPlayScale() {
Utils.play(getScale(GYPSY, 64), 500);
Utils.play(getScale(HARMONIC_MINOR, 32), 500);
}
public static int[] getScale(
int progression[], int startNote) {
int scale[] = new int[progression.length];
for (int i = 0; i < progression.length; i++) {
scale[i] = startNote + progression[i];
startNote = scale[i];
}
return scale;
}
public static int[] getScale(
int progression[], int startNote, int endNote) {
int scale[] = new int[endNote - startNote];
for (int i = 0; i < scale.length; i++) {
scale[i] = startNote + progression[i % progression.length];
startNote = scale[i % scale.length];
}
return scale;
}
}