#4 trouble saving midi files

open
nobody
None
5
2011-08-30
2011-08-30
John Seales
No

If I try a trivial example of reading and writing a midi file, it fails. Following is a sample session and Traceback. Let me know where I'm going wrong.

>>> a = read_midifile(pathToMidiFile)
>>> type(a)
<class 'midi.midi.EventStream'>
>>> write_midifile(a,pathToNewMidiFile)

Traceback (most recent call last):
File "<pyshell#27>", line 1, in <module>
write_midifile(a,midiOutputPath)
File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/midi/midi.py", line 816, in write
cls(midistream, output)
File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/midi/midi.py", line 813, in __init__
self.write_track(track)
File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/midi/midi.py", line 839, in write_track
buf += event.encode(delta=-last_tick, running=running)
File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/midi/midi.py", line 167, in encode
datalen = chr(len(data))
ValueError: chr() arg not in range(256)
>>>

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks