midi with ctypes

Thomas Heller theller at python.net
Sat Aug 9 14:59:19 EDT 2003


anton at vredegoor.doge.nl (Anton Vredegoor) writes:

> danbmil99 at yahoo.com (dan) topposted:
>
>>Interesting idea, but frankly it seems like alot of extra overhead. 
>>Now that midipy is compiling, I'm more inclined to add features in C
>>than using ctypes.
>
> The microsoft visual C compiler is about half a gigabyte size, the
> soundfont SDK from creative labs is about 20 megabyte size, the OSC
> toolkit is about 3 megabyte size, the midipy.cpp is a few kilobyte
> size.
>
> Compare this with the ctypes solution: ctypes itself is about half a
> megabyte size and the ctypesmidipy.py is taking a few kilobytes.
>
> From this comparison one could conclude that the overhead is largely
> on the side of the current solution using C.
>
>>What advantages can we expect from doing it this way?
>
> The ctypes solution is cheaper, there are less license issues because
> there are less parties involved, it's a lot less code so it's easier
> to understand and maintain, programming this module in Python gives
> extra flexibility, and most importantly this could be a platform
> independent solution for MIDI programming. That would earn Python
> extra kudos from music programmers.

There may even be another advantage (in the future): the ctypes solution
may be more portable. Bradley Schatz has started porting ctypes to Java,
and so it seems also usable from Jython.  Not to speak of pypy...

Thomas




More information about the Python-list mailing list