Pypianoroll Classes
We provide several classes for working with multitrack piano rolls.
pypianoroll.Multitrack
: A multitrack that stores track(s) along with global information.pypianoroll.Track
: A track that stores the a piano roll along with track information.pypianoroll.StandardTrack
: A standard track that holds a piano roll with velocity information.pypianoroll.BinaryTrack
: A binary track that holds a piano roll without velocity information.
Multitrack Class
Attribute |
Description |
Type |
Default |
---|---|---|---|
name |
Name of the multitrack |
str |
|
resolution |
Time steps per quarter note |
int |
|
tempo |
Tempo at each time step |
NumPy array of dtype float |
|
downbeat |
Downbeat positions |
NumPy array of dtype bool |
|
tracks |
Music tracks |
list of |
[] |
Track Class
Attribute |
Description |
Type |
Default |
---|---|---|---|
name |
Name of the track |
str |
|
program |
MIDI program number |
int |
|
is_drum |
If it is a drum track |
bool |
|
pianoroll |
Downbeat positions |
NumPy array |
|
For pypianoroll.StandardTrack
, the piano roll array must be of data type uint8 and take values in [0, 127]. For pypianoroll.BinaryTrack
, the piano roll array must be of data type bool.