Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PianoGenieAutoregressiveDeltaTimeKeysig
    • PianoGenieKeysig

Index

Constructors

constructor

Methods

dispose

  • dispose(): void

Protected getRnnInputFeats

  • getRnnInputFeats(): Tensor<R1>

initialize

  • initialize(staticVars?: tf.NamedTensorMap): Promise<void>

isInitialized

  • isInitialized(): boolean

next

  • next(button: number, temperature?: number, seed?: number): number
  • Given a button number with optional sampling temperature and seed, evaluates Piano Genie to produce a piano key note {0, 1, ... 87}. This is the simplest access point for Piano Genie, designed to be called by your application in real time (it keeps track of time internally).

    Parameters

    • button: number

      Button number (one of {0, 1, 2, 3, 4, 5, 6, 7}).

    • Optional temperature: number

      Temperature. From 0 to 1, goes from argmax to random.

    • Optional seed: number

      Random seed. Use a fixed number to get reproducible output.

    Returns number

nextFromKeyList

  • nextFromKeyList(button: number, keyList: number[], temperature?: number, seed?: number): number
  • Given a button number and a list of piano keys, evaluates Piano Genie to produce a piano key note {0, 1, ..., 87}. Use this if you would like to restrict Piano Genie's outputs to a subset of the keys (e.g. a particular scale or range of the piano). For example, if you wanted to restrict Piano Genie's outputs to be C major from middle C to one octave above, you would pass [39, 41, 43, 44, 46, 48, 50, 51] as the list.

    Parameters

    • button: number

      Button number (one of {0, 1, 2, 3, 4, 5, 6, 7}).

    • keyList: number[]

      Subset of keys restricting possible note outputs.

    • Optional temperature: number

      Temperature. From 0 to 1, goes from argmax to random.

    • Optional seed: number

      Random seed. Use a fixed number to get reproducible output.

    Returns number

nextFromKeyWhitelist

  • nextFromKeyWhitelist(button: number, keyList: number[], temperature?: number, seed?: number): number

nextWithCustomSamplingFunction

  • nextWithCustomSamplingFunction(button: number, sampleFunc: (logits: tf.Tensor1D) => tf.Scalar): number

overrideDeltaTime

  • overrideDeltaTime(deltaTime: number): void
  • Overrides the model's internal clock with a designated time. Mainly used to test the model, but can also be used to remove user control over note timing or to run preprogrammed sequences through the model.

    Parameters

    • deltaTime: number

      Amount of elapsed time in seconds since previous note.

    Returns void

overrideLastOutput

  • overrideLastOutput(lastOutput: number): void
  • Overrides the model's state for its last output. Mainly used to test the model, but can also be used in combination with custom sampling behavior.

    Parameters

    • lastOutput: number

      Previous piano key sampled from the model logits.

    Returns void

resetState

  • resetState(): void

setKeySignature

Generated using TypeDoc