Converts between a quantized multitrack NoteSequence and Tensor objects
used by MusicVAE.
Each track is represented using events from the following vocabulary:
An initial program-select event specifying which MIDI program to use.
A sequence of performance (note-on, note-off, time-shift,
velocity-change) events.
An end token.
Tracks are ordered by program number with drums at the end, then one-hot
encoded and padded with zeros to the maximum number of events. If fewer
than the maximum number of tracks are present, extra tracks consisting of
only an end token (then one-hot encoded and zero-padded) will be added.
param
The total number of events used to encode each
NoteSequence.
param
The number of tracks to use. NoteSequences with more
tracks will have tracks removed. NoteSequences with fewer tracks will be
padded with empty tracks.
param
The number of time steps per quarter note.
param
The length of each NoteSequence in time steps. Longer
NoteSequences will be truncated. Shorter NoteSequences will be padded
with silence.
param
The number of bins into which to quantize note
velocities.
param
(Optional) Minimum MIDI pitch to allow. Will be 0 if not
specified.
param
(Optional) Maximum MIDI pitch to allow. Will be 127 if not
specified.
Converts between a quantized multitrack
NoteSequence
andTensor
objects used byMusicVAE
.Each track is represented using events from the following vocabulary:
Tracks are ordered by program number with drums at the end, then one-hot encoded and padded with zeros to the maximum number of events. If fewer than the maximum number of tracks are present, extra tracks consisting of only an end token (then one-hot encoded and zero-padded) will be added.
The total number of events used to encode each
NoteSequence
.The number of tracks to use.
NoteSequence
s with more tracks will have tracks removed.NoteSequence
s with fewer tracks will be padded with empty tracks.The number of time steps per quarter note.
The length of each
NoteSequence
in time steps. LongerNoteSequence
s will be truncated. ShorterNoteSequence
s will be padded with silence.The number of bins into which to quantize note velocities.
(Optional) Minimum MIDI pitch to allow. Will be 0 if not specified.
(Optional) Maximum MIDI pitch to allow. Will be 127 if not specified.