[pygame] Pygame midiout not working...

819 views
Skip to first unread message

Anthony Palomba

unread,
Oct 17, 2011, 3:03:25 PM10/17/11
to pygame...@seul.org
I running OSX 6.8 with python 2.7 (from python.org). I installed pygame 1.9.1
and am trying to get MIDI output to work.

When I run the example midi.py, I get the following error:

ImportError: No module named pypm
File "/Developer/Python/pygame/Examples/midi.py", line 820, in <module>
  print_device_info()
File "/Developer/Python/pygame/Examples/midi.py", line 25, in print_device_info
  pygame.midi.init()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/midi.py", line 71, in init
  import pygame.pypm


Is there something I am missing here?




Anthony

René Dudfield

unread,
Oct 17, 2011, 3:35:19 PM10/17/11
to pygame...@seul.org
Hello,

where did you install pygame from?  It looks like the pygame.pypm module is not there.

Anthony Palomba

unread,
Oct 17, 2011, 4:04:50 PM10/17/11
to pygame...@seul.org
I installed it from the installer I downloaded from the gygame website.
pygame-1.9.1release-python.org-32bit-py2.7-macosx10.3.dmg



-ap

René Dudfield

unread,
Oct 17, 2011, 4:12:22 PM10/17/11
to pygame...@seul.org
doh.  it seems that one doesn't have midi working.

I'll see if I can get another one made with midi support in there.  It might take a few days though.

cheers,

Russell E. Owen

unread,
Oct 18, 2011, 5:58:44 PM10/18/11
to pygame...@seul.org
In article
<CAFZXy=esDhtJOE7ygUS9r31KvS6t...@mail.gmail.com>,
Anthony Palomba <apal...@austin.rr.com>
wrote:

> I installed it from the installer I downloaded from the gygame website.
> *pygame-1.9.1release-python.org-32bit-py2.7-macosx10.3.dmg<http://pygame.org/f
> tp/pygame-1.9.1release-python.org-32bit-py2.7-macosx10.3.dmg>

I built that binary installer. Unfortunately it does not include midi
support because I've not figured out how to build portmidi on MacOS X
10.4 (the platform I use to build 32-bit python binary installers). I've
not tried on more recent MacOS X.

-- Russell

René Dudfield

unread,
Oct 19, 2011, 3:36:44 AM10/19/11
to pygame...@seul.org
Hi,

here are the port midi compilation instructions:
        c. OS X:  - change to PortMidi subdirectory pm_mac
                  - compile. Type: xcodebuild -project pm_mac.pbproj
                  - copy newly created libportmidi.a to a lib path

cheers,

Anthony Palomba

unread,
Oct 20, 2011, 3:04:56 PM10/20/11
to pygame...@seul.org
Is there an ETA on a build of pygame for the mac that has MIDI output?



Thanks,
Anthony

René Dudfield

unread,
Oct 21, 2011, 5:59:34 AM10/21/11
to pygame...@seul.org
Hi,

Russel, are you able to do a build with midi in there?

I've uploaded the portmidi build directory I made last time.  So you should be able to do:

mkdir portmiditmp
cd portmiditmp
curl -O http://rene.f0o.com/~rene/stuff/portmidi_trunk.zip
unzip portmidi_trunk.zip
cd trunk
make -f pm_mac/Makefile.osx install

Which should install portmidi for you.

The last line might need to be:
    sudo make -f pm_mac/Makefile.osx install


cheers,

Russell Owen

unread,
Oct 24, 2011, 6:37:41 PM10/24/11
to public-pygame-u...@plane.gmane.org

So far I've had no luck building portmidi--either the current release or the trunk you provided. I get tons of errors that suggest fundamental .h files aren't being found. (And yes, I do have CMake installed and running). I suspect this is because the xcode project file was saved with too recent a version of xcode (as it reports when I open it in XCode).

Also, it has no PPC target (based on opening the project on my main 10.6.8 machine). That will cause trouble with python.org's 32-bit python. I don't use xcode so I'm not sure how easy it would be to add a PPC target. Another option is to try an older version of portmidi, though I doubt users who rely on portmidi would want to go too far back.

If somebody wants to provide me a 32-bit intel+PPC static portmidi library, compatible with 10.4 and later, I'll use it. Or you can try more complete instructions (including minimum version of XCode and MacOS X on which to attempt the build) and I'll see if I can find time to go that route.

-- Russell

On Oct 24, 2011, at 2:31 PM, René Dudfield (by way of "Russell E. Owen" <ro...@uw.edu>) wrote:

> Hi,
>
> here are the port midi compilation instructions:
> c. OS X: - change to PortMidi subdirectory pm_mac
> - compile. Type: xcodebuild -project pm_mac.pbproj
> - copy newly created libportmidi.a to a lib path
>
> cheers,
>
>
>
> On Tue, Oct 18, 2011 at 11:58 PM, Russell E. Owen

> <rowen-lf...@public.gmane.org> wrote:
>
>> In article
>> <CAFZXy=esDhtJOE7ygUS9r31KvS6tDs6p0ucNjjG...@public.gmane.org>,
>> Anthony Palomba <apalomba-bs+DcK...@public.gmane.org>

René Dudfield

unread,
Oct 28, 2011, 5:56:37 AM10/28/11
to pygame...@seul.org
Hey,

I'll try and make a "32-bit intel+PPC static portmidi library, compatible with 10.4 and later" this weekend.

It's a bit hard for me, since I'm on OSX Lion and xcode 4.2 now.  Apple removed PPC support in their compiler here.  Which means PPC support is impossible without installing xcode 3 too.  So I need to install xcode 3 first to a separate directory, then install xcode 4.2 again, then do some symlinking in order to get them both working.

Note, to see the architectures in a dylib
    lipo -info /usr/local/lib/libportmidi.dylib

To remove the x64 architecture, and create a new version in /tmp/:
    lipo /usr/local/lib/libportmidi.dylib -remove x86_64 -output /tmp/libportmidi.dylib

Then to see what it is linked against...
    otool -L /usr/local/lib/libportmidi.dylib



cheers,

René Dudfield

unread,
Oct 28, 2011, 6:13:42 AM10/28/11
to pygame...@seul.org
Hi,

hrmm.  It seems the xcode 4.2 installer moved some stuff into "/Developer-old" folder and the ppc compilers are still in there.  So maybe that will work.  I'll give it a go later.

Also, this is the guide I plan to use for ppc support on Lion.
    http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4

cu.

Anthony Palomba

unread,
Nov 28, 2011, 4:16:13 PM11/28/11
to pygame...@seul.org
Hey folks,

I was wondering if the Mac midi output issue has been resolved.

Any word on a new build?



Thanks,
Anthony

Anthony Palomba

unread,
Dec 8, 2011, 11:51:54 AM12/8/11
to pygame...@seul.org
Hey folks,

I was wondering if the Mac midi output issue has been resolved.

Any word on a new build?



Thanks,
Anthony



René Dudfield

unread,
Dec 9, 2011, 1:47:42 PM12/9/11
to pygame...@seul.org
Hi ya,

I got stuck trying to get the ppc compilers working on Lion... but I'll try again.

cu.

Anthony Palomba

unread,
Dec 9, 2011, 2:06:15 PM12/9/11
to pygame...@seul.org
Hey René,


Thanks for the update. I appreciate all your effort.
Looking forward to doing some MIDI output on the
Mac with pygame.



-ap

Zack Baker

unread,
Dec 9, 2011, 4:22:34 PM12/9/11
to pygame...@seul.org
Hey everyone i am having some problems importing sprites into lion, i know this is the wrong thread but could you direct me on how to start a new one

Anthony Palomba

unread,
Dec 9, 2011, 4:44:55 PM12/9/11
to pygame...@seul.org
Use the same address but different subject line.

J.B. Nicholson-Owens

unread,
Dec 9, 2011, 8:09:50 PM12/9/11
to pygame...@seul.org
Zack Baker wrote:
> [...] i know this is the wrong thread but could you direct me on how

> to start a new one

Post a new email to the mailing list. Do not reply to any existing post
already on the list because that will continue the thread. Posting a
new email to the mailing list address will begin a new thread, replying
to an extant post continues a thread.

The subject of the post has nothing to do with proper threading because
threads aren't really determined by the presence or absence of a leading
"Re:".

As you'll see, this post properly threads below Baker's post as a
response, this post does not start a new thread despite having a new
subject that does not begin with "Re:".

Anthony Palomba

unread,
Jan 16, 2012, 3:31:00 PM1/16/12
to pygame...@seul.org

Anthony Palomba

unread,
Jan 20, 2012, 4:35:07 PM1/20/12
to pygame...@seul.org

René Dudfield

unread,
Jan 30, 2012, 4:46:50 PM1/30/12
to pygame...@seul.org
Hi,

just an update...

tldr; fail.

- I asked the port media mailing list, and figured out a few things*.
- it compiles with home brew (on lion+snow).
- I tried to get a VM working on virtualbox... but that didn't work.  Apparently it used to work with OSX server, but OSX server doesn't exist any more; So virtualbox doesn't seem to support it now.
- You can extract architectures, and join them together with `lipo`.  So, if I grab an old binary I might be able to extract the ppc stuff.
- people suggest getting an old mac to support old mac platforms.


So...

*basically, I need to get an old mac. 

Supporting old platforms on Lion seems too hard; unless you are a level 52 wizard, and have some of Steve Jobses toe nail clippings to do the incantations.


cu.
Reply all
Reply to author
Forward
0 new messages