I'm having a problem with your module: when I add a negative value as the first argument to midi.key_signature(), to indicate flats, it gives me this:
File "./xml2midi.py", line 131, in xml2midi
midi.key_signature(-3,0)
File "midi/MidiOutFile.py", line 381, in key_signature
self.meta_slice(KEY_SIGNATURE, fromBytes([sf, mi]))
File "midi/DataTypeConverters.py", line 143, in fromBytes
return pack('%sB' % len(value), *value)
File "/usr/lib/python2.5/struct.py", line 63, in pack
return o.pack(*args)
struct.error: ubyte format requires 0 <= number <= 255
Is this a bug, or am I doing something wrong?
Thanks, for any help and for the otherwise great module!
solution
Posted byAnonymous Userat
2007-02-20 08:39 PM
Ok, it's solved when I do (sharpsFlats+256)%256. But isn't that supposed to be done inside the module?
I'm having a problem with your module: when I add a negative value as the first argument to midi.key_signature(), to indicate flats, it gives me this:
File "./xml2midi.py", line 131, in xml2midi
midi.key_signature(-3,0)
File "midi/MidiOutFile.py", line 381, in key_signature
self.meta_slice(KEY_SIGNATURE, fromBytes([sf, mi]))
File "midi/DataTypeConverters.py", line 143, in fromBytes
return pack('%sB' % len(value), *value)
File "/usr/lib/python2.5/struct.py", line 63, in pack
return o.pack(*args)
struct.error: ubyte format requires 0 <= number <= 255
Is this a bug, or am I doing something wrong?
Thanks, for any help and for the otherwise great module!