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

[pygame] pygame.midi




Hi,

This is my first post to the pygame-users list.

I am working on a python project and use pygame for MIDI I/O functionality.

I want it to work on different platforms and, while I am writing in Python 2.7, it should not take more than running the 2to3 tool to make it running with Python 3.2

Some strange things happen when using Python 3.2. I have managed to fix/workaround most of them (I will share my experiences some other time) and both MIDI IN and OUT is now working on my Linux Fedora 17 system with both Python 2.7 and 3.2.

But now the strange things. On Windows MIDI IN is working when using Python 2.7 but failing when using 3.2. I have tested with pre-compiled msi python and pygame installers from the Python and Pygame websites.

Example code:

from pygame import midi
midi.init()
MIDI_INPUT = midi.Input(1, 5000)  # comment: 1 is my MIDI IN device id

this gives an error message:

Traceback (most recent call last)
  File "(stdin)", line 1, in <module>
  File "C:\Python32\lib\site-packages\pygame\midi.py", line 262, in __init__
    self._input = pypm.Input(device_id, buffer_size)
  File "pypm.pyx", line 531, in pypm.Input.__init__ (src/pypm.c:2797)
Exception: b"PortMidi: `Insufficient memory'"

If I try the same code again, without a reset, another error message appears:

Exception: b"PortMidi: `Host error'"


All this does not happen on my Linux Fedora 17 system, and it also does not happen on Windows if I use Python 2.7

Any pygame.midi gurus here ?
Anyone who can help or knows what's happening here ?

--

MT