Skip to content
Search
mxm, IT's mad science
Sections
Welcome
News
Search
Replies
Personal tools
You are not logged in
Log in
You are here:
Home
»
Products
»
Open Source
»
Python Midi Package
»
Bug in pitch bend output
Navigation
Home
Papers
Products
Open Source
mxmContacts
Python Midi Package
Downloads
You can download mxm products
here
.
Due to it's technical and international nature, this section is in english.
Max M Has a blog too.
og er glad for mad
Comment
Above in this comment thread:
Python Midi Package
Bug in pitch bend output
Posted by
Anonymous User
at
2008-01-10 10:51 PM
MidiOutFile.py has a bug in the pitch bend output. This causes corruption in all pitch bends generated. The solution is below in the form of a diff.
@@ -107,8 +107,8 @@
value: 0-16383
"""
msb = (value>>7) & 0xFF
- lsb = value & 0xFF
- slc = fromBytes([PITCH_BEND + channel, msb, lsb])
+ lsb = value & 0x7F
+ slc = fromBytes([PITCH_BEND + channel, lsb, msb])
self.event_slice(slc)
@@ -445,4 +445,4 @@
midi.eof() # currently optional, should it do the write instead of write??
another bug in pitch bend handling
Posted by
Anonymous User
at
2008-10-02 12:48 AM
I forgot to submit this other change necessary to get pitch bends working. It's in EventDispatcher.py
@@ -126,7 +126,7 @@
stream.channel_pressure(channel, pressure)
elif (PITCH_BEND & 0xF0) == hi_nible:
- hibyte, lobyte = data
+ lobyte, hibyte = data
value = (hibyte<<7) + lobyte
stream.pitch_bend(channel, value)
@@ -107,8 +107,8 @@
value: 0-16383
"""
msb = (value>>7) & 0xFF
- lsb = value & 0xFF
- slc = fromBytes([PITCH_BEND + channel, msb, lsb])
+ lsb = value & 0x7F
+ slc = fromBytes([PITCH_BEND + channel, lsb, msb])
self.event_slice(slc)
@@ -445,4 +445,4 @@
midi.eof() # currently optional, should it do the write instead of write??
@@ -126,7 +126,7 @@
stream.channel_pressure(channel, pressure)
elif (PITCH_BEND & 0xF0) == hi_nible:
- hibyte, lobyte = data
+ lobyte, hibyte = data
value = (hibyte<<7) + lobyte
stream.pitch_bend(channel, value)