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

Converting midi to txt #3

Open
andrei4b opened this issue May 20, 2019 · 1 comment
Open

Converting midi to txt #3

andrei4b opened this issue May 20, 2019 · 1 comment

Comments

@andrei4b
Copy link

It seems to be a problem with the midi to tsv conversion. In the original Onsets and frames paper it says:

"If a note is active when sustain goes on, that note will be extended until either sustain goes off or the same note is played again. This process gives the same note durations as the text files included with the dataset."

I noticed that I don't get the same offsets as in the text files, and then I saw that when moving the offset, you search for sustain off but not also for a new onset of the same note. Or did you omit this for a reason?

Adding what's in bold to line 45 from midi.py seems to have the result I desired:

offset = next(n for n in events[offset['index'] + 1:] if n['type'] == 'sustain_off' or n['note'] == offset['note'] or n is events[-1])

@jongwook
Copy link
Owner

jongwook commented Jun 2, 2019

Thanks for catching this! I must have overlooked that possibility.

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

2 participants