Class FormAnalysisOptions
Options controlling FormAnalyzer phrase, period, cadence, and section detection.
public sealed record FormAnalysisOptions : IEquatable<FormAnalysisOptions>
- Inheritance
-
FormAnalysisOptions
- Implements
- Inherited Members
Constructors
FormAnalysisOptions(Rational, int, Rational?, bool, KeySignature?, bool, float)
Options controlling FormAnalyzer phrase, period, cadence, and section detection.
public FormAnalysisOptions(Rational MinRestForPhraseBoundary, int MinNotesPerPhrase = 2, Rational? PeriodLengthTolerance = null, bool DetectCadences = true, KeySignature? Key = null, bool DetectSections = true, float SectionSimilarityThreshold = 0.7)
Parameters
MinRestForPhraseBoundaryRationalMinimum rest (whole-note units) after a note that starts a new phrase.
MinNotesPerPhraseintMinimum notes a run must contain to count as a phrase.
PeriodLengthToleranceRational?Maximum length difference (whole-note units) for two adjacent phrases to form a period; null falls back to the value from
Default(1/4). An explicit Zero is honored and requires exactly equal phrase lengths.DetectCadencesboolWhether to classify the cadence at each phrase end (requires
Key).KeyKeySignature?Key context for cadence detection; no cadences are detected when null.
DetectSectionsboolWhether to group phrases into lettered sections (A/B/A').
SectionSimilarityThresholdfloatJaccard pitch-class similarity (0-1) at or above which two phrases share a section label.
Properties
Default
Default options: 1/2 phrase-boundary rest, 2 notes/phrase, 1/4 period tolerance, cadence and section detection on, 0.7 section similarity.
public static FormAnalysisOptions Default { get; }
Property Value
DetectCadences
Whether to classify the cadence at each phrase end (requires Key).
public bool DetectCadences { get; init; }
Property Value
DetectSections
Whether to group phrases into lettered sections (A/B/A').
public bool DetectSections { get; init; }
Property Value
Key
Key context for cadence detection; no cadences are detected when null.
public KeySignature? Key { get; init; }
Property Value
MinNotesPerPhrase
Minimum notes a run must contain to count as a phrase.
public int MinNotesPerPhrase { get; init; }
Property Value
MinRestForPhraseBoundary
Minimum rest (whole-note units) after a note that starts a new phrase.
public Rational MinRestForPhraseBoundary { get; init; }
Property Value
PeriodLengthTolerance
Maximum length difference (whole-note units) for two adjacent phrases to form a period; null falls back to the value from Default (1/4). An explicit Zero is honored and requires exactly equal phrase lengths.
public Rational? PeriodLengthTolerance { get; init; }
Property Value
SectionSimilarityThreshold
Jaccard pitch-class similarity (0-1) at or above which two phrases share a section label.
public float SectionSimilarityThreshold { get; init; }