Closed lmartak closed 1 month ago
For an empty MIDI file pred_MIDI (e.g. transcription gone real bad):
pred_MIDI
import partitura as pt PERF_PIANO_ROLL_PARAMS = {"time_unit": "sec", "time_div": 100, "onset_only": False, "piano_range": True, "time_margin": 0, "return_idxs": False} pred_perf = pt.load_performance_midi(pred_MIDI) pred_na = pred_perf.note_array() pred_pr = pt.utils.compute_pianoroll(pred_na, **PERF_PIANO_ROLL_PARAMS)
fails on the following line: https://github.com/CPJKU/partitura/blob/8812ca6be13f1dc362c9634a7fc8edc3eaac1d3b/partitura/utils/music.py#L1379 with ValueError: min() arg is an empty sequence.
ValueError: min() arg is an empty sequence
Probably just cosmetics of exception handling, just thought I'd report (close if irrelevant).
Hi @lmartak thanks for the issue! I added a PR with proper handling here #361
For an empty MIDI file
pred_MIDI
(e.g. transcription gone real bad):fails on the following line: https://github.com/CPJKU/partitura/blob/8812ca6be13f1dc362c9634a7fc8edc3eaac1d3b/partitura/utils/music.py#L1379 with
ValueError: min() arg is an empty sequence
.Probably just cosmetics of exception handling, just thought I'd report (close if irrelevant).