You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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!
The text was updated successfully, but these errors were encountered: