[Csnd] luacsnd6

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] luacsnd6

Johann Philippe-2
Hello all,

I've been trying to call Csound from luajit, 6 months ago, planning to send
some Csound score from luajit.  
And since i've installed the 6.10 version of Csound (windows 10), i can't
find the "luaCsnd6" library.
Is it a deprecated way to call Csound from lua ?
Is the a new way to do this, with "ffi" or something like that ?  

Thanking you in advance.

Johann



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] luacsnd6

Michael Gogins-2
You don't need luaCsnd6. See this exmaple: https://github.com/csound/examples/blob/master/lua/csound_ffi.lua.

This just uses LuaJIT's foreign function interface (FFI) to call the Csound API directly.

You do need to use LuaJIT compiled for 64 bit CPU architecture, and you may need to specify the full path to the Csound library, e.g.

local csoundApi = ffi.load('full/path/csound64')
Or, add the directory containing the Csound library to LUA_CPATH. This in fact may be why you are not loading luaCsnd6.

Hope this helps,
Mike


On Feb 2, 2018 09:45, "Johann Philippe" <[hidden email]> wrote:
Hello all,

I've been trying to call Csound from luajit, 6 months ago, planning to send
some Csound score from luajit.
And since i've installed the 6.10 version of Csound (windows 10), i can't
find the "luaCsnd6" library.
Is it a deprecated way to call Csound from lua ?
Is the a new way to do this, with "ffi" or something like that ?

Thanking you in advance.

Johann



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] luacsnd6

Francesco Porta
In reply to this post by Johann Philippe-2
Hello Michael,
just to understand do you suggest not using anymore LuaCsnd6,
and using instead luajit ffi?
And may ask why?

Thanks,
ciao,
francesco




Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] luacsnd6

Michael Gogins-2
If a foreign function interface is feasible and stable it is preferable to a generated interface.  People  now use ctcsound.py for that reason. FFIs are inherently cross platform and can perform well if part of a JIT. 

Can you tell us more about your needs?

Regards, 
Mike

On Feb 3, 2018 03:32, "Francesco Porta" <[hidden email]> wrote:
Hello Michael,
just to understand do you suggest not using anymore LuaCsnd6,
and using instead luajit ffi?
And may ask why?

Thanks,
ciao,
francesco




Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] luacsnd6

Johann Philippe-2
Thank you Michael, the foreign function interface works perfectly fine here (i tried the example  on the link).
I'll learn more about this.

Johann
Le samedi 3 février 2018 à 13:37:03 UTC+1, Michael Gogins <[hidden email]> a écrit :


If a foreign function interface is feasible and stable it is preferable to a generated interface.  People  now use ctcsound.py for that reason. FFIs are inherently cross platform and can perform well if part of a JIT. 

Can you tell us more about your needs?

Regards, 
Mike

On Feb 3, 2018 03:32, "Francesco Porta" <[hidden email]> wrote:
Hello Michael,
just to understand do you suggest not using anymore LuaCsnd6,
and using instead luajit ffi?
And may ask why?

Thanks,
ciao,
francesco




Csound mailing list
[hidden email]
https://listserv.heanet.ie/ cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/ csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] luacsnd6

Michael Gogins-2
Glad it worked!

Mike

On Feb 3, 2018 10:11 AM, "Johann Philippe" <[hidden email]> wrote:
Thank you Michael, the foreign function interface works perfectly fine here (i tried the example  on the link).
I'll learn more about this.

Johann
Le samedi 3 février 2018 à 13:37:03 UTC+1, Michael Gogins <[hidden email]> a écrit :


If a foreign function interface is feasible and stable it is preferable to a generated interface.  People  now use ctcsound.py for that reason. FFIs are inherently cross platform and can perform well if part of a JIT. 

Can you tell us more about your needs?

Regards, 
Mike

On Feb 3, 2018 03:32, "Francesco Porta" <[hidden email]> wrote:
Hello Michael,
just to understand do you suggest not using anymore LuaCsnd6,
and using instead luajit ffi?
And may ask why?

Thanks,
ciao,
francesco




Csound mailing list
[hidden email]
https://listserv.heanet.ie/ cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/ csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] luacsnd6

Francesco Porta
In reply to this post by Michael Gogins-2
Thanks.

Well i use luaJIT with lgi (GTK) for building simple GUI to communicate
to Csound.

Simply i'm so used to this way and i'm lazy :)

I find using ffi a little bit more complicated for my skills.

Anyway maybe it's time for me to change language and start using
javascript and wasm.

Again thanks,

ciao,

francesco.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here