I'm trying to use pyPortMidi for an application that I build for OSX, win32, and win64. I've gotten it to work on OSX and win32, but I am stuck trying to get it working on win64.
pyPortMidi is a wrapper for a C library named PortMidi, and it is available with the PortMidi source download as version 0.7 and from John Harrison's site as version 0.9. I've tried both versions with the same failure mode.
First I built PortMidi using MSVC++ 2008 Express targeted to X64. The included test program works and is able to communicate with midi ports, so I think the PortMidi build is fine.
Next I built pyPortMidi. For version 0.7 I had to modify the setup.py file slightly to account for the proper location of an include files (moved from ../win32 to ../pm_common) and it builds without errors. While version 0.7 uses cython to build _pyportmidi.c, version 0.9 uses pyrex to do the same thing; to get it to work I had to use the version of pyrex installed using easy_install. It also built without errors.
I'm able to import the library into Python, but when I make the first call it immediately crashes Python:
>>> import pypm
>>> pypm.Initialize()
Problem signature:
Problem Event Name: APPCRASH
Application Name: python.exe
Application Version: 0.0.0.0
Application Timestamp: 4e70d55f
Fault Module Name: pypm.pyd
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4f8383fc
Exception Code: c0000005
Exception Offset: 0000000000009000
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1033
Additional Information 1: 0f1f
Additional Information 2: 0f1f1099a7fb7a2294c21b52e8fe20f2
Additional Information 3: 07a8
Additional Information 4: 07a8c952d5efd7a04abd16111aad6ab0
Has anyone gotten pyPortMidi running on X64? Any suggestions as to how I could debug this issue?
An updated pypm module is available as pygame.pypm. Using win-amd64-py2.7 binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame the following works:
>>> from pygame import pypm
>>> pypm.Initialize()