[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] One MIDI byte being transmitted incorrectly



Hi all.
I'm sending a MIDI MMC goto message, a SysEx message which contains 13 bytes.
For some reason, the 7th byte, i.e. the 3rd byte in the second write, is being changed from 1 to 0 as read by MIDI Ox. If I send 4 instead of 1, MIDI Ox reads 1.
The messages should be:
[0xf0, 0x7f, 127, 0x06]
[0x44, 0x06, 0x01, 0x20]
[0, 1, 0, 0]
[0xf7]

If I send the same message from Cubase to MIDI Ox, that 1 stays 1, it isn't read as 0, but sent from pygame, that one byte is changed.
Can anyone at least reproduce this?
I have pygame 1.9.1, Python 2.7.8 and Windows 7. My script is attached.

Thanks for any insight you can offer.
-Chuckk
import pygame.midi as md

md.init()

mmcout = md.Output(13)

goto0 = [0xf0, 0x7f, 127, 0x06] # MMC GOTO message introduction
goto1 = [0x44, 0x06, 0x01, 0x20]   # MMC GOTO message intro and 'hours' field
goto2 = [0, 1, 0, 0]            # minutes, seconds, frames, subframes
goto3 = [0xf7]                  # sysex end
mmcout.write([[goto0, md.time()]])
mmcout.write([[goto1, md.time()]]) # Here I see "44, 6, 0, 20" instead of "44, 6, 1, 20"....
mmcout.write([[goto2, md.time()]])
mmcout.write([[goto3, md.time()]])

try:
    mmcout.close()
except:
    pass