Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • GANSynth

Index

Constructors

constructor

  • new GANSynth(checkpointURL: string): GANSynth

Properties

maxMidiPitch

maxMidiPitch: 84 = 84

midiPitches

midiPitches: number = this.maxMidiPitch - this.minMidiPitch + 1

minMidiPitch

minMidiPitch: 24 = 24

nLatents

nLatents: 256 = 256

nPitches

nPitches: 61 = 61

Methods

dispose

  • dispose(): void

initialize

  • initialize(): Promise<void>
  • Loads variables from the checkpoint and builds the model graph.

    Returns Promise<void>

isInitialized

  • isInitialized(): boolean

predict

  • predict(inputs: tf.Tensor4D, batchSize: number): Tensor<R4>
  • Predicts LogMelMagnitudes and IFreq from latent (z) and pitch conditioning.

    Parameters

    • inputs: tf.Tensor4D

      A 4-D Tensor of latent (z) concatenated with one-hot pitch conditioning. Size [batch, 1, 1, nLatents].

    • batchSize: number

      Size of input batch.

    Returns Tensor<R4>

    a 4-D Tensor size [batch, time, freq, ch]. First channel is LogMelSpectrogram and second channel is InstantaneousFrequency.

randomSample

  • randomSample(pitch: number): Tensor<R4>
  • Creates one random sample of LogMelSpecgram and IFreq from integer pitch.

    Parameters

    • pitch: number

      Integer MIDI pitch number of sound to generate.

    Returns Tensor<R4>

    specgrams a 4-D Tensor size [batch, time, freq, ch]. First channel is LogMelSpectrogram and second channel is InstantaneousFrequency.

specgramsToAudio

  • specgramsToAudio(specgrams: tf.Tensor4D): Promise<Float32Array>
  • Include specgramsToAudio as a member method for API/export.

    Parameters

    • specgrams: tf.Tensor4D

      a 4-D Tensor size [batch, time, freq, ch]. First channel is LogMelSpectrogram and second channel is InstantaneousFrequency.

    Returns Promise<Float32Array>

    Float32Array of audio samples for first specgram in the batch.

Generated using TypeDoc