MusicStructureAnalyzer<T>
Models & Types · AiDotNet.Audio.MusicAnalysis
Music Structure Analyzer that segments songs into structural sections (intro, verse, chorus, etc.).
Inheritance: NeuralNetworkBase<T> → AudioNeuralNetworkBase<T> → MusicStructureAnalyzer<T>
For Beginners
This model listens to a song and identifies its sections - where the verse begins, where the chorus kicks in, and where the bridge or outro happens. It’s like creating an automatic table of contents for a song.
Usage:
How It Works
The Music Structure Analyzer segments songs into structural sections (intro, verse, chorus, bridge, outro) using a neural network trained on annotated music datasets. It combines self-similarity matrix features with a segmentation network.
Constructors
| Constructor | Summary |
|---|---|
MusicStructureAnalyzer(NeuralNetworkArchitecture<T> architecture, MusicStructureAnalyzerOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) |
Creates a Music Structure Analyzer in native training mode. |
MusicStructureAnalyzer(NeuralNetworkArchitecture<T> architecture, string modelPath, MusicStructureAnalyzerOptions options) |
Creates a Music Structure Analyzer in ONNX inference mode. |
Properties
| Property | Summary |
|---|---|
int NumSections { get; } |
Gets the number of structural sections. |
string[] SectionLabels { get; } |
Gets the section labels this model can detect. |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<MusicSegment<T>> AnalyzeStructure(Tensor<T> audio) |
Analyzes the structure of a song, returning labeled time segments. |
ModelMetadata<T> GetModelMetadata() |
|
Task<IReadOnlyList<MusicSegment<T>>> AnalyzeStructureAsync(Tensor<T> audio, CancellationToken cancellationToken) |
Analyzes music structure asynchronously. |
Tensor<T> GetSectionProbabilities(Tensor<T> audio) |
Gets per-frame section probabilities. |