symphonynet/SymphonyNet

IndexError: list index out of range

Opened this issue · 2 comments

I am getting errors as "estimate time signature changes" in preprocessing, For MIDI file which I have converted from mp3.

Can you please let us know from where to get midi file converted to use in your google colab.

That will be really helpful.

And one more thing. Its a really cool concept thanks for the code

I am getting an IndexError: List index out of range as well.

Here is the error:
data/midis/SongName.mid
IndexError: list index out of range

MIDI data preprocessing takes: 0.1316835880279541s, 0 samples collected, 93 broken.
Create txt file takes: 0.00019311904907226562

Any idea as to what the issue is?

I am getting an IndexError: List index out of range as well.

Here is the error: data/midis/SongName.mid IndexError: list index out of range

MIDI data preprocessing takes: 0.1316835880279541s, 0 samples collected, 93 broken. Create txt file takes: 0.00019311904907226562

Any idea as to what the issue is?

if it's like this File "/root/SymphonyNet/src/preprocess/preprocess_midi.py", line 100, in limit_max_track good_instruments[1].notes), tuple(len(x.notes) for x in good_instruments[:3]) IndexError: list index out of range
the problem is that there're minimum track requirements (input's too small).
Check your input size.
p.s. detail:
``def merge_sparse_track(p_midi, CANDI_THRES=50, MIN_THRES=5): # merge track has too less notes
good_instruments = []
bad_instruments = []
good_instruments_idx = []
for instrument in p_midi.instruments:
if len(instrument.notes) < CANDI_THRES:
bad_instruments.append(instrument)
else:
good_instruments.append(instrument)
good_instruments_idx.append((instrument.program, instrument.is_drum))

for bad_instrument in bad_instruments:
    if (bad_instrument.program, bad_instrument.is_drum) in good_instruments_idx:
        # find one track to merge
        for instrument in good_instruments:
            if bad_instrument.program == instrument.program and \
                    bad_instrument.is_drum == instrument.is_drum:
                instrument.notes.extend(bad_instrument.notes)
                break
    # no track to merge
    else:
        if len(bad_instrument.notes) > MIN_THRES:
            good_instruments.append(bad_instrument)
p_midi.instruments = good_instruments``