int[] GetChordIntervals(Chord_Type type) { if (type == Chord_Type.MAJ) { return(majIntervals); } else if (type == Chord_Type.MAJ7) { return(maj7Intervals); } else if (type == Chord_Type.MIN) { return(minIntervals); } else if (type == Chord_Type.MIN7) { return(min7Intervals); } else if (type == Chord_Type.MIN9) { return(min9Intervals); } else if (type == Chord_Type.DOM7) { return(dom7Intervals); } return(majIntervals); }
public Chord(Scale scale, int rootScaleDegree, Chord_Type type) { int[] chordIntervals = GetChordIntervals(type); referenceScale = scale; notes = new int[chordIntervals.Length + 1]; scaleDegree = rootScaleDegree - 1; root = scale.notes[scaleDegree]; notes [0] = root; for (int i = 0; i < chordIntervals.Length; i++) { notes [i + 1] = Scale.allNotes [(root + chordIntervals[i]) % Scale.allNotes.Length]; } }