Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MelodyShapeConverter

Converts between a monophonic, quantized NoteSequence containing a melody and a Tensor representing only the shape of the melody.

The shape is represented as a [numSteps, 3]-shaped Tensor containing a one-hot Parsons code, where 0 = descending pitch, 1 = same pitch, and 2 = ascending pitch.

Since the melody cannot be reconstructed from its shape alone, toNoteSequence returns a NoteSequence having the shape of the contour with a note at each time step.

Hierarchy

  • MelodyControlConverter
    • MelodyShapeConverter

Index

Constructors

constructor

Properties

NUM_SPLITS

NUM_SPLITS: number = 0

SEGMENTED_BY_TRACK

SEGMENTED_BY_TRACK: boolean = false

depth

depth: number

endTensor

endTensor: tf.Tensor1D

ignorePolyphony

ignorePolyphony: boolean

maxPitch

maxPitch: number

melodyControl

melodyControl: MelodyControl

minPitch

minPitch: number

numSegments

numSegments: number

numSteps

numSteps: number

Methods

tensorSteps

  • tensorSteps(tensor: tf.Tensor2D): tf.Scalar

toNoteSequence

  • toNoteSequence(oh: tf.Tensor2D, stepsPerQuarter?: number, qpm?: number): Promise<NoteSequence>

toTensor

  • toTensor(noteSequence: INoteSequence): tf.Tensor2D

Generated using TypeDoc