Csound Csound-dev Csound-tekno Search About

Re: [Csnd] Python to csound

Date2018-07-23 16:16
FromJoel Ramsbottom
SubjectRe: [Csnd] Python to csound
I can't see much documentation on ctcsound? is it more effective than using OSC ?

Csound mailing list
Csound@listserv.heanet.ie
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

Date2018-07-23 16:49
FromForrest Curo
SubjectRe: [Csnd] Python to csound
ctcsound is neither 'more effective' or 'less effective'. It puts the commands you might want to send to csound into a graphic 'notebook' from which you can trigger them conveniently when you want them. OSC is a means of communication between instruments & programs; ctcsound is an interface between csound & you.

On Mon, Jul 23, 2018 at 8:16 AM, Joel Ramsbottom <joel.ramsbottom@hotmail.co.uk> wrote:
I can't see much documentation on ctcsound? is it more effective than using OSC ?

Csound mailing list
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2018-07-23 19:49
FromRichard
SubjectRe: [Csnd] Python to csound

Ctctsound is much more powerful than the 'old' python API. With it you can directly read or write csound channels, and also tables.
It can be used from any Python program (does not have  to be a notebook or a GUI). Csound has to run on the same machine as your Python program, though.

OSC is somewhat trickier, you have to keep track of variable types and there is somewhat more coding involved on both sides. A definite advantage of OSC is that your program does not have to be on the same computer as csound. 


On 23/07/18 17:49, Forrest Curo wrote:
ctcsound is neither 'more effective' or 'less effective'. It puts the commands you might want to send to csound into a graphic 'notebook' from which you can trigger them conveniently when you want them. OSC is a means of communication between instruments & programs; ctcsound is an interface between csound & you.

On Mon, Jul 23, 2018 at 8:16 AM, Joel Ramsbottom <joel.ramsbottom@hotmail.co.uk> wrote:
I can't see much documentation on ctcsound? is it more effective than using OSC ?

Csound mailing list
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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


Date2018-07-25 08:08
Fromfauveboy
SubjectRe: [Csnd] Python to csound
for now I'm using aiosc module (python) library to maintain a full-duplex
communication. I means that csound programs can stop and start and the osc
connection can remain available 



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

Csound mailing list
Csound@listserv.heanet.ie
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

Date2018-07-30 13:48
Fromfauveboy
SubjectRe: [Csnd] Python to csound
also is csnd not used anymore and is replaced by ctcsound?
https://github.com/csound/csoundAPI_examples/blob/master/python/example2.py



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

Csound mailing list
Csound@listserv.heanet.ie
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

Date2018-07-30 14:01
FromFrancois PINOT
SubjectRe: [Csnd] Python to csound
ctcsound was introduced in Csound 6.07. ctcsound works with Python2.x and Python3.x as well, and it uses the numpy ndarray data format to point to Csound tables and channels, giving the user the opportunity to use easily the scientific computing python environment developed around numpy and scipy.

csnd6 is still delivered with each Csound 6.0x release where x is greater than or equal to 7. However, it is recommended to use ctcsound instead, because csnd6 might become obsolete in the next major release of Csound (7.xx).

François

2018-07-30 14:48 GMT+02:00 fauveboy <joel.ramsbottom@hotmail.co.uk>:
also is csnd not used anymore and is replaced by ctcsound?
https://github.com/csound/csoundAPI_examples/blob/master/python/example2.py



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

Csound mailing list
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2018-07-30 15:10
Fromfauveboy
SubjectRe: [Csnd] Python to csound
Can I run/manage csound instruments inside a python script using ctcsound
like csnd...if so how?



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

Csound mailing list
Csound@listserv.heanet.ie
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

Date2018-07-30 15:25
FromFrancois PINOT
SubjectRe: [Csnd] Python to csound
ctcsound is just another wrapper from python to the Csound API, so it can do everything csnd6 does (and some more). You can have a look at the coobooks here: https://github.com/fggp/ctcsound/tree/master/cookbook, you can look at the examples here: https://github.com/csound/csoundAPI_examples/blob/master/python/CtcsoundAPIExamples.ipynb, you can read the examples in this book written by Victor: https://www.springer.com/gp/book/9783319635033. And, of course, you can look at the code itself which is fully documented like any other python module.

François


2018-07-30 16:10 GMT+02:00 fauveboy <joel.ramsbottom@hotmail.co.uk>:
Can I run/manage csound instruments inside a python script using ctcsound
like csnd...if so how?



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

Csound mailing list
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2018-07-30 15:38
Fromfauveboy
SubjectRe: [Csnd] Python to csound
I've install everything on the page.

I have a simple .py file import ctcsound...and the compiler still complain:

    Traceback (most recent call last):
        File "csoundapipython.py", line 1, in 
            import ctcsound
        File  "/home/pi/.local/lib/python3.5/site-packages/ctcsound.py",
line 29, in 

Date2018-07-30 15:46
FromFrancois PINOT
SubjectRe: [Csnd] Python to csound
It means that ctcsound does not find the Csound API shared library. Which is your OS, how did you install Csound?

2018-07-30 16:38 GMT+02:00 fauveboy <joel.ramsbottom@hotmail.co.uk>:
I've install everything on the page.

I have a simple .py file import ctcsound...and the compiler still complain:

    Traceback (most recent call last):
        File "csoundapipython.py", line 1, in <module>
            import ctcsound
        File  "/home/pi/.local/lib/python3.5/site-packages/ctcsound.py",
line 29, in <module?
             libcsound = CDLL("libcsound64.so")
       File "usr/lib/python3.5/ctypes/__init__.py", line 347, in __init___
            self._handle = _dlopen(self._name, mode)
OSError: libcsound64.so: cannot open shared object file: No such file or
directory




what does this mean?




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

Csound mailing list
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2018-07-30 16:15
Fromfauveboy
SubjectRe: [Csnd] Python to csound
Im running Raspbian Lite I think i just used: sudo apt-get install csound



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

Csound mailing list
Csound@listserv.heanet.ie
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

Date2018-07-30 16:52
FromVictor Lazzarini
SubjectRe: [Csnd] Python to csound
you probably need libcsound64-dev or something.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 30 Jul 2018, at 16:15, fauveboy  wrote:
> 
> Im running Raspbian Lite I think i just used: sudo apt-get install csound
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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

Date2018-07-30 17:11
FromFrancois PINOT
SubjectRe: [Csnd] Python to csound
You can try to create a symlink in /usr/local/lib which points to libcsound64.so. For example, if libcsound64.so is located in /usr/lib, something like that:

cd /usr/local/lib
ln -s /usr/lib/libcsound64.so libcsound64.so
ldconfig


2018-07-30 17:15 GMT+02:00 fauveboy <joel.ramsbottom@hotmail.co.uk>:
Im running Raspbian Lite I think i just used: sudo apt-get install csound



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

Csound mailing list
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2018-07-30 17:50
FromVictor Lazzarini
SubjectRe: [Csnd] Python to csound
I think the symlink (and headers) are provided by the -dev package, he just needs to install it.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 30 Jul 2018, at 17:11, Francois PINOT  wrote:
> 
> You can try to create a symlink in /usr/local/lib which points to libcsound64.so. For example, if libcsound64.so is located in /usr/lib, something like that:
> 
> cd /usr/local/lib
> ln -s /usr/lib/libcsound64.so libcsound64.so
> ldconfig
> 
> 
> 2018-07-30 17:15 GMT+02:00 fauveboy :
> Im running Raspbian Lite I think i just used: sudo apt-get install csound
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> 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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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

Date2018-07-30 17:57
FromFrancois PINOT
SubjectRe: [Csnd] Python to csound
Victor is right. You should install the dev package first, and then if it doesn't work, try the symlink solution.

François 


Le lun. 30 juil. 2018 à 18:50, Victor Lazzarini <Victor.Lazzarini@mu.ie> a écrit :
I think the symlink (and headers) are provided by the -dev package, he just needs to install it.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 30 Jul 2018, at 17:11, Francois PINOT <fggpinot@gmail.com> wrote:
>
> You can try to create a symlink in /usr/local/lib which points to libcsound64.so. For example, if libcsound64.so is located in /usr/lib, something like that:
>
> cd /usr/local/lib
> ln -s /usr/lib/libcsound64.so libcsound64.so
> ldconfig
>
>
> 2018-07-30 17:15 GMT+02:00 fauveboy <joel.ramsbottom@hotmail.co.uk>:
> Im running Raspbian Lite I think i just used: sudo apt-get install csound
>
>
>
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
> Csound mailing list
> Csound@listserv.heanet.ie
> 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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2018-07-30 19:50
Fromfauveboy
SubjectRe: [Csnd] Python to csound
i've used:
$sudo apt-get install libcsound64-dev

and 

cd /usr/local/lib
ln -s /usr/lib/libcsound64.so libcsound64.so
ldconfig

the error ahs changed slightly,

the cli now says the following:

Traceback (most recent call last):
    File "csoundapipython.py", line1, in 
        import ctcsound
    File "/home/pi/.local/lib/python.3.5/site-packages/ctcsound.py", line
185, in 
        libcsound.csoundCompileTreeAsync.argtypes = [c_void_p, c_void_p]
    File "/usr/lib/python3.5/ctypes/__init__.py",line 360, in __getattr__
        func = self.__getitem__(name)
    File "/usr/lib/python3.5/ctypes/__init__.py", line 365, in__getitem__
        func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libcsound64.so: undefined symbol:
csoundCompileTreeAsync



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

Csound mailing list
Csound@listserv.heanet.ie
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

Date2018-07-30 21:10
FromFrancois PINOT
SubjectRe: [Csnd] Python to csound
So now libcsound64.so is found but you're using a version of ctcsound that is more recent than the one shipped with the Csound package you've installed. In fact, if some new functions are added to the Csound API, ctcsound is changed accordingly in Github. csoundCompileTreeAsync was added in Csound6.10. It seems that the Csound package you've installed is older than 6.10. So csoundCompileTreeAsync is referenced in the ctcsound module you're using but it is not found in the libcsound64.so shared library installed by the Csound package. You should replace the ctcsound.py file in your /home/pi/.local/lib/python.3.5/site-packages/ directory by the ctcsound.py file shipped within the Csound package you've installed.

François

Le lun. 30 juil. 2018 à 20:50, fauveboy <joel.ramsbottom@hotmail.co.uk> a écrit :
i've used:
$sudo apt-get install libcsound64-dev

and

cd /usr/local/lib
ln -s /usr/lib/libcsound64.so libcsound64.so
ldconfig

the error ahs changed slightly,

the cli now says the following:

Traceback (most recent call last):
    File "csoundapipython.py", line1, in <module>
        import ctcsound
    File "/home/pi/.local/lib/python.3.5/site-packages/ctcsound.py", line
185, in <module>
        libcsound.csoundCompileTreeAsync.argtypes = [c_void_p, c_void_p]
    File "/usr/lib/python3.5/ctypes/__init__.py",line 360, in __getattr__
        func = self.__getitem__(name)
    File "/usr/lib/python3.5/ctypes/__init__.py", line 365, in__getitem__
        func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libcsound64.so: undefined symbol:
csoundCompileTreeAsync



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

Csound mailing list
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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