Track ClassΒΆ

Pypianoroll provides the pypianoroll.Track class for handling single-track piano rolls.

class pypianoroll.Track(program=0, is_drum=False, name=None, pianoroll=None)[source]

A container for single-track piano roll.

program

Program number according to General MIDI specification [1]. Defaults to 0 (Acoustic Grand Piano).

Type

int, 0-127, optional

is_drum

Whether it is a percussion track. Defaults to False.

Type

bool, optional

name

Track name.

Type

str, optional

pianoroll

Piano-roll matrix. The first dimension represents time, and the second dimension represents pitch. If dtype is integer, assume the data range is in [0, 255].

Type

ndarray, dtype={bool, int}, shape=(?, 128), optional

References

[1] https://www.midi.org/specifications/item/gm-level-1-sound-set