IChordRecognizer<T>
Interfaces · AiDotNet.Interfaces
Interface for chord recognition models that identify musical chords in audio.
For Beginners
Chord recognition is like having a musician listen to a song and tell you what chords are being played.
How it works:
- Audio is converted to a chromagram (12 pitch classes)
- The pitch content is compared to known chord templates
- The best-matching chord is selected for each time frame
What are chords?
- A chord is multiple notes played together
- “C major” = C + E + G notes together
- “A minor” = A + C + E notes together
- The chord creates the harmony of the music
Common use cases:
- Learning songs (getting chord charts automatically)
- Music production (analyzing harmony)
- Music generation (understanding structure)
- Cover song detection (comparing harmonic content)
How It Works
Chord recognition analyzes audio to identify the musical chords being played. This involves detecting the simultaneous notes and classifying them into standard chord types (major, minor, seventh, etc.).
Properties
| Property | Summary |
|---|---|
IReadOnlyList<string> SupportedChordTypes { get; } |
Gets the list of chord types this model can recognize. |
double TimeResolution { get; } |
Gets the time resolution for chord detection in seconds. |
int SampleRate { get; } |
Gets the expected sample rate for input audio. |
Methods
| Method | Summary |
|---|---|
ChordRecognitionResult<T> Recognize(Tensor<T> audio) |
Recognizes chords in audio. |
IReadOnlyList<string> GetChordNotes(string chordSymbol) |
Converts a chord symbol to its component notes. |
Task<ChordRecognitionResult<T>> RecognizeAsync(Tensor<T> audio, CancellationToken cancellationToken) |
Recognizes chords asynchronously. |
Tensor<T> ExtractChromagram(Tensor<T> audio) |
Extracts chromagram features from audio. |
Tensor<T> GetChordProbabilities(Tensor<T> audio) |
Gets chord probabilities for each time frame. |