feat: implemented the logic to automatically create a chord when a suitable guide chord is highlighted.
This commit is contained in:
@@ -17,6 +17,9 @@ export class KGPianoRollState {
|
||||
// Chord guide state
|
||||
private currentSuitableChords: Record<string, string[]> = {}; // Map of chord symbols to note names (e.g., {"I": ["C", "E", "G"]})
|
||||
private currentSuitableChordsPitchClasses: Record<string, number[]> = {}; // Map of chord symbols to pitch classes (e.g., {"I": [0, 4, 7]})
|
||||
private currentMatchingChords: number[][] = [];
|
||||
private currentSelectedChordIndex: number = 0;
|
||||
private currentChordCursorPitch: number | null = null;
|
||||
|
||||
private constructor() {
|
||||
console.log("KGPianoRollState initialized");
|
||||
@@ -77,4 +80,28 @@ export class KGPianoRollState {
|
||||
public setCurrentSuitableChordsPitchClasses(chordsPitchClasses: Record<string, number[]>): void {
|
||||
this.currentSuitableChordsPitchClasses = chordsPitchClasses;
|
||||
}
|
||||
|
||||
public getCurrentMatchingChords(): number[][] {
|
||||
return this.currentMatchingChords;
|
||||
}
|
||||
|
||||
public setCurrentMatchingChords(chords: number[][]): void {
|
||||
this.currentMatchingChords = chords;
|
||||
}
|
||||
|
||||
public getCurrentSelectedChordIndex(): number {
|
||||
return this.currentSelectedChordIndex;
|
||||
}
|
||||
|
||||
public setCurrentSelectedChordIndex(index: number): void {
|
||||
this.currentSelectedChordIndex = index;
|
||||
}
|
||||
|
||||
public getCurrentChordCursorPitch(): number | null {
|
||||
return this.currentChordCursorPitch;
|
||||
}
|
||||
|
||||
public setCurrentChordCursorPitch(pitch: number | null): void {
|
||||
this.currentChordCursorPitch = pitch;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user