API / MusicTheory
ChordFinder static class
Provides methods for identifying chords from a set of notes. Given any collection of notes (regardless of octave or order), returns all matching
ChordTypes and root candidates.This is useful for: - Chord recognition in MIDI input or notation parsing - Building chord-suggestion features in music apps - Identifying slash chords (first/second inversion) from raw note sets
Methods
static ChordMatch? BestMatch(IEnumerable<Note> notes)The best single match: fewest extra notes, then the richest chord type; null when nothing matches.
static IEnumerable<ChordMatch> Identify(IEnumerable<Note> notes)Identifies all chord types that match a given set of pitch-class integers (0–11). Each entry in the result represents a possible root + chord type interpretation.
notes- The notes to identify. Octave information is ignored — only pitch class is used. Duplicates and unison octaves are collapsed.
Returns An enumerable of ChordMatch ordered by confidence (more specific chords — i.e. those requiring fewer "missing" tones — rank higher). Returns an empty enumerable if no chord is identified.
Throws ArgumentNullException notes is null or contains null.
static IEnumerable<ChordMatch> IdentifyFromPitchClasses(IEnumerable<int> pitchClasses)Identifies chords from pitch classes (0 = C … 11 = B, any integer is reduced modulo 12). Black keys are spelled C#, Eb, F#, Ab, Bb.