[CM] Receiving from portmidi

Ralf Mattes rm at seid-online.de
Sun, 02 Dec 2007 18:56:46 +0100

On Sun, 2007-12-02 at 08:38 -0600, Rick Taube wrote:
> i have MIDI input working again in Portmidi -- somehow I managed to  
> lose several function definitions in the file cm-recv.lisp. I put  
> these back and tested on SBCL and OpenMCL (on macosx, I will also  
> test on my planetccrma box tomorrow when im at work but it should be  
> working.)
> Ive uploaded the fixed portmidi tarball to sourceforge as  
> portmidi-2.0.2:
> http://sourceforge.net/project/showfiles.php? 
> group_id=9766&package_id=172088
> my apologies for getting behind on the fix...
> also Scheme MIDI hooks should be working in Grace sometime this week,  
> at that point I would suggest trying that for midi realtime in lisp  
> as the support and scheduling will be better.

Hmm - seems like your code doesn't even compile in my setup (GNU/Linux,
Ubuntu Feisty with SBCL-1.0.10.debian and a rather fresh CFFI checkout.
This (from cffi-portmidi.lisp) already triggers an error:

 (cffi:define-foreign-type pm-message () ':long)

In DEFCLASS PM-MESSAGE, the slot name :LONG is a keyword.
   [Condition of type SB-INT:SIMPLE-PROGRAM-ERROR]

The ': sequence smells like autogenerated code. What's going on here?

BTW, I think you can simplify your library loading code - you don't need
to loop through a list of possible library locations. CFFI provides code
for doing this already. Just do:

 (pushnew "/usr/local/lib/" cffi:*foreign-library-directories* :test

and then:

 (cffi:load-forreign-library "libportmidi.so"(

(Unfortunately one still needs to conditionalize in the file type, but I
guess that could/should be fixed in CFFI).

 Cheers, RalfD

> Cmdist mailing list
> Cmdist@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist