1
package org.herac.tuxguitar.gui.editors.chord;
4
* Stores the information about the chord name, structure and
5
* alteration abilities into a list
7
* @author Nikola Kolarovic <nikola.kolarovic@gmail.com>
10
public class ChordDatabase {
13
* fills all the necessary data into chords List consisted out of ChordInfo-s
15
* If you want to change it, please contact me on
16
* nikola.kolarovic@gmail.com
18
private static final ChordInfo[] data = new ChordInfo[]{
20
// Major--------------------------
21
new ChordInfo("M",new int[]{ 1, 5, 8 }),
23
// 7--------------------------
24
new ChordInfo("7",new int[]{ 1, 5, 8, 11 }),
26
// 7M--------------------------
27
// hard-coded index used in ChordRecognizer, below comment "determine seventh", line 315 now
28
new ChordInfo("maj7",new int[]{ 1, 5, 8, 12 }),
30
// 6--------------------------
31
new ChordInfo("6",new int[]{ 1, 5, 8, 10 }),
33
// m--------------------------
34
// index 4 hard-coded in ChordRecognizer line 220, so it is not so unusual
35
new ChordInfo("m",new int[]{ 1, 4, 8 }),
37
// m7--------------------------
38
new ChordInfo("m7",new int[]{ 1, 4, 8, 11 }),
40
// m7M--------------------------
41
new ChordInfo("m/maj7",new int[]{ 1, 4, 8, 12 }),
43
// m6--------------------------
44
new ChordInfo("m6",new int[]{ 1, 4, 8, 10 }),
46
// sus2--------------------------
47
new ChordInfo("sus2",new int[]{ 1, 3, 8 }),
49
// sus4--------------------------
50
new ChordInfo("sus4",new int[]{ 1, 6, 8 }),
52
// 7sus2--------------------------
53
new ChordInfo("7sus2",new int[]{ 1, 3, 8, 11 }),
55
// 7sus4--------------------------
56
new ChordInfo("7sus4",new int[]{ 1, 6, 8, 11 }),
58
// below indexes are hard-coded in ChordRecognizer line 311 now
60
// dim--------------------------
61
new ChordInfo("dim",new int[]{ 1, 4, 7 }),
63
// dim7--------------------------
64
new ChordInfo("dim7",new int[]{ 1, 4, 7, 10 }),
66
// aug--------------------------
67
new ChordInfo("aug",new int[]{ 1, 5, 9 }),
69
// 5--------------------------
70
// index <last> hard-coded in ChordRecognizer line 220, so it is not so unusual
71
new ChordInfo("5",new int[]{ 1, 8 }),
75
public static int length(){
79
public static ChordInfo get(int index){
83
/** chord data structure, contains all info for chord formation **/
84
public static class ChordInfo {
87
private int[] requiredNotes;
89
public ChordInfo(String name,int[] requiredNotes){
91
this.requiredNotes = requiredNotes;
94
public String getName() {
98
public int[] getRequiredNotes() {
99
return this.requiredNotes;
102
public int[] cloneRequireds() {
103
int[] requiredNotes = new int[this.requiredNotes.length];
104
for(int i = 0; i < requiredNotes.length; i ++){
105
requiredNotes[i] = this.requiredNotes[i];
107
return requiredNotes;
b'\\ No newline at end of file'