Table of Contents

Class FormAnalysisOptions

Namespace
Celeritas.Core.Analysis
Assembly
Celeritas.dll

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

MinRestForPhraseBoundary Rational

Minimum rest (whole-note units) after a note that starts a new phrase.

MinNotesPerPhrase int

Minimum notes a run must contain to count as a phrase.

PeriodLengthTolerance Rational?

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.

DetectCadences bool

Whether to classify the cadence at each phrase end (requires Key).

Key KeySignature?

Key context for cadence detection; no cadences are detected when null.

DetectSections bool

Whether to group phrases into lettered sections (A/B/A').

SectionSimilarityThreshold float

Jaccard 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

FormAnalysisOptions

DetectCadences

Whether to classify the cadence at each phrase end (requires Key).

public bool DetectCadences { get; init; }

Property Value

bool

DetectSections

Whether to group phrases into lettered sections (A/B/A').

public bool DetectSections { get; init; }

Property Value

bool

Key

Key context for cadence detection; no cadences are detected when null.

public KeySignature? Key { get; init; }

Property Value

KeySignature?

MinNotesPerPhrase

Minimum notes a run must contain to count as a phrase.

public int MinNotesPerPhrase { get; init; }

Property Value

int

MinRestForPhraseBoundary

Minimum rest (whole-note units) after a note that starts a new phrase.

public Rational MinRestForPhraseBoundary { get; init; }

Property Value

Rational

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

Rational?

SectionSimilarityThreshold

Jaccard pitch-class similarity (0-1) at or above which two phrases share a section label.

public float SectionSimilarityThreshold { get; init; }

Property Value

float