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 from event back to MIDI results in severe, unpredictable tempo distortion #82

Open
iLykTurtlz opened this issue May 26, 2024 · 0 comments

Comments

@iLykTurtlz
Copy link

iLykTurtlz commented May 26, 2024

I've spent some time with the docs looking for a workaround, but no luck yet. I need to be able to convert back to MIDI from the event representation, but it doesn't seem like the conversion operations are symmetric. Here's my code:

`
data = muspy.Music21Dataset() #current music21 interface incompatible with muspy
data.composer = 'bach'
data.filenames = music21.corpus.getComposer(data.composer, fileExtensions=data._extensions)
dataset = data.convert(root="./bach_data/")

#test that the first file is not corrupted
dataset[0].write_midi("testing0.mid") #ok

#from MIDI to event representation
pytorch_bach = dataset.to_pytorch_dataset(representation='event')

#from event representation to MIDI
result = muspy.from_representation(pytorch_bach[0], "event")
result.write("bach0.mid") #not ok
`

Any suggestions would be greatly appreciated!

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

1 participant