Re: [Csnd] Python to csound

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

Re: [Csnd] Python to csound

fauveboy
I'm using a python script that receives data from the monome which I then need to send onto csound

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] Python to csound

fauveboy
I can't see much documentation on ctcsound? is it more effective than using OSC ?

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] Python to csound

forrest
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 <[hidden email]> wrote:
I can't see much documentation on ctcsound? is it more effective than using OSC ?

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] Python to csound

zappfinger
This post was updated on .
Ctcsound 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 <mailto: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 <mailto:Csound@listserv.heanet.ie>
>     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>     Send bugs reports to
>     https://github.com/csound/csound/issues
>     <https://github.com/csound/csound/issues>
>     Discussions of bugs and features can be posted here
>
>
> Csound mailing list Csound@listserv.heanet.ie
> <mailto: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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Python to csound

fauveboy
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
[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] Python to csound

fauveboy
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
[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] Python to csound

Francois PINOT
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 <[hidden email]>:
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
[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] Python to csound

fauveboy
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
[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] Python to csound

Francois PINOT
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 <[hidden email]>:
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
[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] Python to csound

fauveboy
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
[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] Python to csound

Francois PINOT
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 <[hidden email]>:
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
[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] Python to csound

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
[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] Python to csound

Victor Lazzarini-2
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 <[hidden email]> 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
> [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] Python to csound

Francois PINOT
In reply to this post by fauveboy
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 <[hidden email]>:
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
[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] Python to csound

Victor Lazzarini-2
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 <[hidden email]> 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 <[hidden email]>:
> 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
> [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] Python to csound

Francois PINOT
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>:
> 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
> [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] Python to csound

fauveboy
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
[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] Python to csound

Francois PINOT
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 <[hidden email]> 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
[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