OnsetsAndFramesOptions

Options & Configuration · AiDotNet.Audio.MusicAnalysis

Configuration options for the Onsets and Frames piano transcription model.

Inheritance: ModelOptions → OnsetsAndFramesOptions

For Beginners

Onsets and Frames listens to piano music and writes down which notes are being played and when. It detects two things: “onsets” (when a key is pressed) and “frames” (which keys are held down at each moment). By combining both, it produces accurate note-by-note transcriptions of piano recordings.

How It Works

Onsets and Frames (Hawthorne et al., 2018, Google Magenta) jointly predicts onsets and frame-level note activations for automatic piano transcription. The model uses a CNN front-end with bidirectional LSTMs, and was trained on the MAESTRO dataset. It achieves frame-level note F1 of ~90% on piano recordings.

Constructors

Constructor Summary
OnsetsAndFramesOptions()

Properties

Property Summary
OnnxModelOptions OnnxOptions { get; set; } Gets or sets the ONNX runtime options.
double DropoutRate { get; set; } Gets or sets the dropout rate.
double FMax { get; set; } Gets or sets the maximum frequency for the mel filterbank.
double FMin { get; set; } Gets or sets the minimum frequency for the mel filterbank.
double FrameThreshold { get; set; } Gets or sets the frame (note held) detection threshold.
double LearningRate { get; set; } Gets or sets the learning rate for training.
double MinNoteDurationSec { get; set; } Gets or sets the minimum note duration in seconds.
double OnsetThreshold { get; set; } Gets or sets the onset detection threshold.
int AcousticModelDim { get; set; } Gets or sets the acoustic model CNN feature dimension.
int FftSize { get; set; } Gets or sets the FFT window size in samples.
int HopLength { get; set; } Gets or sets the hop length between frames in samples.
int LstmHiddenSize { get; set; } Gets or sets the bidirectional LSTM hidden size.
int MidiOffset { get; set; } Gets or sets the lowest MIDI note (A0 = 21).
int NumLstmLayers { get; set; } Gets or sets the number of LSTM layers.
int NumMels { get; set; } Gets or sets the number of mel filterbank channels.
int NumMidiNotes { get; set; } Gets or sets the number of MIDI notes (88 piano keys: A0=21 to C8=108).
int SampleRate { get; set; } Gets or sets the expected audio sample rate in Hz.
string ModelPath { get; set; } Gets or sets the path to the ONNX model file.