Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
srianbury opened this issue Mar 14, 2018 · 4 comments
Open

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

srianbury opened this issue Mar 14, 2018 · 4 comments

Comments

@srianbury
Copy link

I've been trying to run this program but I've run into an error. On line 24 of preprocess.py (

melody_stream = midi_data[5] # For Metheny piece, Melody is Part #5.
) 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?

@hasagar97
Copy link

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

@srianbury
Copy link
Author

srianbury commented Jun 24, 2018

@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

@yunjiewang
Copy link

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)

@cvantass
Copy link

cvantass commented May 8, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants