deepjazz icon indicating copy to clipboard operation
deepjazz copied to clipboard

How to locate Melody Piece index? (melody_stream = midi_data[5])

Open srianbury opened this issue 6 years ago • 4 comments

I've been trying to run this program but I've run into an error. On line 24 of preprocess.py (https://github.com/jisungk/deepjazz/blob/b0aa6ca1b91be6ddf081fc05ebfeefa89cc4b848/preprocess.py#L24) the melody is at index 5. Does anyone know how he found this? Was it guess and check? Is there a way to easily know where the melody is? Either way, if there is a method or it's guess and check does anyone know how to find it?

srianbury avatar Mar 14 '18 23:03 srianbury

Facing the same issue. Did you find the solution @srianbury ?

hasagar97 avatar Jun 22 '18 19:06 hasagar97

@hasagar97 Yes I found a solution, kind of. The 5, and many of the other parts are hard-coded specifically for this song. If you run this program with a debugger you can see that the information at the 5th index of midi_data is different than the rest, I think, and it's an object of type instrument or something, if I remember correctly. I was using mp3s and found a converter to MIDI and the melody was always placed at midi_data[0] so I was able hard code that and know it would work for anything because of the converter. I don't know if there's a method to write to detect melody, but making sure you put it in the same place every time helped me

srianbury avatar Jun 24 '18 23:06 srianbury

You can import the midi file into a scorewriter like MuseScore. Then read the score or even playback to confirm that Pat's part, which is named "Cavaquinho, Guitar", is the 6th part. (Hence index=5)

yunjiewang avatar Dec 30 '18 05:12 yunjiewang

I've been trying to use my own midi files, and figured out pretty quickly that since they only consist of one part, that the index here needed to be 0. However, once I do that, a number of other errors pop that also have to do with the fact that i'm not using the piece that this program was hard-coded for. Has anyone here figured out a way around this?

cvantass avatar May 08 '19 18:05 cvantass