Options
All
  • Public
  • Public/Protected
  • All
Menu

Main MusicRNN model class.

A MusicRNN is an LSTM-based language model for musical notes.

Hierarchy

  • MusicRNN

Index

Constructors

constructor

  • MusicRNN constructor.

    Parameters

    • checkpointURL: string

      Path to the checkpoint directory.

    • Optional spec: MusicRNNSpec

      (Optional) MusicRNNSpec object. If undefined, will be loaded from a config.json file in the checkpoint directory.

    Returns MusicRNN

Methods

continueSequence

  • continueSequence(sequence: INoteSequence, steps: number, temperature?: number, chordProgression?: string[]): Promise<INoteSequence>
  • Continues a provided quantized NoteSequence.

    Parameters

    • sequence: INoteSequence

      The sequence to continue. Must be quantized.

    • steps: number

      How many steps to continue.

    • Optional temperature: number

      (Optional) The softmax temperature to use when sampling from the logits. Argmax is used if not provided. Temperature can be any number value above 0, however, anything above 1.5 will essentially result in random results.

    • Optional chordProgression: string[]

      (Optional) Chord progression to use as conditioning. A chord progression param is an array of chords that are passed to the tonal package for parsing, so they're in that format. Example: ["G", "Em", "C", "D"]

    Returns Promise<INoteSequence>

continueSequenceAndReturnProbabilities

  • continueSequenceAndReturnProbabilities(sequence: INoteSequence, steps: number, temperature?: number, chordProgression?: string[]): Promise<{ probs: Float32Array[]; sequence: Promise<INoteSequence> }>
  • Continues a provided quantized NoteSequence, and returns the computed probability distribution at each step.

    Parameters

    • sequence: INoteSequence

      The sequence to continue. Must be quantized.

    • steps: number

      How many steps to continue.

    • Optional temperature: number

      (Optional) The softmax temperature to use when sampling from the logits. Argmax is used if not provided.

    • Optional chordProgression: string[]

      (Optional) Chord progression to use as conditioning.

    Returns Promise<{ probs: Float32Array[]; sequence: Promise<INoteSequence> }>

dispose

  • dispose(): void

initialize

  • initialize(): Promise<void>
  • Loads variables from the checkpoint and instantiates the Encoder and Decoder.

    Returns Promise<void>

isInitialized

  • isInitialized(): boolean

Generated using TypeDoc