Converts between a quantized NoteSequence containing a drum sequence
and the Tensor objects used by MusicVAE.
The Tensor output by toTensor is a 2D "drum roll" format. Each
row is a time step, and each column (up to the final) is a vector of Booleans
representing whether a drum from the associated pitch class is being hit at
that time. The final column is a Boolean computed by taking a NOR of the
other columns in the row.
The expected Tensor in toNoteSequence is a one-hot encoding of labels
generated by converting the bit string from the input (excluding the final
bit) to an integer.
The output NoteSequence uses quantized time and only the first pitch in
pitch class are used.
param
The length of each sequence.
param
(Optional) The number of conductor segments, if
applicable.
param
(Optional) An array of arrays, grouping together MIDI
pitches to treat as the same drum. The first pitch in each class will be used
in the NoteSequence returned by toNoteSequence. A default mapping to 9
classes is used if not provided.
Converts between a quantized
NoteSequencecontaining a drum sequence and theTensorobjects used byMusicVAE.The
Tensoroutput bytoTensoris a 2D "drum roll" format. Each row is a time step, and each column (up to the final) is a vector of Booleans representing whether a drum from the associated pitch class is being hit at that time. The final column is a Boolean computed by taking a NOR of the other columns in the row.The expected
TensorintoNoteSequenceis a one-hot encoding of labels generated by converting the bit string from the input (excluding the final bit) to an integer.The output
NoteSequenceuses quantized time and only the first pitch in pitch class are used.The length of each sequence.
(Optional) The number of conductor segments, if applicable.
(Optional) An array of arrays, grouping together MIDI pitches to treat as the same drum. The first pitch in each class will be used in the
NoteSequencereturned bytoNoteSequence. A default mapping to 9 classes is used if not provided.