[CM] Re: Common Music and Csound 5

Rick Taube taube@uiuc.edu
Mon, 10 Oct 2005 13:50:47 -0500


On Oct 10, 2005, at 12:43 PM, Michael Gogins wrote:

> I will undertake a Lisp or Scheme binding for Csound 5 so that the 
> Csound API can be called natively from Common Music.
>
> Before I do this, I would like to know which version of Scheme or Lisp 
> I should target. I will be doing the development work on Windows and 
> Linux. Rick Taube's book comes with CLisp for Windows and this also 
> can be used on OS X and Linux, so I would guess this is the best 
> target.  CLisp runs Common Music just fine on my PC.
>
> I do not have time to maintain multiple bindings, so I need to know 
> the best compromise.

Hi, In my opinion the best compromise would be to write your code using 
CFFI for Common Lisp -- that way your code should run in every Lisp 
that CFFI supports, and it currently supports most CLs on all the major 
platforms. You can read about CFFI here:

	http://common-lisp.net/project/cffi/

Note that currently CM does not use CFFI yet but I will definately be 
moving to it (both CM and Lambda-GTK) in the fairly near future At any 
rate that would not have any bearing on your work, ehich if I 
understandd it, could be used by any common lisp (or scheme) program.

For Scheme there is no simple solution -- my understanding is that the 
next release of Gauche Scheme  (0.8.6) will include an "easy" FFI 
interface.

	http://www.shiro.dreamhost.com/scheme/gauche/

If you do a scheme binding I would perfer Gauche over Guile, mainly 
because we have CM's realtime scheduler working in Gauche (sort of...), 
but also because I have had too many problems trying to build Guile on 
OS X. Hoever CM 2.7.0 does run in Guile, Gauche and STklos Schemes.

> As part of this work, I will be moving the C++ form of the Csound API 
> from the CsoundVST project into the Csound API library proper, and 
> also moving the Python wrappers.

An FFI to C++ will entail additional headache, there is a project 
called Verragano that does this, I belileve that it uses CFFI to help 
do this:

	http://common-lisp.net/project/fetter/
>
> I would like to finish this work before Csound 5 achieves release 
> status.

Depending on what you want to do, another possibilty would be to 
connect Csound and CM using OSC via UDP -- I think that OSC/UDP is 
working in CM right now, or if it isnt, it will be very shortly (ie 
days not weeks)

Hope this helps!

--rick