Csound Csound-dev Csound-tekno Search About

[Csnd-dev] ctypes wrapper to the API

Date2016-03-10 16:16
FromFrancois PINOT
Subject[Csnd-dev] ctypes wrapper to the API
I have included in my ctypes wrapper file to the Csound API an interface to CsoundPerformanceThread. FFI libraries like ctypes work well with C functions but not so well with C++ functions (name mangling problem).

I added in the end of interfaces/CsPerfThread.cpp some extern "C" functions to expose the csoundPerformanceThread class methods as C functions.

Building Csound here on my linux system, everything works fine. I can run the unit tests on Python2.7 and Python3.5 as well.

To run those test, one needs to downloads the files ctcsound.py, test_ctcsound.py, analogSynth01.csd, bufferInOut.csd and simple.csd from my github repo: https://github.com/fggp/ctcsound. Then the command python test_ctcsound.py should output something like this:

...
----------------------------------------------------------------------
Ran 6 tests in 2.382s

OK
...

Maybe, in ctcsound.py, the path for libcsoun64 and libcsnd6 have to be adjusted for windows (line 31 and line 2342), and OSX (line 33 and line 2344).

Mike could you please run the test with a freshly built CsoundĀ  on Windows, and Victor could you do the same on OSX ? If you have to change the path to the csound libs, can you indicate the right value ?

Regards

Francois

Date2016-03-10 16:43
FromMichael Gogins
SubjectRe: [Csnd-dev] ctypes wrapper to the API

Yes, I'll test this soon.

Best,
Mike

On Mar 10, 2016 6:16 PM, "Francois PINOT" <fggpinot@gmail.com> wrote:
I have included in my ctypes wrapper file to the Csound API an interface to CsoundPerformanceThread. FFI libraries like ctypes work well with C functions but not so well with C++ functions (name mangling problem).

I added in the end of interfaces/CsPerfThread.cpp some extern "C" functions to expose the csoundPerformanceThread class methods as C functions.

Building Csound here on my linux system, everything works fine. I can run the unit tests on Python2.7 and Python3.5 as well.

To run those test, one needs to downloads the files ctcsound.py, test_ctcsound.py, analogSynth01.csd, bufferInOut.csd and simple.csd from my github repo: https://github.com/fggp/ctcsound. Then the command python test_ctcsound.py should output something like this:

...
----------------------------------------------------------------------
Ran 6 tests in 2.382s

OK
...

Maybe, in ctcsound.py, the path for libcsoun64 and libcsnd6 have to be adjusted for windows (line 31 and line 2342), and OSX (line 33 and line 2344).

Mike could you please run the test with a freshly built CsoundĀ  on Windows, and Victor could you do the same on OSX ? If you have to change the path to the csound libs, can you indicate the right value ?

Regards

Francois