music-x-lab / POP909-Dataset

This is the dataset repository for the paper: POP909: A Pop-song Dataset for Music Arrangement Generation
MIT License
287 stars 41 forks source link

A missing line of code in data_process Notebook #3

Closed asigalov61 closed 3 years ago

asigalov61 commented 3 years ago

Hey guys!

Thank you so much for your work on POP909 Dataset! It is very nice and useful for MIR and Music AI purposes.

I am just reporting a bug in your Jupyter notebook to process MIDIs. I get the following error:

It seems that you forgot to copy notes to main_notes as it is empty?!? What is missing? Please help.

Thank you so much! :)

<ipython-input-36-1bb094f00d53> in preprocess_pop909(midi_root, save_dir)
     45         filename = midi_root + path
     46         try:
---> 47             data = preprocess_midi(filename)
     48         except KeyboardInterrupt:
     49             print(' Abort')

<ipython-input-36-1bb094f00d53> in preprocess_midi(path)
     32     acc_notes.sort(key = lambda x:x.start)
     33     mpr = MidiEventProcessor()
---> 34     repr_seq = mpr.encode([main_notes, acc_notes])
     35     total += len(repr_seq)
     36     return repr_seq

<ipython-input-15-0b0777f62870> in encode(self, note_seq)
    171             token_on = {
    172                 "name": "note_on",
--> 173                 "time": note.start,
    174                 "pitch": note.pitch,
    175                 "vel": note.velocity,

AttributeError: 'list' object has no attribute 'start'
RetroCirce commented 3 years ago

Thank you for pointing out this bug! Yes you are right, the right way to remove this bug is to change as repr_seq = mpr.encode([acc_notes])

the reason for the definition of the main note is because we once extracted the main vocal notes for other usages, and in this processing script we did not delete completely this part.

Thanks!!

asigalov61 commented 3 years ago

@RetroCirce Thanks a lot for your response and helpful info. Seems to be working now. I will test and let you know of any other issues.

Thanks again.