_ Web.log

rss RSS feed


tag: code


Building pyPortMIDI on Snow Leopard x86_64

I don't make a habit of posting compilation gotchas, but this one was a phenomenally unpleasant time drain. Looking to interface python with MIDI on Snow Leopard, I came across pyPortMIDI, based on part of PortMedia.

Compilation seemed OK, following these hints (also found in pm_python/hints.txt in the portmidi dist), but running the pyPortMIDI test.py script returned the following:

Traceback (most recent call last):
File "test.py", line 11, in
import pypm
ImportError: dlopen(/Library/Python/2.6/site-packages/pypm.so, 2): Symbol not found: _Pt_Time
Referenced from: /Library/Python/2.6/site-packages/pypm.so
Expected in: flat namespace
in /Library/Python/2.6/site-packages/pypm.so

Following some excrutiating exploration with dtrace and nm, it transpired that it boiled down to an architecture issue: according to the portmidi xcode build file, /usr/local/lib/libportmidi.dylib was compiled as i386/ppc, but my system is 64-bit.

Solution:
* Open the .xcodeproj file in XCode, change the .dylib Target arch to x86_64, rebuild and install over the existing /usr/local/lib/libportmidi.dylib
* Clean up the pyPortMIDI build, rebuild and reinstall

Now working without a hitch.

Graph paper generator
[icon] http://www.erase.net/.../graph-paper/

What's better than graph paper? Of course, it's a tool to grow your own printable graph paper, sufficiently configurable to cater for the wildly divergent graph-paper needs of our times.

This Processing sketch (PDE) will generate single-weight, multi-weight and cross-grid graph paper in PDF format, with configurable weights and colours, support for metric and imperial measures, and control over margins and paper sizing. Unsupported, but should be simple to modify.

graph paper

AtomSwarm source now available
[icon] http://www.erase.net/projects/atomswarm/

Screenshot After months of good intentions being ousted by other priorities, I'm pleased to have finally found the time to finish cleaning up and documenting the core classes of AtomSwarm, a Processing-based framework for musical improvisation based on swarm behaviours. It's perhaps not the cleanest set of source in the world, but provides a useful basis for other swarm work and contains information on the genetic and metabolic constructs that co-determine the swarm's behaviours.

Creative Commons License

Valid XHTML 1.0 Strict Valid CSS 2