lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I have created a Lua binding for the open source software sound
synthesis system Csound using SWIG. The underlying code is C++, the
binding was very easy to generate, and it seems to work perfectly.
This has been around for some years now.

For what it's worth, inspired by recent discussions on LuaJIT + FFI
performance here, I am going to attempt a user-programmable and
user-extensible  software sound synthesizer in pure Lua -- and might
even finish it. I have made several prototypes of such a system using
C++ and Lua in the past, but was never satisfied by the thought of all
that Lua C API stack stuff on vector accesses, or even creating C++
buffer objects (still have to get Lua variables in and out of the
buffers). It now seems as though I can use a C style buffer in pure
Lua with C-type performance. The synthesizer will still use some C
libraries for audio and MIDI input and output, and possibly

Mike Gogins

On Tue, Feb 22, 2011 at 7:20 PM, Sam Roberts <> wrote:
> On Tue, Feb 22, 2011 at 2:32 PM, Jeff Smith <> wrote:
>> However for a newbie that isnt familiar with the C API and hasnt got much
>> time to create some bindings I would say the sensible and proper way to get
>> a quick bug free solution is to use something such as Swig.
> Assuming swig is easier to use than lua's C api.
> My experience with swig is that that isn't true, and that you end up
> having to know both the C API of the language you are binding to and a
> fair bit of swig internals.
> I have the impression swig works better when binding C++ to an object
> oriented language,
> because you don't have to teach swig the conventions of the library,
> but I haven't used
> c++ for a long, long time. And it was 6 years ago I tried to use swig,
> it might be better.
> Cheers,
> Sam

Michael Gogins
Irreducible Productions
Michael dot Gogins at gmail dot com