To reproduce:
dataset = muspy.LakhMIDIAlignedDataset("path/to/dataset")
music = dataset[1].copy()
music.tracks = music.tracks[:1]
muspy.show_pianoroll(music, mode="hybrid", preset="frame")
The error:
File venv/lib/python3.10/site-packages/muspy/outputs/pianoroll.py:57, in to_pypianoroll(music)
55 for tempo in music.tempos:
56 tempo_arr[position : tempo.time] = qpm
---> 57 tempo_arr[tempo.time] = tempo.qpm
58 position = tempo.time + 1
59 qpm = tempo.qpm
IndexError: index 29085 is out of bounds for axis 0 with size 29085
The bug is probably how the music length is calculated.
i.e.
music.get_end_time() return the same number as music.tempos[-1].time if the tracks are altered.
I'm not sure if get_end_time() function or the piano roll function should be fixed.
To reproduce:
The error:
The bug is probably how the music length is calculated.
i.e.
music.get_end_time()return the same number asmusic.tempos[-1].timeif the tracks are altered.I'm not sure if
get_end_time()function or the piano roll function should be fixed.