amads.io.pianoroll

Contents

amads.io.pianoroll#

amads.io.pianoroll(score, y_label='name', x_label='beat', color='skyblue', accidental='sharp', show=True) Figure[source]#

Converts a Score to a piano roll display of a musical score.

Args:
score (Score):

The musical score to display

y_label (str, optional):

Determines whether the y-axis is labeled with note names or MIDI numbers. Valid Input: ‘name’ or ‘num’.

x_label (str, optional):

Determines whether the x-axis is labeled with beats or seconds. Valid input: ‘beat’ or ‘sec’.

color (str, optional):

The color of the note rectangles. Defaults to ‘skyblue’.

accidental (str, optional):

Determines whether the y-axis is labeled with sharps or flats. O nly useful if argument y_label is ‘name’. Raises exception on inputs that’s not ‘sharp’ or ‘flat’.

show (bool, optional):

If True, the plot is displayed. Defaults to True.

Returns:

A matplotlib.figure.Figure of a pianoroll diagram.

Raises:

ValueError: If there are invalid input argument.

Parameters:
  • score (Score)

  • y_label (str)

  • x_label (str)

  • color (str)

  • accidental (str)

  • show (bool)

Return type:

Figure