private static bool IsMatchChordAt(int[] notes, int currentNote, Chord chordToMatch) { Chord scale = new Chord(notes); Chord scaleWithOffset = scale.GetKeyModulatedScaleNormalizedToZero(currentNote); bool isMatchChordAtPosition = scaleWithOffset.ContainsChord(chordToMatch); return(isMatchChordAtPosition); }
private bool IsMatchChordAt(Chord scale, Chord chordToMatch, int notePosition, bool isEnableMultipleSameSizeChordOnSameRootNote, IEnumerable <Chord> allChords) { Chord scaleWithOffset = scale.GetKeyModulatedScaleNormalizedToZero(notePosition); bool isMatchChordAtPosition = scaleWithOffset.ContainsChord(chordToMatch); if (isMatchChordAtPosition && !isEnableMultipleSameSizeChordOnSameRootNote) { foreach (Chord otherChord in allChords) { if (otherChord != chordToMatch && otherChord.Length == chordToMatch.Length) { if (scaleWithOffset.ContainsChord(otherChord)) { return(false); } } } } return(isMatchChordAtPosition); }