IMusicTranscriber<T>

Interfaces · AiDotNet.Interfaces

Defines the contract for automatic music transcription (audio to notes).

Known implementations: BasicPitch<T>, MT3<T>, OnsetsAndFrames<T>

For Beginners

Music transcription is like having a computer “listen” to music and write down the notes. The output is similar to sheet music data:

  • Which note is playing (e.g., C4, A#3)
  • When each note starts and stops
  • How loud each note is (velocity)

This is used for:

  • Converting recordings to MIDI files
  • Music education (showing what notes are played)
  • Music analysis and research
  • Karaoke systems

How It Works

Music transcription converts audio recordings into symbolic note representations (like MIDI). It detects what notes are played, when they start and end, and optionally their velocity.

Properties

Property Summary
int MidiOffset { get; } Gets the MIDI offset (lowest MIDI note number, e.g., 21 for A0).
int NumMidiNotes { get; } Gets the number of MIDI notes this transcriber can detect.

Methods

Method Summary
IReadOnlyList<TranscribedNote<T>> ExtractNotes(Tensor<T> frameActivations, Tensor<T> onsetActivations, double frameThreshold, double onsetThreshold) Extracts notes from frame and onset activations using post-processing.
IReadOnlyList<TranscribedNote<T>> Transcribe(Tensor<T> audio) Transcribes audio into a list of detected notes.
Task<IReadOnlyList<TranscribedNote<T>>> TranscribeAsync(Tensor<T> audio, CancellationToken cancellationToken) Transcribes audio asynchronously.
Tensor<T> GetFrameActivations(Tensor<T> audio) Gets frame-level note activations (piano roll representation).
Tensor<T> GetOnsetActivations(Tensor<T> audio) Gets frame-level onset activations.