Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DrumsOneHotConverter

Converts between a quantized NoteSequence containing a drum sequence and the Tensor objects used by MusicRNN.

The Tensor output by toTensor is a 2D one-hot encoding. Each row is a time step, and each column is a one-hot vector where each drum combination is mapped to a single bit of a binary integer representation, where the bit has value 0 if the drum combination is not present, and 1 if it is present.

The expected Tensor in toNoteSequence is the same kind of one-hot encoding as the Tensor output by toTensor.

The output NoteSequence uses quantized time and only the first pitch in pitch class are used.

Hierarchy

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

numSegments

numSegments: number

numSteps

numSteps: number

pitchClasses

pitchClasses: number[][]

pitchToClass

pitchToClass: Map<number, 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