Class MelodyAnalyzer
Melody analysis engine - analyzes contour, intervals, and detects motifs.
public static class MelodyAnalyzer
- Inheritance
-
MelodyAnalyzer
- Inherited Members
Fields
IntervalNames
Named intervals for display.
public static readonly FrozenDictionary<int, string> IntervalNames
Field Value
Methods
Analyze(NoteBuffer)
Analyze a melody from a NoteBuffer.
public static MelodyAnalysisResult Analyze(NoteBuffer buffer)
Parameters
bufferNoteBuffer
Returns
Exceptions
- ArgumentNullException
bufferis null.
Analyze(int[], Rational[]?)
Analyze a melody from pitch array. When times is supplied, each note's
onset is used for Occurrences; otherwise occurrences are reported as
sequential note positions (index i as i/1), since no timing is known.
public static MelodyAnalysisResult Analyze(int[] pitches, Rational[]? times = null)
Parameters
Returns
Exceptions
- ArgumentNullException
pitchesis null.- ArgumentException
timesis non-null and its length differs frompitches.
ClassifyMotion(int)
Classify the type of melodic motion based on interval size.
public static MelodicMotionType ClassifyMotion(int absSemitones)
Parameters
absSemitonesint
Returns
GetIntervalName(int)
Get a human-readable name for an interval.
public static string GetIntervalName(int semitones)
Parameters
semitonesint