Options
All
  • Public
  • Public/Protected
  • All
Menu

Main "Onsets And Frames" piano transcription model class.

Hierarchy

  • OnsetsAndFrames

Index

Constructors

constructor

  • new OnsetsAndFrames(checkpointURL: string, chunkLength?: number): OnsetsAndFrames
  • OnsetsAndFrames constructor.

    Parameters

    • checkpointURL: string

      Path to the checkpoint directory.

    • Default value chunkLength: number = 250

      The length of chunks (excluding receptive field padding). Sequences longer than this amount will be split into batches of this size for processing.

    Returns OnsetsAndFrames

Properties

chunkLength

chunkLength: number

Methods

dispose

  • dispose(): void

initialize

  • initialize(): Promise<void>

isInitialized

  • isInitialized(): boolean

transcribeFromAudioBuffer

  • transcribeFromAudioBuffer(audioBuffer: AudioBuffer, batchSize?: number): Promise<INoteSequence>
  • Transcribes a piano performance from audio buffer.

    Parameters

    • audioBuffer: AudioBuffer

      An audio buffer to transcribe.

    • Default value batchSize: number = 4

      The number of chunks to compute in parallel. May need to be reduced if hitting a timeout in the browser.

    Returns Promise<INoteSequence>

    A NoteSequence containing the transcribed piano performance.

transcribeFromAudioFile

  • transcribeFromAudioFile(blob: Blob): Promise<INoteSequence>
  • Transcribes a piano performance from an audio file.

    Parameters

    • blob: Blob

      An audio file blob to transcribe.

    Returns Promise<INoteSequence>

    A NoteSequence containing the transcribed piano performance.

transcribeFromAudioURL

  • transcribeFromAudioURL(url: string): Promise<INoteSequence>
  • Transcribes a piano performance from an audio file ULR.

    Parameters

    • url: string

      The url of the file to transcribe.

    Returns Promise<INoteSequence>

    A NoteSequence containing the transcribed piano performance.

transcribeFromMelSpec

  • transcribeFromMelSpec(melSpec: number[][], parallelBatches?: number): Promise<INoteSequence>
  • Transcribes a piano performance from a mel spectrogram.

    Parameters

    • melSpec: number[][]

      A mel spectrogram shaped [frame, bin].

    • Default value parallelBatches: number = 4

      The number of convolutional batches to compute in parallel. May need to be reduced if hitting a timeout in the browser.

    Returns Promise<INoteSequence>

    A NoteSequence containing the transcribed piano performance.

Generated using TypeDoc