Spaces:
Build error
Build error
Commit ·
14ec4f5
1
Parent(s): 5c6ebe7
Changes in piano roll
Browse files
utils.py
CHANGED
|
@@ -158,12 +158,7 @@ def dataframe_to_pianoroll_img(df):
|
|
| 158 |
ax = fig.add_subplot(111)
|
| 159 |
ax.scatter(df.start_time, df.pitch, c="white")
|
| 160 |
for _, row in df.iterrows():
|
| 161 |
-
ax.add_patch(Rectangle(
|
| 162 |
-
(row["start_time"], row["pitch"]-0.4),
|
| 163 |
-
row["duration"], 0.4, color="black"
|
| 164 |
-
))
|
| 165 |
-
ax.set_xlim(0, 25)
|
| 166 |
-
ax.set_ylim(30, 100)
|
| 167 |
plt.xlabel('Seconds', fontsize=18)
|
| 168 |
plt.ylabel('MIDI pitch', fontsize=16)
|
| 169 |
return fig
|
|
|
|
| 158 |
ax = fig.add_subplot(111)
|
| 159 |
ax.scatter(df.start_time, df.pitch, c="white")
|
| 160 |
for _, row in df.iterrows():
|
| 161 |
+
ax.add_patch(Rectangle((row["start_time"], row["pitch"]-0.4), row["duration"], 0.4, color="black"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
plt.xlabel('Seconds', fontsize=18)
|
| 163 |
plt.ylabel('MIDI pitch', fontsize=16)
|
| 164 |
return fig
|