pyportmidi /

Filename Size Date modified Message
debian
181 B
96 B
1.6 KB
167 B
400 B
3.2 KB
779 B
17.1 KB
2.4 KB
3.8 KB
0.0.6 (Mon, 14 Dec 2009)
Debian packaging Removed from scripts files that were not scripts
0.0.5: (June 1st, 2009) From the Pygame project
Output no longer calls abort when it deallocates. Added abort and close methods. Need to call Abort() explicityly if you want that to happen.

PyPortMidi v0.03 03/15/05 Python wrappings for PortMidi John Harrison harrison@media.mit.edu

PyPortMidi

PyPortMidi is a Python wrapper for PortMidi. PortMidi is a cross-platform C library for realtime MIDI control. Using PyPortMidi, you can send and receive MIDI data in realtime from Python.

Besides using PyPortMidi to communicate to synthesizers and the like, it is possible to use PyPortMidi as a way to send MIDI messages between software packages on the same computer.

PyPortMidi was written in Pyrex, a language for writing Python extension modules.

Installing PyPortMidi from its Pyrex source code:

  1. Linux only: install ALSA if it is not installed: http://www.alsa-project.org/

  2. Install Pyrex if it is not installed http://nz.cosc.canterbury.ac.nz/~greg/python/Pyrex/

  3. Choose to rebuild the PortMidi C library:
    1. download and extract PortMidi http://www-2.cs.cmu.edu/~music/portmusic/

    2. Win32: - compile PortMidi with MS VC 6.0 (free download)
      • use LIB from the MS VC 6.0 package to create porttime.lib and portmidi.lib
      • copy porttime.lib and portmidi.lib to PyPortmidi's win32 subdirectory
    3. OS X: - change to PortMidi subdirectory pm_mac
      • compile. Type: xcodebuild -project pm_mac.pbproj
      • copy newly created libportmidi.a to PyPortMidi's OSX subdirectory
    4. Linux: - type <make> from PortMidi's root directory
      • copy libportmidi.a

        from portmidi's pm_linux directory to PyPortMidi's linux directory

      • copy libporttime.a

        from portmidi's porttime directory to PyPortMidi's linux directory

  4. in PyPortMidi's root directory, type: python setup.py install (make sure you have admin/superuser privileges)

Distribution of PyPortMidi compiled code:

I have provided a Win32 installer for Python 2.3.x. I would welcome a Win32 installer for Python 2.4. I have not provided installers for OS X or Linux because I suspect these users would rather compile from source code. If this is not the case, please tell me.

Update: There is now a Debian package available from http://bitbucket.org/aalex/pyportmidi.

Using PyPortMidi

Running the test_pyportmidi.py sample script and looking at the code is the easiest way to start. The classes and functions are mostly documented, or seem self-explanatory.

You can also look at the portmidi.h header, which heavily documents all of PortMidi's functions.

Bugs, suggestions etc.

I welcome any bugs you have to report or any suggestions you have about how to improve the code and the interface.

-John

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.