Csound Csound-dev Csound-tekno Search About

Optimization tip wanted for Csound/Python

Date2016-10-13 13:33
FromOeyvind Brandtsegg
SubjectOptimization tip wanted for Csound/Python
Hi,
I need to transfer the contents of an array from Csound to Python, as
I want to do some peak picking and other analysis that is easier to
get done in Python. The problem is that my (admittedly ad hoc) method
of transferring the values from Csound to Python incurs significant
performance degradation (more details on how I measure this later in
this email).

The basic premise is that I need Csound to be the main program (the
host), and Python runs via the py opcodes.

The array kAuto is of size 256, and transfer needs to be done once
every 1 second, for 3 of these arrays. One should think the bandwidth
requirement are not too taxing on any system, but since I only send
single values, there are more than 700 pycalls happening in one k-rate
pass.
The python function "p.fill_array" does nothing but put the received
values one by one into a numpy array.

  kcnt_fill = 0
  while kcnt_fill < ifftsize/2 do
    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
    kcnt_fill += 1
  od


By performance degradation I mean that the operation seems to let the
different processes to wait for each other a lot, utlimately leading
to dropouts in realtime audio. This does not show up as CPU spikes
(running at around 50%), but shows in Reaper's performence meter as
"RT longest-block". This meter shows the number of milliseconds
used/available per audio processing block. The *used* must generally
be less than the *available* time to avoid dropouts. Some spikes are
not necessarily bad, but in my case the *used* is generally quite
stable and higher than the *available*, unless I comment out the code
excerpt given above.

Is there any way I can send an array from Csound to Python in one go?
I seem to remember some black magic about letting Python running under
Csound get access to the (host) csound instance and thus accessing the
Csound API. Would that be the best way to do it, and would it be
considered a safe way of doing it?

 best
Oeyvind

Date2016-10-13 20:04
FromTarmo Johannes
SubjectRe: Optimization tip wanted for Csound/Python

Not sure, but would --realtime switch on command line help? I don't know if that puts python to other thread from audio work...
Tarmo


13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg" <oyvind.brandtsegg@ntnu.no>:
Hi,
I need to transfer the contents of an array from Csound to Python, as
I want to do some peak picking and other analysis that is easier to
get done in Python. The problem is that my (admittedly ad hoc) method
of transferring the values from Csound to Python incurs significant
performance degradation (more details on how I measure this later in
this email).

The basic premise is that I need Csound to be the main program (the
host), and Python runs via the py opcodes.

The array kAuto is of size 256, and transfer needs to be done once
every 1 second, for 3 of these arrays. One should think the bandwidth
requirement are not too taxing on any system, but since I only send
single values, there are more than 700 pycalls happening in one k-rate
pass.
The python function "p.fill_array" does nothing but put the received
values one by one into a numpy array.

  kcnt_fill = 0
  while kcnt_fill < ifftsize/2 do
    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
    kcnt_fill += 1
  od


By performance degradation I mean that the operation seems to let the
different processes to wait for each other a lot, utlimately leading
to dropouts in realtime audio. This does not show up as CPU spikes
(running at around 50%), but shows in Reaper's performence meter as
"RT longest-block". This meter shows the number of milliseconds
used/available per audio processing block. The *used* must generally
be less than the *available* time to avoid dropouts. Some spikes are
not necessarily bad, but in my case the *used* is generally quite
stable and higher than the *available*, unless I comment out the code
excerpt given above.

Is there any way I can send an array from Csound to Python in one go?
I seem to remember some black magic about letting Python running under
Csound get access to the (host) csound instance and thus accessing the
Csound API. Would that be the best way to do it, and would it be
considered a safe way of doing it?

 best
Oeyvind

--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-10-13 20:29
FromSteven Yi
SubjectRe: Optimization tip wanted for Csound/Python
Have you tried ftables? I.e. Filling the table in Csound, then reading from the table in the python code. I seem to remember the python opcodes having access to ftables and that there was example code for this.
On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes <tarmo.johannes@otsakool.edu.ee> wrote:

Not sure, but would --realtime switch on command line help? I don't know if that puts python to other thread from audio work...


Tarmo


13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg" <oyvind.brandtsegg@ntnu.no>:
Hi,
I need to transfer the contents of an array from Csound to Python, as
I want to do some peak picking and other analysis that is easier to
get done in Python. The problem is that my (admittedly ad hoc) method
of transferring the values from Csound to Python incurs significant
performance degradation (more details on how I measure this later in
this email).

The basic premise is that I need Csound to be the main program (the
host), and Python runs via the py opcodes.

The array kAuto is of size 256, and transfer needs to be done once
every 1 second, for 3 of these arrays. One should think the bandwidth
requirement are not too taxing on any system, but since I only send
single values, there are more than 700 pycalls happening in one k-rate
pass.
The python function "p.fill_array" does nothing but put the received
values one by one into a numpy array.

  kcnt_fill = 0
  while kcnt_fill < ifftsize/2 do
    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
    kcnt_fill += 1
  od


By performance degradation I mean that the operation seems to let the
different processes to wait for each other a lot, utlimately leading
to dropouts in realtime audio. This does not show up as CPU spikes
(running at around 50%), but shows in Reaper's performence meter as
"RT longest-block". This meter shows the number of milliseconds
used/available per audio processing block. The *used* must generally
be less than the *available* time to avoid dropouts. Some spikes are
not necessarily bad, but in my case the *used* is generally quite
stable and higher than the *available*, unless I comment out the code
excerpt given above.

Is there any way I can send an array from Csound to Python in one go?
I seem to remember some black magic about letting Python running under
Csound get access to the (host) csound instance and thus accessing the
Csound API. Would that be the best way to do it, and would it be
considered a safe way of doing it?

 best
Oeyvind

--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-10-13 20:44
Fromjoachim heintz
SubjectRe: Optimization tip wanted for Csound/Python
another option might be to use OSC.  john recently implemented the 
possibility to send/receive arrays and tables via OSC.  not sure if this 
can be an option for your case though.
ciao -
	joachim


On 13/10/16 21:29, Steven Yi wrote:
> Have you tried ftables? I.e. Filling the table in Csound, then reading from
> the table in the python code. I seem to remember the python opcodes having
> access to ftables and that there was example code for this.
> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes <
> tarmo.johannes@otsakool.edu.ee> wrote:
>
>> Not sure, but would --realtime switch on command line help? I don't know
>> if that puts python to other thread from audio work...
>>
>>
>> Tarmo
>>
>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg" <
>> oyvind.brandtsegg@ntnu.no>:
>>
>> Hi,
>> I need to transfer the contents of an array from Csound to Python, as
>> I want to do some peak picking and other analysis that is easier to
>> get done in Python. The problem is that my (admittedly ad hoc) method
>> of transferring the values from Csound to Python incurs significant
>> performance degradation (more details on how I measure this later in
>> this email).
>>
>> The basic premise is that I need Csound to be the main program (the
>> host), and Python runs via the py opcodes.
>>
>> The array kAuto is of size 256, and transfer needs to be done once
>> every 1 second, for 3 of these arrays. One should think the bandwidth
>> requirement are not too taxing on any system, but since I only send
>> single values, there are more than 700 pycalls happening in one k-rate
>> pass.
>> The python function "p.fill_array" does nothing but put the received
>> values one by one into a numpy array.
>>
>>   kcnt_fill = 0
>>   while kcnt_fill < ifftsize/2 do
>>     pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>>     kcnt_fill += 1
>>   od
>>
>>
>> By performance degradation I mean that the operation seems to let the
>> different processes to wait for each other a lot, utlimately leading
>> to dropouts in realtime audio. This does not show up as CPU spikes
>> (running at around 50%), but shows in Reaper's performence meter as
>> "RT longest-block". This meter shows the number of milliseconds
>> used/available per audio processing block. The *used* must generally
>> be less than the *available* time to avoid dropouts. Some spikes are
>> not necessarily bad, but in my case the *used* is generally quite
>> stable and higher than the *available*, unless I comment out the code
>> excerpt given above.
>>
>> Is there any way I can send an array from Csound to Python in one go?
>> I seem to remember some black magic about letting Python running under
>> Csound get access to the (host) csound instance and thus accessing the
>> Csound API. Would that be the best way to do it, and would it be
>> considered a safe way of doing it?
>>
>>  best
>> Oeyvind
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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

Date2016-10-13 22:07
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
Hi all,
thanks for the suggestions.
If I can read from a csound table directly in python code, that would
be the best. Steven, do you mean this document
:http://pythonsound.sourceforge.net/pycsound.pdf ?
There were several things in there that I did not know about, is the
csound module as described there currently supported?

2016-10-13 21:29 GMT+02:00 Steven Yi :
> Have you tried ftables? I.e. Filling the table in Csound, then reading from
> the table in the python code. I seem to remember the python opcodes having
> access to ftables and that there was example code for this.
>
> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>  wrote:
>>
>> Not sure, but would --realtime switch on command line help? I don't know
>> if that puts python to other thread from audio work...
>>
>>
>> Tarmo
>>
>>
>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> :
>>>
>>> Hi,
>>> I need to transfer the contents of an array from Csound to Python, as
>>> I want to do some peak picking and other analysis that is easier to
>>> get done in Python. The problem is that my (admittedly ad hoc) method
>>> of transferring the values from Csound to Python incurs significant
>>> performance degradation (more details on how I measure this later in
>>> this email).
>>>
>>> The basic premise is that I need Csound to be the main program (the
>>> host), and Python runs via the py opcodes.
>>>
>>> The array kAuto is of size 256, and transfer needs to be done once
>>> every 1 second, for 3 of these arrays. One should think the bandwidth
>>> requirement are not too taxing on any system, but since I only send
>>> single values, there are more than 700 pycalls happening in one k-rate
>>> pass.
>>> The python function "p.fill_array" does nothing but put the received
>>> values one by one into a numpy array.
>>>
>>>   kcnt_fill = 0
>>>   while kcnt_fill < ifftsize/2 do
>>>     pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>>>     kcnt_fill += 1
>>>   od
>>>
>>>
>>> By performance degradation I mean that the operation seems to let the
>>> different processes to wait for each other a lot, utlimately leading
>>> to dropouts in realtime audio. This does not show up as CPU spikes
>>> (running at around 50%), but shows in Reaper's performence meter as
>>> "RT longest-block". This meter shows the number of milliseconds
>>> used/available per audio processing block. The *used* must generally
>>> be less than the *available* time to avoid dropouts. Some spikes are
>>> not necessarily bad, but in my case the *used* is generally quite
>>> stable and higher than the *available*, unless I comment out the code
>>> excerpt given above.
>>>
>>> Is there any way I can send an array from Csound to Python in one go?
>>> I seem to remember some black magic about letting Python running under
>>> Csound get access to the (host) csound instance and thus accessing the
>>> Csound API. Would that be the best way to do it, and would it be
>>> considered a safe way of doing it?
>>>
>>>  best
>>> Oeyvind
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> 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



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-10-13 22:18
FromSteven Yi
SubjectRe: Optimization tip wanted for Csound/Python

Yes I think that was what I was thinking of, but I'm unsure whether it is supported now or not.


On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
Hi all,
thanks for the suggestions.
If I can read from a csound table directly in python code, that would
be the best. Steven, do you mean this document
:http://pythonsound.sourceforge.net/pycsound.pdf ?
There were several things in there that I did not know about, is the
csound module as described there currently supported?

2016-10-13 21:29 GMT+02:00 Steven Yi <stevenyi@gmail.com>:
> Have you tried ftables? I.e. Filling the table in Csound, then reading from
> the table in the python code. I seem to remember the python opcodes having
> access to ftables and that there was example code for this.
>
> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
> <tarmo.johannes@otsakool.edu.ee> wrote:
>>
>> Not sure, but would --realtime switch on command line help? I don't know
>> if that puts python to other thread from audio work...
>>
>>
>> Tarmo
>>
>>
>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> <oyvind.brandtsegg@ntnu.no>:
>>>
>>> Hi,
>>> I need to transfer the contents of an array from Csound to Python, as
>>> I want to do some peak picking and other analysis that is easier to
>>> get done in Python. The problem is that my (admittedly ad hoc) method
>>> of transferring the values from Csound to Python incurs significant
>>> performance degradation (more details on how I measure this later in
>>> this email).
>>>
>>> The basic premise is that I need Csound to be the main program (the
>>> host), and Python runs via the py opcodes.
>>>
>>> The array kAuto is of size 256, and transfer needs to be done once
>>> every 1 second, for 3 of these arrays. One should think the bandwidth
>>> requirement are not too taxing on any system, but since I only send
>>> single values, there are more than 700 pycalls happening in one k-rate
>>> pass.
>>> The python function "p.fill_array" does nothing but put the received
>>> values one by one into a numpy array.
>>>
>>>   kcnt_fill = 0
>>>   while kcnt_fill < ifftsize/2 do
>>>     pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>>>     kcnt_fill += 1
>>>   od
>>>
>>>
>>> By performance degradation I mean that the operation seems to let the
>>> different processes to wait for each other a lot, utlimately leading
>>> to dropouts in realtime audio. This does not show up as CPU spikes
>>> (running at around 50%), but shows in Reaper's performence meter as
>>> "RT longest-block". This meter shows the number of milliseconds
>>> used/available per audio processing block. The *used* must generally
>>> be less than the *available* time to avoid dropouts. Some spikes are
>>> not necessarily bad, but in my case the *used* is generally quite
>>> stable and higher than the *available*, unless I comment out the code
>>> excerpt given above.
>>>
>>> Is there any way I can send an array from Csound to Python in one go?
>>> I seem to remember some black magic about letting Python running under
>>> Csound get access to the (host) csound instance and thus accessing the
>>> Csound API. Would that be the best way to do it, and would it be
>>> considered a safe way of doing it?
>>>
>>>  best
>>> Oeyvind
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-10-13 22:49
FromVictor Lazzarini
SubjectRe: Optimization tip wanted for Csound/Python
It is possible to read a Csound ftable via the API.

I'd also suggest migrating to ctcsound if you
are using csnd6. It's excellent.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 13 Oct 2016, at 22:18, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yes I think that was what I was thinking of, but I'm unsure whether it is supported now or not.


On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
Hi all,
thanks for the suggestions.
If I can read from a csound table directly in python code, that would
be the best. Steven, do you mean this document
:http://pythonsound.sourceforge.net/pycsound.pdf ?
There were several things in there that I did not know about, is the
csound module as described there currently supported?

2016-10-13 21:29 GMT+02:00 Steven Yi <stevenyi@gmail.com>:
> Have you tried ftables? I.e. Filling the table in Csound, then reading from
> the table in the python code. I seem to remember the python opcodes having
> access to ftables and that there was example code for this.
>
> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
> <tarmo.johannes@otsakool.edu.ee> wrote:
>>
>> Not sure, but would --realtime switch on command line help? I don't know
>> if that puts python to other thread from audio work...
>>
>>
>> Tarmo
>>
>>
>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> <oyvind.brandtsegg@ntnu.no>:
>>>
>>> Hi,
>>> I need to transfer the contents of an array from Csound to Python, as
>>> I want to do some peak picking and other analysis that is easier to
>>> get done in Python. The problem is that my (admittedly ad hoc) method
>>> of transferring the values from Csound to Python incurs significant
>>> performance degradation (more details on how I measure this later in
>>> this email).
>>>
>>> The basic premise is that I need Csound to be the main program (the
>>> host), and Python runs via the py opcodes.
>>>
>>> The array kAuto is of size 256, and transfer needs to be done once
>>> every 1 second, for 3 of these arrays. One should think the bandwidth
>>> requirement are not too taxing on any system, but since I only send
>>> single values, there are more than 700 pycalls happening in one k-rate
>>> pass.
>>> The python function "p.fill_array" does nothing but put the received
>>> values one by one into a numpy array.
>>>
>>>   kcnt_fill = 0
>>>   while kcnt_fill < ifftsize/2 do
>>>     pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>>>     kcnt_fill += 1
>>>   od
>>>
>>>
>>> By performance degradation I mean that the operation seems to let the
>>> different processes to wait for each other a lot, utlimately leading
>>> to dropouts in realtime audio. This does not show up as CPU spikes
>>> (running at around 50%), but shows in Reaper's performence meter as
>>> "RT longest-block". This meter shows the number of milliseconds
>>> used/available per audio processing block. The *used* must generally
>>> be less than the *available* time to avoid dropouts. Some spikes are
>>> not necessarily bad, but in my case the *used* is generally quite
>>> stable and higher than the *available*, unless I comment out the code
>>> excerpt given above.
>>>
>>> Is there any way I can send an array from Csound to Python in one go?
>>> I seem to remember some black magic about letting Python running under
>>> Csound get access to the (host) csound instance and thus accessing the
>>> Csound API. Would that be the best way to do it, and would it be
>>> considered a safe way of doing it?
>>>
>>>  best
>>> Oeyvind
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-10-14 07:39
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
Thanks, Yes, ctcsound looks very nice. So far I've just followed the
info on the list with interest, waiting to dive in.
Is there some instructions on how to migrate somewhere? Do I need to
install Anaconda and Jupyter, or can I just replace some modules ?

2016-10-13 23:49 GMT+02:00 Victor Lazzarini :
> It is possible to read a Csound ftable via the API.
>
> I'd also suggest migrating to ctcsound if you
> are using csnd6. It's excellent.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
> On 13 Oct 2016, at 22:18, Steven Yi  wrote:
>
> Yes I think that was what I was thinking of, but I'm unsure whether it is
> supported now or not.
>
>
> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg 
> wrote:
>>
>> Hi all,
>> thanks for the suggestions.
>> If I can read from a csound table directly in python code, that would
>> be the best. Steven, do you mean this document
>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> There were several things in there that I did not know about, is the
>> csound module as described there currently supported?
>>
>> 2016-10-13 21:29 GMT+02:00 Steven Yi :
>> > Have you tried ftables? I.e. Filling the table in Csound, then reading
>> > from
>> > the table in the python code. I seem to remember the python opcodes
>> > having
>> > access to ftables and that there was example code for this.
>> >
>> > On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> >  wrote:
>> >>
>> >> Not sure, but would --realtime switch on command line help? I don't
>> >> know
>> >> if that puts python to other thread from audio work...
>> >>
>> >>
>> >> Tarmo
>> >>
>> >>
>> >> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> >> :
>> >>>
>> >>> Hi,
>> >>> I need to transfer the contents of an array from Csound to Python, as
>> >>> I want to do some peak picking and other analysis that is easier to
>> >>> get done in Python. The problem is that my (admittedly ad hoc) method
>> >>> of transferring the values from Csound to Python incurs significant
>> >>> performance degradation (more details on how I measure this later in
>> >>> this email).
>> >>>
>> >>> The basic premise is that I need Csound to be the main program (the
>> >>> host), and Python runs via the py opcodes.
>> >>>
>> >>> The array kAuto is of size 256, and transfer needs to be done once
>> >>> every 1 second, for 3 of these arrays. One should think the bandwidth
>> >>> requirement are not too taxing on any system, but since I only send
>> >>> single values, there are more than 700 pycalls happening in one k-rate
>> >>> pass.
>> >>> The python function "p.fill_array" does nothing but put the received
>> >>> values one by one into a numpy array.
>> >>>
>> >>>   kcnt_fill = 0
>> >>>   while kcnt_fill < ifftsize/2 do
>> >>>     pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>> >>>     kcnt_fill += 1
>> >>>   od
>> >>>
>> >>>
>> >>> By performance degradation I mean that the operation seems to let the
>> >>> different processes to wait for each other a lot, utlimately leading
>> >>> to dropouts in realtime audio. This does not show up as CPU spikes
>> >>> (running at around 50%), but shows in Reaper's performence meter as
>> >>> "RT longest-block". This meter shows the number of milliseconds
>> >>> used/available per audio processing block. The *used* must generally
>> >>> be less than the *available* time to avoid dropouts. Some spikes are
>> >>> not necessarily bad, but in my case the *used* is generally quite
>> >>> stable and higher than the *available*, unless I comment out the code
>> >>> excerpt given above.
>> >>>
>> >>> Is there any way I can send an array from Csound to Python in one go?
>> >>> I seem to remember some black magic about letting Python running under
>> >>> Csound get access to the (host) csound instance and thus accessing the
>> >>> Csound API. Would that be the best way to do it, and would it be
>> >>> considered a safe way of doing it?
>> >>>
>> >>>  best
>> >>> Oeyvind
>> >>>
>> >>> --
>> >>>
>> >>> Oeyvind Brandtsegg
>> >>> Professor of Music Technology
>> >>> NTNU
>> >>> 7491 Trondheim
>> >>> Norway
>> >>> Cell: +47 92 203 205
>> >>>
>> >>> http://www.partikkelaudio.com/
>> >>> http://crossadaptive.hf.ntnu.no
>> >>> http://gdsp.hf.ntnu.no/
>> >>> http://soundcloud.com/brandtsegg
>> >>> http://flyndresang.no/
>> >>> http://soundcloud.com/t-emp
>> >>>
>> >>> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-10-14 07:54
FromFrancois PINOT
SubjectRe: Optimization tip wanted for Csound/Python
Only numpy is mandatory.

You can use ctcsound with Python 2.x and/or Python 3.x. You need an environment set properly for each version of Python you will use. Anaconda facilitates this, and it provides a lot of modules for scientific computing. Jupyter is a plus allowing you to use Csound within notebooks.

François

2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
Thanks, Yes, ctcsound looks very nice. So far I've just followed the
info on the list with interest, waiting to dive in.
Is there some instructions on how to migrate somewhere? Do I need to
install Anaconda and Jupyter, or can I just replace some modules ?

2016-10-13 23:49 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> It is possible to read a Csound ftable via the API.
>
> I'd also suggest migrating to ctcsound if you
> are using csnd6. It's excellent.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
> On 13 Oct 2016, at 22:18, Steven Yi <stevenyi@GMAIL.COM> wrote:
>
> Yes I think that was what I was thinking of, but I'm unsure whether it is
> supported now or not.
>
>
> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>
> wrote:
>>
>> Hi all,
>> thanks for the suggestions.
>> If I can read from a csound table directly in python code, that would
>> be the best. Steven, do you mean this document
>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> There were several things in there that I did not know about, is the
>> csound module as described there currently supported?
>>
>> 2016-10-13 21:29 GMT+02:00 Steven Yi <stevenyi@gmail.com>:
>> > Have you tried ftables? I.e. Filling the table in Csound, then reading
>> > from
>> > the table in the python code. I seem to remember the python opcodes
>> > having
>> > access to ftables and that there was example code for this.
>> >
>> > On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> > <tarmo.johannes@otsakool.edu.ee> wrote:
>> >>
>> >> Not sure, but would --realtime switch on command line help? I don't
>> >> know
>> >> if that puts python to other thread from audio work...
>> >>
>> >>
>> >> Tarmo
>> >>
>> >>
>> >> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> >> <oyvind.brandtsegg@ntnu.no>:
>> >>>
>> >>> Hi,
>> >>> I need to transfer the contents of an array from Csound to Python, as
>> >>> I want to do some peak picking and other analysis that is easier to
>> >>> get done in Python. The problem is that my (admittedly ad hoc) method
>> >>> of transferring the values from Csound to Python incurs significant
>> >>> performance degradation (more details on how I measure this later in
>> >>> this email).
>> >>>
>> >>> The basic premise is that I need Csound to be the main program (the
>> >>> host), and Python runs via the py opcodes.
>> >>>
>> >>> The array kAuto is of size 256, and transfer needs to be done once
>> >>> every 1 second, for 3 of these arrays. One should think the bandwidth
>> >>> requirement are not too taxing on any system, but since I only send
>> >>> single values, there are more than 700 pycalls happening in one k-rate
>> >>> pass.
>> >>> The python function "p.fill_array" does nothing but put the received
>> >>> values one by one into a numpy array.
>> >>>
>> >>>   kcnt_fill = 0
>> >>>   while kcnt_fill < ifftsize/2 do
>> >>>     pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>> >>>     kcnt_fill += 1
>> >>>   od
>> >>>
>> >>>
>> >>> By performance degradation I mean that the operation seems to let the
>> >>> different processes to wait for each other a lot, utlimately leading
>> >>> to dropouts in realtime audio. This does not show up as CPU spikes
>> >>> (running at around 50%), but shows in Reaper's performence meter as
>> >>> "RT longest-block". This meter shows the number of milliseconds
>> >>> used/available per audio processing block. The *used* must generally
>> >>> be less than the *available* time to avoid dropouts. Some spikes are
>> >>> not necessarily bad, but in my case the *used* is generally quite
>> >>> stable and higher than the *available*, unless I comment out the code
>> >>> excerpt given above.
>> >>>
>> >>> Is there any way I can send an array from Csound to Python in one go?
>> >>> I seem to remember some black magic about letting Python running under
>> >>> Csound get access to the (host) csound instance and thus accessing the
>> >>> Csound API. Would that be the best way to do it, and would it be
>> >>> considered a safe way of doing it?
>> >>>
>> >>>  best
>> >>> Oeyvind
>> >>>
>> >>> --
>> >>>
>> >>> Oeyvind Brandtsegg
>> >>> Professor of Music Technology
>> >>> NTNU
>> >>> 7491 Trondheim
>> >>> Norway
>> >>> Cell: +47 92 203 205
>> >>>
>> >>> http://www.partikkelaudio.com/
>> >>> http://crossadaptive.hf.ntnu.no
>> >>> http://gdsp.hf.ntnu.no/
>> >>> http://soundcloud.com/brandtsegg
>> >>> http://flyndresang.no/
>> >>> http://soundcloud.com/t-emp
>> >>>
>> >>> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-10-14 08:38
FromVictor Lazzarini
SubjectRe: Optimization tip wanted for Csound/Python
Here’s the method from ctcsound:

Help on method tableCopyIn in module ctcsound:

tableCopyIn(self, table, src) unbound ctcsound.Csound method
    Copy the contents of an ndarray src into a given function table.
    
    The table number is assumed to be valid, and the table needs to
    have sufficient space to receive all the array contents.


> On 14 Oct 2016, at 07:39, Oeyvind Brandtsegg  wrote:
> 
> Thanks, Yes, ctcsound looks very nice. So far I've just followed the
> info on the list with interest, waiting to dive in.
> Is there some instructions on how to migrate somewhere? Do I need to
> install Anaconda and Jupyter, or can I just replace some modules ?
> 
> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini :
>> It is possible to read a Csound ftable via the API.
>> 
>> I'd also suggest migrating to ctcsound if you
>> are using csnd6. It's excellent.
>> 
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>> 
>> On 13 Oct 2016, at 22:18, Steven Yi  wrote:
>> 
>> Yes I think that was what I was thinking of, but I'm unsure whether it is
>> supported now or not.
>> 
>> 
>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg 
>> wrote:
>>> 
>>> Hi all,
>>> thanks for the suggestions.
>>> If I can read from a csound table directly in python code, that would
>>> be the best. Steven, do you mean this document
>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>>> There were several things in there that I did not know about, is the
>>> csound module as described there currently supported?
>>> 
>>> 2016-10-13 21:29 GMT+02:00 Steven Yi :
>>>> Have you tried ftables? I.e. Filling the table in Csound, then reading
>>>> from
>>>> the table in the python code. I seem to remember the python opcodes
>>>> having
>>>> access to ftables and that there was example code for this.
>>>> 
>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>>>>  wrote:
>>>>> 
>>>>> Not sure, but would --realtime switch on command line help? I don't
>>>>> know
>>>>> if that puts python to other thread from audio work...
>>>>> 
>>>>> 
>>>>> Tarmo
>>>>> 
>>>>> 
>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>>>>> :
>>>>>> 
>>>>>> Hi,
>>>>>> I need to transfer the contents of an array from Csound to Python, as
>>>>>> I want to do some peak picking and other analysis that is easier to
>>>>>> get done in Python. The problem is that my (admittedly ad hoc) method
>>>>>> of transferring the values from Csound to Python incurs significant
>>>>>> performance degradation (more details on how I measure this later in
>>>>>> this email).
>>>>>> 
>>>>>> The basic premise is that I need Csound to be the main program (the
>>>>>> host), and Python runs via the py opcodes.
>>>>>> 
>>>>>> The array kAuto is of size 256, and transfer needs to be done once
>>>>>> every 1 second, for 3 of these arrays. One should think the bandwidth
>>>>>> requirement are not too taxing on any system, but since I only send
>>>>>> single values, there are more than 700 pycalls happening in one k-rate
>>>>>> pass.
>>>>>> The python function "p.fill_array" does nothing but put the received
>>>>>> values one by one into a numpy array.
>>>>>> 
>>>>>>  kcnt_fill = 0
>>>>>>  while kcnt_fill < ifftsize/2 do
>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>>>>>>    kcnt_fill += 1
>>>>>>  od
>>>>>> 
>>>>>> 
>>>>>> By performance degradation I mean that the operation seems to let the
>>>>>> different processes to wait for each other a lot, utlimately leading
>>>>>> to dropouts in realtime audio. This does not show up as CPU spikes
>>>>>> (running at around 50%), but shows in Reaper's performence meter as
>>>>>> "RT longest-block". This meter shows the number of milliseconds
>>>>>> used/available per audio processing block. The *used* must generally
>>>>>> be less than the *available* time to avoid dropouts. Some spikes are
>>>>>> not necessarily bad, but in my case the *used* is generally quite
>>>>>> stable and higher than the *available*, unless I comment out the code
>>>>>> excerpt given above.
>>>>>> 
>>>>>> Is there any way I can send an array from Csound to Python in one go?
>>>>>> I seem to remember some black magic about letting Python running under
>>>>>> Csound get access to the (host) csound instance and thus accessing the
>>>>>> Csound API. Would that be the best way to do it, and would it be
>>>>>> considered a safe way of doing it?
>>>>>> 
>>>>>> best
>>>>>> Oeyvind
>>>>>> 
>>>>>> --
>>>>>> 
>>>>>> Oeyvind Brandtsegg
>>>>>> Professor of Music Technology
>>>>>> NTNU
>>>>>> 7491 Trondheim
>>>>>> Norway
>>>>>> Cell: +47 92 203 205
>>>>>> 
>>>>>> http://www.partikkelaudio.com/
>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>> http://gdsp.hf.ntnu.no/
>>>>>> http://soundcloud.com/brandtsegg
>>>>>> http://flyndresang.no/
>>>>>> http://soundcloud.com/t-emp
>>>>>> 
>>>>>> 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
>>> 
>>> 
>>> 
>>> --
>>> 
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>> 
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>> 
>>> 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
> 
> 
> 
> -- 
> 
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
> 
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
> 
> 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

Date2016-10-14 13:08
FromSteven Yi
SubjectRe: Optimization tip wanted for Csound/Python
But does ctcsound work within the python opcodes, as Oeyvind mentioned in the original email?

On Fri, Oct 14, 2016 at 3:38 AM Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Here’s the method from ctcsound:

Help on method tableCopyIn in module ctcsound:

tableCopyIn(self, table, src) unbound ctcsound.Csound method
    Copy the contents of an ndarray src into a given function table.

    The table number is assumed to be valid, and the table needs to
    have sufficient space to receive all the array contents.


> On 14 Oct 2016, at 07:39, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
>
> Thanks, Yes, ctcsound looks very nice. So far I've just followed the
> info on the list with interest, waiting to dive in.
> Is there some instructions on how to migrate somewhere? Do I need to
> install Anaconda and Jupyter, or can I just replace some modules ?
>
> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> It is possible to read a Csound ftable via the API.
>>
>> I'd also suggest migrating to ctcsound if you
>> are using csnd6. It's excellent.
>>
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>>
>> On 13 Oct 2016, at 22:18, Steven Yi <stevenyi@GMAIL.COM> wrote:
>>
>> Yes I think that was what I was thinking of, but I'm unsure whether it is
>> supported now or not.
>>
>>
>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>
>> wrote:
>>>
>>> Hi all,
>>> thanks for the suggestions.
>>> If I can read from a csound table directly in python code, that would
>>> be the best. Steven, do you mean this document
>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>>> There were several things in there that I did not know about, is the
>>> csound module as described there currently supported?
>>>
>>> 2016-10-13 21:29 GMT+02:00 Steven Yi <stevenyi@gmail.com>:
>>>> Have you tried ftables? I.e. Filling the table in Csound, then reading
>>>> from
>>>> the table in the python code. I seem to remember the python opcodes
>>>> having
>>>> access to ftables and that there was example code for this.
>>>>
>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>>>> <tarmo.johannes@otsakool.edu.ee> wrote:
>>>>>
>>>>> Not sure, but would --realtime switch on command line help? I don't
>>>>> know
>>>>> if that puts python to other thread from audio work...
>>>>>
>>>>>
>>>>> Tarmo
>>>>>
>>>>>
>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>>>>> <oyvind.brandtsegg@ntnu.no>:
>>>>>>
>>>>>> Hi,
>>>>>> I need to transfer the contents of an array from Csound to Python, as
>>>>>> I want to do some peak picking and other analysis that is easier to
>>>>>> get done in Python. The problem is that my (admittedly ad hoc) method
>>>>>> of transferring the values from Csound to Python incurs significant
>>>>>> performance degradation (more details on how I measure this later in
>>>>>> this email).
>>>>>>
>>>>>> The basic premise is that I need Csound to be the main program (the
>>>>>> host), and Python runs via the py opcodes.
>>>>>>
>>>>>> The array kAuto is of size 256, and transfer needs to be done once
>>>>>> every 1 second, for 3 of these arrays. One should think the bandwidth
>>>>>> requirement are not too taxing on any system, but since I only send
>>>>>> single values, there are more than 700 pycalls happening in one k-rate
>>>>>> pass.
>>>>>> The python function "p.fill_array" does nothing but put the received
>>>>>> values one by one into a numpy array.
>>>>>>
>>>>>>  kcnt_fill = 0
>>>>>>  while kcnt_fill < ifftsize/2 do
>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>>>>>>    kcnt_fill += 1
>>>>>>  od
>>>>>>
>>>>>>
>>>>>> By performance degradation I mean that the operation seems to let the
>>>>>> different processes to wait for each other a lot, utlimately leading
>>>>>> to dropouts in realtime audio. This does not show up as CPU spikes
>>>>>> (running at around 50%), but shows in Reaper's performence meter as
>>>>>> "RT longest-block". This meter shows the number of milliseconds
>>>>>> used/available per audio processing block. The *used* must generally
>>>>>> be less than the *available* time to avoid dropouts. Some spikes are
>>>>>> not necessarily bad, but in my case the *used* is generally quite
>>>>>> stable and higher than the *available*, unless I comment out the code
>>>>>> excerpt given above.
>>>>>>
>>>>>> Is there any way I can send an array from Csound to Python in one go?
>>>>>> I seem to remember some black magic about letting Python running under
>>>>>> Csound get access to the (host) csound instance and thus accessing the
>>>>>> Csound API. Would that be the best way to do it, and would it be
>>>>>> considered a safe way of doing it?
>>>>>>
>>>>>> best
>>>>>> Oeyvind
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Oeyvind Brandtsegg
>>>>>> Professor of Music Technology
>>>>>> NTNU
>>>>>> 7491 Trondheim
>>>>>> Norway
>>>>>> Cell: +47 92 203 205
>>>>>>
>>>>>> http://www.partikkelaudio.com/
>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>> http://gdsp.hf.ntnu.no/
>>>>>> http://soundcloud.com/brandtsegg
>>>>>> http://flyndresang.no/
>>>>>> http://soundcloud.com/t-emp
>>>>>>
>>>>>> 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
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> 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
>
>
>
> --
>
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
>
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
>
> 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

Date2016-10-14 13:19
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
Ah, now I remember, I tried this earlier and did not complete
installing Anaconda, as it seemed like it could interfere with other
system variables so I backed out.
Is there a way for me to configure the environment without installing
Anaconda? I'm in the middle of several productions, so I am hesitant
to let an installer make automatic changes to my system.

2016-10-14 8:54 GMT+02:00 Francois PINOT :
> Only numpy is mandatory.
>
> You can use ctcsound with Python 2.x and/or Python 3.x. You need an
> environment set properly for each version of Python you will use. Anaconda
> facilitates this, and it provides a lot of modules for scientific computing.
> Jupyter is a plus allowing you to use Csound within notebooks.
>
> François
>
> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg :
>>
>> Thanks, Yes, ctcsound looks very nice. So far I've just followed the
>> info on the list with interest, waiting to dive in.
>> Is there some instructions on how to migrate somewhere? Do I need to
>> install Anaconda and Jupyter, or can I just replace some modules ?
>>
>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini :
>> > It is possible to read a Csound ftable via the API.
>> >
>> > I'd also suggest migrating to ctcsound if you
>> > are using csnd6. It's excellent.
>> >
>> > Victor Lazzarini
>> > Dean of Arts, Celtic Studies, and Philosophy
>> > Maynooth University
>> > Ireland
>> >
>> > On 13 Oct 2016, at 22:18, Steven Yi  wrote:
>> >
>> > Yes I think that was what I was thinking of, but I'm unsure whether it
>> > is
>> > supported now or not.
>> >
>> >
>> > On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>> > 
>> > wrote:
>> >>
>> >> Hi all,
>> >> thanks for the suggestions.
>> >> If I can read from a csound table directly in python code, that would
>> >> be the best. Steven, do you mean this document
>> >> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> >> There were several things in there that I did not know about, is the
>> >> csound module as described there currently supported?
>> >>
>> >> 2016-10-13 21:29 GMT+02:00 Steven Yi :
>> >> > Have you tried ftables? I.e. Filling the table in Csound, then
>> >> > reading
>> >> > from
>> >> > the table in the python code. I seem to remember the python opcodes
>> >> > having
>> >> > access to ftables and that there was example code for this.
>> >> >
>> >> > On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> >> >  wrote:
>> >> >>
>> >> >> Not sure, but would --realtime switch on command line help? I don't
>> >> >> know
>> >> >> if that puts python to other thread from audio work...
>> >> >>
>> >> >>
>> >> >> Tarmo
>> >> >>
>> >> >>
>> >> >> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> >> >> :
>> >> >>>
>> >> >>> Hi,
>> >> >>> I need to transfer the contents of an array from Csound to Python,
>> >> >>> as
>> >> >>> I want to do some peak picking and other analysis that is easier to
>> >> >>> get done in Python. The problem is that my (admittedly ad hoc)
>> >> >>> method
>> >> >>> of transferring the values from Csound to Python incurs significant
>> >> >>> performance degradation (more details on how I measure this later
>> >> >>> in
>> >> >>> this email).
>> >> >>>
>> >> >>> The basic premise is that I need Csound to be the main program (the
>> >> >>> host), and Python runs via the py opcodes.
>> >> >>>
>> >> >>> The array kAuto is of size 256, and transfer needs to be done once
>> >> >>> every 1 second, for 3 of these arrays. One should think the
>> >> >>> bandwidth
>> >> >>> requirement are not too taxing on any system, but since I only send
>> >> >>> single values, there are more than 700 pycalls happening in one
>> >> >>> k-rate
>> >> >>> pass.
>> >> >>> The python function "p.fill_array" does nothing but put the
>> >> >>> received
>> >> >>> values one by one into a numpy array.
>> >> >>>
>> >> >>>   kcnt_fill = 0
>> >> >>>   while kcnt_fill < ifftsize/2 do
>> >> >>>     pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>> >> >>>     kcnt_fill += 1
>> >> >>>   od
>> >> >>>
>> >> >>>
>> >> >>> By performance degradation I mean that the operation seems to let
>> >> >>> the
>> >> >>> different processes to wait for each other a lot, utlimately
>> >> >>> leading
>> >> >>> to dropouts in realtime audio. This does not show up as CPU spikes
>> >> >>> (running at around 50%), but shows in Reaper's performence meter as
>> >> >>> "RT longest-block". This meter shows the number of milliseconds
>> >> >>> used/available per audio processing block. The *used* must
>> >> >>> generally
>> >> >>> be less than the *available* time to avoid dropouts. Some spikes
>> >> >>> are
>> >> >>> not necessarily bad, but in my case the *used* is generally quite
>> >> >>> stable and higher than the *available*, unless I comment out the
>> >> >>> code
>> >> >>> excerpt given above.
>> >> >>>
>> >> >>> Is there any way I can send an array from Csound to Python in one
>> >> >>> go?
>> >> >>> I seem to remember some black magic about letting Python running
>> >> >>> under
>> >> >>> Csound get access to the (host) csound instance and thus accessing
>> >> >>> the
>> >> >>> Csound API. Would that be the best way to do it, and would it be
>> >> >>> considered a safe way of doing it?
>> >> >>>
>> >> >>>  best
>> >> >>> Oeyvind
>> >> >>>
>> >> >>> --
>> >> >>>
>> >> >>> Oeyvind Brandtsegg
>> >> >>> Professor of Music Technology
>> >> >>> NTNU
>> >> >>> 7491 Trondheim
>> >> >>> Norway
>> >> >>> Cell: +47 92 203 205
>> >> >>>
>> >> >>> http://www.partikkelaudio.com/
>> >> >>> http://crossadaptive.hf.ntnu.no
>> >> >>> http://gdsp.hf.ntnu.no/
>> >> >>> http://soundcloud.com/brandtsegg
>> >> >>> http://flyndresang.no/
>> >> >>> http://soundcloud.com/t-emp
>> >> >>>
>> >> >>> 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
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Oeyvind Brandtsegg
>> >> Professor of Music Technology
>> >> NTNU
>> >> 7491 Trondheim
>> >> Norway
>> >> Cell: +47 92 203 205
>> >>
>> >> http://www.partikkelaudio.com/
>> >> http://crossadaptive.hf.ntnu.no
>> >> http://gdsp.hf.ntnu.no/
>> >> http://soundcloud.com/brandtsegg
>> >> http://flyndresang.no/
>> >> http://soundcloud.com/t-emp
>> >>
>> >> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-10-14 13:26
FromVictor Lazzarini
SubjectRe: Optimization tip wanted for Csound/Python
You can just install numpy.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg  wrote:
> 
> Ah, now I remember, I tried this earlier and did not complete
> installing Anaconda, as it seemed like it could interfere with other
> system variables so I backed out.
> Is there a way for me to configure the environment without installing
> Anaconda? I'm in the middle of several productions, so I am hesitant
> to let an installer make automatic changes to my system.
> 
> 2016-10-14 8:54 GMT+02:00 Francois PINOT :
>> Only numpy is mandatory.
>> 
>> You can use ctcsound with Python 2.x and/or Python 3.x. You need an
>> environment set properly for each version of Python you will use. Anaconda
>> facilitates this, and it provides a lot of modules for scientific computing.
>> Jupyter is a plus allowing you to use Csound within notebooks.
>> 
>> François
>> 
>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg :
>>> 
>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed the
>>> info on the list with interest, waiting to dive in.
>>> Is there some instructions on how to migrate somewhere? Do I need to
>>> install Anaconda and Jupyter, or can I just replace some modules ?
>>> 
>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini :
>>>> It is possible to read a Csound ftable via the API.
>>>> 
>>>> I'd also suggest migrating to ctcsound if you
>>>> are using csnd6. It's excellent.
>>>> 
>>>> Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>> Maynooth University
>>>> Ireland
>>>> 
>>>> On 13 Oct 2016, at 22:18, Steven Yi  wrote:
>>>> 
>>>> Yes I think that was what I was thinking of, but I'm unsure whether it
>>>> is
>>>> supported now or not.
>>>> 
>>>> 
>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>>>> 
>>>> wrote:
>>>>> 
>>>>> Hi all,
>>>>> thanks for the suggestions.
>>>>> If I can read from a csound table directly in python code, that would
>>>>> be the best. Steven, do you mean this document
>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>>>>> There were several things in there that I did not know about, is the
>>>>> csound module as described there currently supported?
>>>>> 
>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi :
>>>>>> Have you tried ftables? I.e. Filling the table in Csound, then
>>>>>> reading
>>>>>> from
>>>>>> the table in the python code. I seem to remember the python opcodes
>>>>>> having
>>>>>> access to ftables and that there was example code for this.
>>>>>> 
>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>>>>>>  wrote:
>>>>>>> 
>>>>>>> Not sure, but would --realtime switch on command line help? I don't
>>>>>>> know
>>>>>>> if that puts python to other thread from audio work...
>>>>>>> 
>>>>>>> 
>>>>>>> Tarmo
>>>>>>> 
>>>>>>> 
>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>>>>>>> :
>>>>>>>> 
>>>>>>>> Hi,
>>>>>>>> I need to transfer the contents of an array from Csound to Python,
>>>>>>>> as
>>>>>>>> I want to do some peak picking and other analysis that is easier to
>>>>>>>> get done in Python. The problem is that my (admittedly ad hoc)
>>>>>>>> method
>>>>>>>> of transferring the values from Csound to Python incurs significant
>>>>>>>> performance degradation (more details on how I measure this later
>>>>>>>> in
>>>>>>>> this email).
>>>>>>>> 
>>>>>>>> The basic premise is that I need Csound to be the main program (the
>>>>>>>> host), and Python runs via the py opcodes.
>>>>>>>> 
>>>>>>>> The array kAuto is of size 256, and transfer needs to be done once
>>>>>>>> every 1 second, for 3 of these arrays. One should think the
>>>>>>>> bandwidth
>>>>>>>> requirement are not too taxing on any system, but since I only send
>>>>>>>> single values, there are more than 700 pycalls happening in one
>>>>>>>> k-rate
>>>>>>>> pass.
>>>>>>>> The python function "p.fill_array" does nothing but put the
>>>>>>>> received
>>>>>>>> values one by one into a numpy array.
>>>>>>>> 
>>>>>>>>  kcnt_fill = 0
>>>>>>>>  while kcnt_fill < ifftsize/2 do
>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>>>>>>>>    kcnt_fill += 1
>>>>>>>>  od
>>>>>>>> 
>>>>>>>> 
>>>>>>>> By performance degradation I mean that the operation seems to let
>>>>>>>> the
>>>>>>>> different processes to wait for each other a lot, utlimately
>>>>>>>> leading
>>>>>>>> to dropouts in realtime audio. This does not show up as CPU spikes
>>>>>>>> (running at around 50%), but shows in Reaper's performence meter as
>>>>>>>> "RT longest-block". This meter shows the number of milliseconds
>>>>>>>> used/available per audio processing block. The *used* must
>>>>>>>> generally
>>>>>>>> be less than the *available* time to avoid dropouts. Some spikes
>>>>>>>> are
>>>>>>>> not necessarily bad, but in my case the *used* is generally quite
>>>>>>>> stable and higher than the *available*, unless I comment out the
>>>>>>>> code
>>>>>>>> excerpt given above.
>>>>>>>> 
>>>>>>>> Is there any way I can send an array from Csound to Python in one
>>>>>>>> go?
>>>>>>>> I seem to remember some black magic about letting Python running
>>>>>>>> under
>>>>>>>> Csound get access to the (host) csound instance and thus accessing
>>>>>>>> the
>>>>>>>> Csound API. Would that be the best way to do it, and would it be
>>>>>>>> considered a safe way of doing it?
>>>>>>>> 
>>>>>>>> best
>>>>>>>> Oeyvind
>>>>>>>> 
>>>>>>>> --
>>>>>>>> 
>>>>>>>> Oeyvind Brandtsegg
>>>>>>>> Professor of Music Technology
>>>>>>>> NTNU
>>>>>>>> 7491 Trondheim
>>>>>>>> Norway
>>>>>>>> Cell: +47 92 203 205
>>>>>>>> 
>>>>>>>> http://www.partikkelaudio.com/
>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>>>> http://gdsp.hf.ntnu.no/
>>>>>>>> http://soundcloud.com/brandtsegg
>>>>>>>> http://flyndresang.no/
>>>>>>>> http://soundcloud.com/t-emp
>>>>>>>> 
>>>>>>>> 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
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> 
>>>>> Oeyvind Brandtsegg
>>>>> Professor of Music Technology
>>>>> NTNU
>>>>> 7491 Trondheim
>>>>> Norway
>>>>> Cell: +47 92 203 205
>>>>> 
>>>>> http://www.partikkelaudio.com/
>>>>> http://crossadaptive.hf.ntnu.no
>>>>> http://gdsp.hf.ntnu.no/
>>>>> http://soundcloud.com/brandtsegg
>>>>> http://flyndresang.no/
>>>>> http://soundcloud.com/t-emp
>>>>> 
>>>>> 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
>>> 
>>> 
>>> 
>>> --
>>> 
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>> 
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>> 
>>> 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
> 
> 
> 
> -- 
> 
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
> 
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
> 
> 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

Date2016-10-14 13:38
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
Yes, but how to I tell Csound (the py opcodes within Csound) to use ctcsound ?

2016-10-14 14:26 GMT+02:00 Victor Lazzarini :
> You can just install numpy.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg  wrote:
>>
>> Ah, now I remember, I tried this earlier and did not complete
>> installing Anaconda, as it seemed like it could interfere with other
>> system variables so I backed out.
>> Is there a way for me to configure the environment without installing
>> Anaconda? I'm in the middle of several productions, so I am hesitant
>> to let an installer make automatic changes to my system.
>>
>> 2016-10-14 8:54 GMT+02:00 Francois PINOT :
>>> Only numpy is mandatory.
>>>
>>> You can use ctcsound with Python 2.x and/or Python 3.x. You need an
>>> environment set properly for each version of Python you will use. Anaconda
>>> facilitates this, and it provides a lot of modules for scientific computing.
>>> Jupyter is a plus allowing you to use Csound within notebooks.
>>>
>>> François
>>>
>>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg :
>>>>
>>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed the
>>>> info on the list with interest, waiting to dive in.
>>>> Is there some instructions on how to migrate somewhere? Do I need to
>>>> install Anaconda and Jupyter, or can I just replace some modules ?
>>>>
>>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini :
>>>>> It is possible to read a Csound ftable via the API.
>>>>>
>>>>> I'd also suggest migrating to ctcsound if you
>>>>> are using csnd6. It's excellent.
>>>>>
>>>>> Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>> Maynooth University
>>>>> Ireland
>>>>>
>>>>> On 13 Oct 2016, at 22:18, Steven Yi  wrote:
>>>>>
>>>>> Yes I think that was what I was thinking of, but I'm unsure whether it
>>>>> is
>>>>> supported now or not.
>>>>>
>>>>>
>>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>>>>> 
>>>>> wrote:
>>>>>>
>>>>>> Hi all,
>>>>>> thanks for the suggestions.
>>>>>> If I can read from a csound table directly in python code, that would
>>>>>> be the best. Steven, do you mean this document
>>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>>>>>> There were several things in there that I did not know about, is the
>>>>>> csound module as described there currently supported?
>>>>>>
>>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi :
>>>>>>> Have you tried ftables? I.e. Filling the table in Csound, then
>>>>>>> reading
>>>>>>> from
>>>>>>> the table in the python code. I seem to remember the python opcodes
>>>>>>> having
>>>>>>> access to ftables and that there was example code for this.
>>>>>>>
>>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>>>>>>>  wrote:
>>>>>>>>
>>>>>>>> Not sure, but would --realtime switch on command line help? I don't
>>>>>>>> know
>>>>>>>> if that puts python to other thread from audio work...
>>>>>>>>
>>>>>>>>
>>>>>>>> Tarmo
>>>>>>>>
>>>>>>>>
>>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>>>>>>>> :
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>> I need to transfer the contents of an array from Csound to Python,
>>>>>>>>> as
>>>>>>>>> I want to do some peak picking and other analysis that is easier to
>>>>>>>>> get done in Python. The problem is that my (admittedly ad hoc)
>>>>>>>>> method
>>>>>>>>> of transferring the values from Csound to Python incurs significant
>>>>>>>>> performance degradation (more details on how I measure this later
>>>>>>>>> in
>>>>>>>>> this email).
>>>>>>>>>
>>>>>>>>> The basic premise is that I need Csound to be the main program (the
>>>>>>>>> host), and Python runs via the py opcodes.
>>>>>>>>>
>>>>>>>>> The array kAuto is of size 256, and transfer needs to be done once
>>>>>>>>> every 1 second, for 3 of these arrays. One should think the
>>>>>>>>> bandwidth
>>>>>>>>> requirement are not too taxing on any system, but since I only send
>>>>>>>>> single values, there are more than 700 pycalls happening in one
>>>>>>>>> k-rate
>>>>>>>>> pass.
>>>>>>>>> The python function "p.fill_array" does nothing but put the
>>>>>>>>> received
>>>>>>>>> values one by one into a numpy array.
>>>>>>>>>
>>>>>>>>>  kcnt_fill = 0
>>>>>>>>>  while kcnt_fill < ifftsize/2 do
>>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>>>>>>>>>    kcnt_fill += 1
>>>>>>>>>  od
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> By performance degradation I mean that the operation seems to let
>>>>>>>>> the
>>>>>>>>> different processes to wait for each other a lot, utlimately
>>>>>>>>> leading
>>>>>>>>> to dropouts in realtime audio. This does not show up as CPU spikes
>>>>>>>>> (running at around 50%), but shows in Reaper's performence meter as
>>>>>>>>> "RT longest-block". This meter shows the number of milliseconds
>>>>>>>>> used/available per audio processing block. The *used* must
>>>>>>>>> generally
>>>>>>>>> be less than the *available* time to avoid dropouts. Some spikes
>>>>>>>>> are
>>>>>>>>> not necessarily bad, but in my case the *used* is generally quite
>>>>>>>>> stable and higher than the *available*, unless I comment out the
>>>>>>>>> code
>>>>>>>>> excerpt given above.
>>>>>>>>>
>>>>>>>>> Is there any way I can send an array from Csound to Python in one
>>>>>>>>> go?
>>>>>>>>> I seem to remember some black magic about letting Python running
>>>>>>>>> under
>>>>>>>>> Csound get access to the (host) csound instance and thus accessing
>>>>>>>>> the
>>>>>>>>> Csound API. Would that be the best way to do it, and would it be
>>>>>>>>> considered a safe way of doing it?
>>>>>>>>>
>>>>>>>>> best
>>>>>>>>> Oeyvind
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>> Oeyvind Brandtsegg
>>>>>>>>> Professor of Music Technology
>>>>>>>>> NTNU
>>>>>>>>> 7491 Trondheim
>>>>>>>>> Norway
>>>>>>>>> Cell: +47 92 203 205
>>>>>>>>>
>>>>>>>>> http://www.partikkelaudio.com/
>>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>>>>> http://gdsp.hf.ntnu.no/
>>>>>>>>> http://soundcloud.com/brandtsegg
>>>>>>>>> http://flyndresang.no/
>>>>>>>>> http://soundcloud.com/t-emp
>>>>>>>>>
>>>>>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Oeyvind Brandtsegg
>>>>>> Professor of Music Technology
>>>>>> NTNU
>>>>>> 7491 Trondheim
>>>>>> Norway
>>>>>> Cell: +47 92 203 205
>>>>>>
>>>>>> http://www.partikkelaudio.com/
>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>> http://gdsp.hf.ntnu.no/
>>>>>> http://soundcloud.com/brandtsegg
>>>>>> http://flyndresang.no/
>>>>>> http://soundcloud.com/t-emp
>>>>>>
>>>>>> 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
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Oeyvind Brandtsegg
>>>> Professor of Music Technology
>>>> NTNU
>>>> 7491 Trondheim
>>>> Norway
>>>> Cell: +47 92 203 205
>>>>
>>>> http://www.partikkelaudio.com/
>>>> http://crossadaptive.hf.ntnu.no
>>>> http://gdsp.hf.ntnu.no/
>>>> http://soundcloud.com/brandtsegg
>>>> http://flyndresang.no/
>>>> http://soundcloud.com/t-emp
>>>>
>>>> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-10-14 13:56
FromFrancois PINOT
SubjectRe: Optimization tip wanted for Csound/Python
pyruni "import ctcsound" in global part?

François

2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
Yes, but how to I tell Csound (the py opcodes within Csound) to use ctcsound ?

2016-10-14 14:26 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> You can just install numpy.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg <oyvind.brandtsegg@NTNU.NO> wrote:
>>
>> Ah, now I remember, I tried this earlier and did not complete
>> installing Anaconda, as it seemed like it could interfere with other
>> system variables so I backed out.
>> Is there a way for me to configure the environment without installing
>> Anaconda? I'm in the middle of several productions, so I am hesitant
>> to let an installer make automatic changes to my system.
>>
>> 2016-10-14 8:54 GMT+02:00 Francois PINOT <fggpinot@gmail.com>:
>>> Only numpy is mandatory.
>>>
>>> You can use ctcsound with Python 2.x and/or Python 3.x. You need an
>>> environment set properly for each version of Python you will use. Anaconda
>>> facilitates this, and it provides a lot of modules for scientific computing.
>>> Jupyter is a plus allowing you to use Csound within notebooks.
>>>
>>> François
>>>
>>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
>>>>
>>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed the
>>>> info on the list with interest, waiting to dive in.
>>>> Is there some instructions on how to migrate somewhere? Do I need to
>>>> install Anaconda and Jupyter, or can I just replace some modules ?
>>>>
>>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>>>> It is possible to read a Csound ftable via the API.
>>>>>
>>>>> I'd also suggest migrating to ctcsound if you
>>>>> are using csnd6. It's excellent.
>>>>>
>>>>> Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>> Maynooth University
>>>>> Ireland
>>>>>
>>>>> On 13 Oct 2016, at 22:18, Steven Yi <stevenyi@GMAIL.COM> wrote:
>>>>>
>>>>> Yes I think that was what I was thinking of, but I'm unsure whether it
>>>>> is
>>>>> supported now or not.
>>>>>
>>>>>
>>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>>>>> <oyvind.brandtsegg@ntnu.no>
>>>>> wrote:
>>>>>>
>>>>>> Hi all,
>>>>>> thanks for the suggestions.
>>>>>> If I can read from a csound table directly in python code, that would
>>>>>> be the best. Steven, do you mean this document
>>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>>>>>> There were several things in there that I did not know about, is the
>>>>>> csound module as described there currently supported?
>>>>>>
>>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi <stevenyi@gmail.com>:
>>>>>>> Have you tried ftables? I.e. Filling the table in Csound, then
>>>>>>> reading
>>>>>>> from
>>>>>>> the table in the python code. I seem to remember the python opcodes
>>>>>>> having
>>>>>>> access to ftables and that there was example code for this.
>>>>>>>
>>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>>>>>>> <tarmo.johannes@otsakool.edu.ee> wrote:
>>>>>>>>
>>>>>>>> Not sure, but would --realtime switch on command line help? I don't
>>>>>>>> know
>>>>>>>> if that puts python to other thread from audio work...
>>>>>>>>
>>>>>>>>
>>>>>>>> Tarmo
>>>>>>>>
>>>>>>>>
>>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>>>>>>>> <oyvind.brandtsegg@ntnu.no>:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>> I need to transfer the contents of an array from Csound to Python,
>>>>>>>>> as
>>>>>>>>> I want to do some peak picking and other analysis that is easier to
>>>>>>>>> get done in Python. The problem is that my (admittedly ad hoc)
>>>>>>>>> method
>>>>>>>>> of transferring the values from Csound to Python incurs significant
>>>>>>>>> performance degradation (more details on how I measure this later
>>>>>>>>> in
>>>>>>>>> this email).
>>>>>>>>>
>>>>>>>>> The basic premise is that I need Csound to be the main program (the
>>>>>>>>> host), and Python runs via the py opcodes.
>>>>>>>>>
>>>>>>>>> The array kAuto is of size 256, and transfer needs to be done once
>>>>>>>>> every 1 second, for 3 of these arrays. One should think the
>>>>>>>>> bandwidth
>>>>>>>>> requirement are not too taxing on any system, but since I only send
>>>>>>>>> single values, there are more than 700 pycalls happening in one
>>>>>>>>> k-rate
>>>>>>>>> pass.
>>>>>>>>> The python function "p.fill_array" does nothing but put the
>>>>>>>>> received
>>>>>>>>> values one by one into a numpy array.
>>>>>>>>>
>>>>>>>>>  kcnt_fill = 0
>>>>>>>>>  while kcnt_fill < ifftsize/2 do
>>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
>>>>>>>>>    kcnt_fill += 1
>>>>>>>>>  od
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> By performance degradation I mean that the operation seems to let
>>>>>>>>> the
>>>>>>>>> different processes to wait for each other a lot, utlimately
>>>>>>>>> leading
>>>>>>>>> to dropouts in realtime audio. This does not show up as CPU spikes
>>>>>>>>> (running at around 50%), but shows in Reaper's performence meter as
>>>>>>>>> "RT longest-block". This meter shows the number of milliseconds
>>>>>>>>> used/available per audio processing block. The *used* must
>>>>>>>>> generally
>>>>>>>>> be less than the *available* time to avoid dropouts. Some spikes
>>>>>>>>> are
>>>>>>>>> not necessarily bad, but in my case the *used* is generally quite
>>>>>>>>> stable and higher than the *available*, unless I comment out the
>>>>>>>>> code
>>>>>>>>> excerpt given above.
>>>>>>>>>
>>>>>>>>> Is there any way I can send an array from Csound to Python in one
>>>>>>>>> go?
>>>>>>>>> I seem to remember some black magic about letting Python running
>>>>>>>>> under
>>>>>>>>> Csound get access to the (host) csound instance and thus accessing
>>>>>>>>> the
>>>>>>>>> Csound API. Would that be the best way to do it, and would it be
>>>>>>>>> considered a safe way of doing it?
>>>>>>>>>
>>>>>>>>> best
>>>>>>>>> Oeyvind
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>> Oeyvind Brandtsegg
>>>>>>>>> Professor of Music Technology
>>>>>>>>> NTNU
>>>>>>>>> 7491 Trondheim
>>>>>>>>> Norway
>>>>>>>>> Cell: +47 92 203 205
>>>>>>>>>
>>>>>>>>> http://www.partikkelaudio.com/
>>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>>>>> http://gdsp.hf.ntnu.no/
>>>>>>>>> http://soundcloud.com/brandtsegg
>>>>>>>>> http://flyndresang.no/
>>>>>>>>> http://soundcloud.com/t-emp
>>>>>>>>>
>>>>>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Oeyvind Brandtsegg
>>>>>> Professor of Music Technology
>>>>>> NTNU
>>>>>> 7491 Trondheim
>>>>>> Norway
>>>>>> Cell: +47 92 203 205
>>>>>>
>>>>>> http://www.partikkelaudio.com/
>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>> http://gdsp.hf.ntnu.no/
>>>>>> http://soundcloud.com/brandtsegg
>>>>>> http://flyndresang.no/
>>>>>> http://soundcloud.com/t-emp
>>>>>>
>>>>>> 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
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Oeyvind Brandtsegg
>>>> Professor of Music Technology
>>>> NTNU
>>>> 7491 Trondheim
>>>> Norway
>>>> Cell: +47 92 203 205
>>>>
>>>> http://www.partikkelaudio.com/
>>>> http://crossadaptive.hf.ntnu.no
>>>> http://gdsp.hf.ntnu.no/
>>>> http://soundcloud.com/brandtsegg
>>>> http://flyndresang.no/
>>>> http://soundcloud.com/t-emp
>>>>
>>>> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-10-14 14:23
FromVictor Lazzarini
SubjectRe: Optimization tip wanted for Csound/Python
We might need a csoundGetInstance() function or similar in ctcsound so that the
opcodes can communicate with the running Csound.

http://csound.github.io/docs/manual/pyinit.html

> On 14 Oct 2016, at 13:56, Francois PINOT  wrote:
> 
> pyruni "import ctcsound" in global part?
> 
> François
> 
> 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg :
> Yes, but how to I tell Csound (the py opcodes within Csound) to use ctcsound ?
> 
> 2016-10-14 14:26 GMT+02:00 Victor Lazzarini :
> > You can just install numpy.
> >
> > Victor Lazzarini
> > Dean of Arts, Celtic Studies, and Philosophy
> > Maynooth University
> > Ireland
> >
> >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg  wrote:
> >>
> >> Ah, now I remember, I tried this earlier and did not complete
> >> installing Anaconda, as it seemed like it could interfere with other
> >> system variables so I backed out.
> >> Is there a way for me to configure the environment without installing
> >> Anaconda? I'm in the middle of several productions, so I am hesitant
> >> to let an installer make automatic changes to my system.
> >>
> >> 2016-10-14 8:54 GMT+02:00 Francois PINOT :
> >>> Only numpy is mandatory.
> >>>
> >>> You can use ctcsound with Python 2.x and/or Python 3.x. You need an
> >>> environment set properly for each version of Python you will use. Anaconda
> >>> facilitates this, and it provides a lot of modules for scientific computing.
> >>> Jupyter is a plus allowing you to use Csound within notebooks.
> >>>
> >>> François
> >>>
> >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg :
> >>>>
> >>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed the
> >>>> info on the list with interest, waiting to dive in.
> >>>> Is there some instructions on how to migrate somewhere? Do I need to
> >>>> install Anaconda and Jupyter, or can I just replace some modules ?
> >>>>
> >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini :
> >>>>> It is possible to read a Csound ftable via the API.
> >>>>>
> >>>>> I'd also suggest migrating to ctcsound if you
> >>>>> are using csnd6. It's excellent.
> >>>>>
> >>>>> Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies, and Philosophy
> >>>>> Maynooth University
> >>>>> Ireland
> >>>>>
> >>>>> On 13 Oct 2016, at 22:18, Steven Yi  wrote:
> >>>>>
> >>>>> Yes I think that was what I was thinking of, but I'm unsure whether it
> >>>>> is
> >>>>> supported now or not.
> >>>>>
> >>>>>
> >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
> >>>>> 
> >>>>> wrote:
> >>>>>>
> >>>>>> Hi all,
> >>>>>> thanks for the suggestions.
> >>>>>> If I can read from a csound table directly in python code, that would
> >>>>>> be the best. Steven, do you mean this document
> >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
> >>>>>> There were several things in there that I did not know about, is the
> >>>>>> csound module as described there currently supported?
> >>>>>>
> >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi :
> >>>>>>> Have you tried ftables? I.e. Filling the table in Csound, then
> >>>>>>> reading
> >>>>>>> from
> >>>>>>> the table in the python code. I seem to remember the python opcodes
> >>>>>>> having
> >>>>>>> access to ftables and that there was example code for this.
> >>>>>>>
> >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
> >>>>>>>  wrote:
> >>>>>>>>
> >>>>>>>> Not sure, but would --realtime switch on command line help? I don't
> >>>>>>>> know
> >>>>>>>> if that puts python to other thread from audio work...
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Tarmo
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
> >>>>>>>> :
> >>>>>>>>>
> >>>>>>>>> Hi,
> >>>>>>>>> I need to transfer the contents of an array from Csound to Python,
> >>>>>>>>> as
> >>>>>>>>> I want to do some peak picking and other analysis that is easier to
> >>>>>>>>> get done in Python. The problem is that my (admittedly ad hoc)
> >>>>>>>>> method
> >>>>>>>>> of transferring the values from Csound to Python incurs significant
> >>>>>>>>> performance degradation (more details on how I measure this later
> >>>>>>>>> in
> >>>>>>>>> this email).
> >>>>>>>>>
> >>>>>>>>> The basic premise is that I need Csound to be the main program (the
> >>>>>>>>> host), and Python runs via the py opcodes.
> >>>>>>>>>
> >>>>>>>>> The array kAuto is of size 256, and transfer needs to be done once
> >>>>>>>>> every 1 second, for 3 of these arrays. One should think the
> >>>>>>>>> bandwidth
> >>>>>>>>> requirement are not too taxing on any system, but since I only send
> >>>>>>>>> single values, there are more than 700 pycalls happening in one
> >>>>>>>>> k-rate
> >>>>>>>>> pass.
> >>>>>>>>> The python function "p.fill_array" does nothing but put the
> >>>>>>>>> received
> >>>>>>>>> values one by one into a numpy array.
> >>>>>>>>>
> >>>>>>>>>  kcnt_fill = 0
> >>>>>>>>>  while kcnt_fill < ifftsize/2 do
> >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
> >>>>>>>>>    kcnt_fill += 1
> >>>>>>>>>  od
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> By performance degradation I mean that the operation seems to let
> >>>>>>>>> the
> >>>>>>>>> different processes to wait for each other a lot, utlimately
> >>>>>>>>> leading
> >>>>>>>>> to dropouts in realtime audio. This does not show up as CPU spikes
> >>>>>>>>> (running at around 50%), but shows in Reaper's performence meter as
> >>>>>>>>> "RT longest-block". This meter shows the number of milliseconds
> >>>>>>>>> used/available per audio processing block. The *used* must
> >>>>>>>>> generally
> >>>>>>>>> be less than the *available* time to avoid dropouts. Some spikes
> >>>>>>>>> are
> >>>>>>>>> not necessarily bad, but in my case the *used* is generally quite
> >>>>>>>>> stable and higher than the *available*, unless I comment out the
> >>>>>>>>> code
> >>>>>>>>> excerpt given above.
> >>>>>>>>>
> >>>>>>>>> Is there any way I can send an array from Csound to Python in one
> >>>>>>>>> go?
> >>>>>>>>> I seem to remember some black magic about letting Python running
> >>>>>>>>> under
> >>>>>>>>> Csound get access to the (host) csound instance and thus accessing
> >>>>>>>>> the
> >>>>>>>>> Csound API. Would that be the best way to do it, and would it be
> >>>>>>>>> considered a safe way of doing it?
> >>>>>>>>>
> >>>>>>>>> best
> >>>>>>>>> Oeyvind
> >>>>>>>>>
> >>>>>>>>> --
> >>>>>>>>>
> >>>>>>>>> Oeyvind Brandtsegg
> >>>>>>>>> Professor of Music Technology
> >>>>>>>>> NTNU
> >>>>>>>>> 7491 Trondheim
> >>>>>>>>> Norway
> >>>>>>>>> Cell: +47 92 203 205
> >>>>>>>>>
> >>>>>>>>> http://www.partikkelaudio.com/
> >>>>>>>>> http://crossadaptive.hf.ntnu.no
> >>>>>>>>> http://gdsp.hf.ntnu.no/
> >>>>>>>>> http://soundcloud.com/brandtsegg
> >>>>>>>>> http://flyndresang.no/
> >>>>>>>>> http://soundcloud.com/t-emp
> >>>>>>>>>
> >>>>>>>>> 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
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>>
> >>>>>> Oeyvind Brandtsegg
> >>>>>> Professor of Music Technology
> >>>>>> NTNU
> >>>>>> 7491 Trondheim
> >>>>>> Norway
> >>>>>> Cell: +47 92 203 205
> >>>>>>
> >>>>>> http://www.partikkelaudio.com/
> >>>>>> http://crossadaptive.hf.ntnu.no
> >>>>>> http://gdsp.hf.ntnu.no/
> >>>>>> http://soundcloud.com/brandtsegg
> >>>>>> http://flyndresang.no/
> >>>>>> http://soundcloud.com/t-emp
> >>>>>>
> >>>>>> 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
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>>
> >>>> Oeyvind Brandtsegg
> >>>> Professor of Music Technology
> >>>> NTNU
> >>>> 7491 Trondheim
> >>>> Norway
> >>>> Cell: +47 92 203 205
> >>>>
> >>>> http://www.partikkelaudio.com/
> >>>> http://crossadaptive.hf.ntnu.no
> >>>> http://gdsp.hf.ntnu.no/
> >>>> http://soundcloud.com/brandtsegg
> >>>> http://flyndresang.no/
> >>>> http://soundcloud.com/t-emp
> >>>>
> >>>> 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
> >>
> >>
> >>
> >> --
> >>
> >> Oeyvind Brandtsegg
> >> Professor of Music Technology
> >> NTNU
> >> 7491 Trondheim
> >> Norway
> >> Cell: +47 92 203 205
> >>
> >> http://www.partikkelaudio.com/
> >> http://crossadaptive.hf.ntnu.no
> >> http://gdsp.hf.ntnu.no/
> >> http://soundcloud.com/brandtsegg
> >> http://flyndresang.no/
> >> http://soundcloud.com/t-emp
> >>
> >> 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
> 
> 
> 
> --
> 
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
> 
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
> 
> 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

Date2016-10-15 11:04
FromFrancois PINOT
SubjectRe: Optimization tip wanted for Csound/Python
I just pushed to my github repo an example showing how to use ctcsound from the py- opcodes within a running instance of Csound:

    https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd

Notice that actually Python2 is used by default due the hardcoded choice of Python when building Csound.

François

2016-10-14 15:23 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
We might need a csoundGetInstance() function or similar in ctcsound so that the
opcodes can communicate with the running Csound.

http://csound.github.io/docs/manual/pyinit.html

> On 14 Oct 2016, at 13:56, Francois PINOT <fggpinot@gmail.com> wrote:
>
> pyruni "import ctcsound" in global part?
>
> François
>
> 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
> Yes, but how to I tell Csound (the py opcodes within Csound) to use ctcsound ?
>
> 2016-10-14 14:26 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> > You can just install numpy.
> >
> > Victor Lazzarini
> > Dean of Arts, Celtic Studies, and Philosophy
> > Maynooth University
> > Ireland
> >
> >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg <oyvind.brandtsegg@NTNU.NO> wrote:
> >>
> >> Ah, now I remember, I tried this earlier and did not complete
> >> installing Anaconda, as it seemed like it could interfere with other
> >> system variables so I backed out.
> >> Is there a way for me to configure the environment without installing
> >> Anaconda? I'm in the middle of several productions, so I am hesitant
> >> to let an installer make automatic changes to my system.
> >>
> >> 2016-10-14 8:54 GMT+02:00 Francois PINOT <fggpinot@gmail.com>:
> >>> Only numpy is mandatory.
> >>>
> >>> You can use ctcsound with Python 2.x and/or Python 3.x. You need an
> >>> environment set properly for each version of Python you will use. Anaconda
> >>> facilitates this, and it provides a lot of modules for scientific computing.
> >>> Jupyter is a plus allowing you to use Csound within notebooks.
> >>>
> >>> François
> >>>
> >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
> >>>>
> >>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed the
> >>>> info on the list with interest, waiting to dive in.
> >>>> Is there some instructions on how to migrate somewhere? Do I need to
> >>>> install Anaconda and Jupyter, or can I just replace some modules ?
> >>>>
> >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
> >>>>> It is possible to read a Csound ftable via the API.
> >>>>>
> >>>>> I'd also suggest migrating to ctcsound if you
> >>>>> are using csnd6. It's excellent.
> >>>>>
> >>>>> Victor Lazzarini
> >>>>> Dean of Arts, Celtic Studies, and Philosophy
> >>>>> Maynooth University
> >>>>> Ireland
> >>>>>
> >>>>> On 13 Oct 2016, at 22:18, Steven Yi <stevenyi@GMAIL.COM> wrote:
> >>>>>
> >>>>> Yes I think that was what I was thinking of, but I'm unsure whether it
> >>>>> is
> >>>>> supported now or not.
> >>>>>
> >>>>>
> >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
> >>>>> <oyvind.brandtsegg@ntnu.no>
> >>>>> wrote:
> >>>>>>
> >>>>>> Hi all,
> >>>>>> thanks for the suggestions.
> >>>>>> If I can read from a csound table directly in python code, that would
> >>>>>> be the best. Steven, do you mean this document
> >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
> >>>>>> There were several things in there that I did not know about, is the
> >>>>>> csound module as described there currently supported?
> >>>>>>
> >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi <stevenyi@gmail.com>:
> >>>>>>> Have you tried ftables? I.e. Filling the table in Csound, then
> >>>>>>> reading
> >>>>>>> from
> >>>>>>> the table in the python code. I seem to remember the python opcodes
> >>>>>>> having
> >>>>>>> access to ftables and that there was example code for this.
> >>>>>>>
> >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
> >>>>>>> <tarmo.johannes@otsakool.edu.ee> wrote:
> >>>>>>>>
> >>>>>>>> Not sure, but would --realtime switch on command line help? I don't
> >>>>>>>> know
> >>>>>>>> if that puts python to other thread from audio work...
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Tarmo
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
> >>>>>>>> <oyvind.brandtsegg@ntnu.no>:
> >>>>>>>>>
> >>>>>>>>> Hi,
> >>>>>>>>> I need to transfer the contents of an array from Csound to Python,
> >>>>>>>>> as
> >>>>>>>>> I want to do some peak picking and other analysis that is easier to
> >>>>>>>>> get done in Python. The problem is that my (admittedly ad hoc)
> >>>>>>>>> method
> >>>>>>>>> of transferring the values from Csound to Python incurs significant
> >>>>>>>>> performance degradation (more details on how I measure this later
> >>>>>>>>> in
> >>>>>>>>> this email).
> >>>>>>>>>
> >>>>>>>>> The basic premise is that I need Csound to be the main program (the
> >>>>>>>>> host), and Python runs via the py opcodes.
> >>>>>>>>>
> >>>>>>>>> The array kAuto is of size 256, and transfer needs to be done once
> >>>>>>>>> every 1 second, for 3 of these arrays. One should think the
> >>>>>>>>> bandwidth
> >>>>>>>>> requirement are not too taxing on any system, but since I only send
> >>>>>>>>> single values, there are more than 700 pycalls happening in one
> >>>>>>>>> k-rate
> >>>>>>>>> pass.
> >>>>>>>>> The python function "p.fill_array" does nothing but put the
> >>>>>>>>> received
> >>>>>>>>> values one by one into a numpy array.
> >>>>>>>>>
> >>>>>>>>>  kcnt_fill = 0
> >>>>>>>>>  while kcnt_fill < ifftsize/2 do
> >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill, ifftsize/2
> >>>>>>>>>    kcnt_fill += 1
> >>>>>>>>>  od
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> By performance degradation I mean that the operation seems to let
> >>>>>>>>> the
> >>>>>>>>> different processes to wait for each other a lot, utlimately
> >>>>>>>>> leading
> >>>>>>>>> to dropouts in realtime audio. This does not show up as CPU spikes
> >>>>>>>>> (running at around 50%), but shows in Reaper's performence meter as
> >>>>>>>>> "RT longest-block". This meter shows the number of milliseconds
> >>>>>>>>> used/available per audio processing block. The *used* must
> >>>>>>>>> generally
> >>>>>>>>> be less than the *available* time to avoid dropouts. Some spikes
> >>>>>>>>> are
> >>>>>>>>> not necessarily bad, but in my case the *used* is generally quite
> >>>>>>>>> stable and higher than the *available*, unless I comment out the
> >>>>>>>>> code
> >>>>>>>>> excerpt given above.
> >>>>>>>>>
> >>>>>>>>> Is there any way I can send an array from Csound to Python in one
> >>>>>>>>> go?
> >>>>>>>>> I seem to remember some black magic about letting Python running
> >>>>>>>>> under
> >>>>>>>>> Csound get access to the (host) csound instance and thus accessing
> >>>>>>>>> the
> >>>>>>>>> Csound API. Would that be the best way to do it, and would it be
> >>>>>>>>> considered a safe way of doing it?
> >>>>>>>>>
> >>>>>>>>> best
> >>>>>>>>> Oeyvind
> >>>>>>>>>
> >>>>>>>>> --
> >>>>>>>>>
> >>>>>>>>> Oeyvind Brandtsegg
> >>>>>>>>> Professor of Music Technology
> >>>>>>>>> NTNU
> >>>>>>>>> 7491 Trondheim
> >>>>>>>>> Norway
> >>>>>>>>> Cell: +47 92 203 205
> >>>>>>>>>
> >>>>>>>>> http://www.partikkelaudio.com/
> >>>>>>>>> http://crossadaptive.hf.ntnu.no
> >>>>>>>>> http://gdsp.hf.ntnu.no/
> >>>>>>>>> http://soundcloud.com/brandtsegg
> >>>>>>>>> http://flyndresang.no/
> >>>>>>>>> http://soundcloud.com/t-emp
> >>>>>>>>>
> >>>>>>>>> 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
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>>
> >>>>>> Oeyvind Brandtsegg
> >>>>>> Professor of Music Technology
> >>>>>> NTNU
> >>>>>> 7491 Trondheim
> >>>>>> Norway
> >>>>>> Cell: +47 92 203 205
> >>>>>>
> >>>>>> http://www.partikkelaudio.com/
> >>>>>> http://crossadaptive.hf.ntnu.no
> >>>>>> http://gdsp.hf.ntnu.no/
> >>>>>> http://soundcloud.com/brandtsegg
> >>>>>> http://flyndresang.no/
> >>>>>> http://soundcloud.com/t-emp
> >>>>>>
> >>>>>> 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
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>>
> >>>> Oeyvind Brandtsegg
> >>>> Professor of Music Technology
> >>>> NTNU
> >>>> 7491 Trondheim
> >>>> Norway
> >>>> Cell: +47 92 203 205
> >>>>
> >>>> http://www.partikkelaudio.com/
> >>>> http://crossadaptive.hf.ntnu.no
> >>>> http://gdsp.hf.ntnu.no/
> >>>> http://soundcloud.com/brandtsegg
> >>>> http://flyndresang.no/
> >>>> http://soundcloud.com/t-emp
> >>>>
> >>>> 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
> >>
> >>
> >>
> >> --
> >>
> >> Oeyvind Brandtsegg
> >> Professor of Music Technology
> >> NTNU
> >> 7491 Trondheim
> >> Norway
> >> Cell: +47 92 203 205
> >>
> >> http://www.partikkelaudio.com/
> >> http://crossadaptive.hf.ntnu.no
> >> http://gdsp.hf.ntnu.no/
> >> http://soundcloud.com/brandtsegg
> >> http://flyndresang.no/
> >> http://soundcloud.com/t-emp
> >>
> >> 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
>
>
>
> --
>
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
>
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
>
> 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

Date2016-11-05 21:01
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
Thanks,
this was left cold for a while, but now I'm back on track.

I get

>>> import ctcsound
Traceback (most recent call last):
  File "", line 1, in 
  File "ctcsound.py", line 2411, in 
    libcspt = cdll.csnd6
  File "C:\Python27\Lib\ctypes\__init__.py", line 435, in __getattr__
    dll = self._dlltype(name)
  File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] Den angitte modulen ble ikke funnet

... which I assume also relates to line 30 of ctcsound.py
elif sys.platform.startswith('win'):
    libcsound = cdll.csound64

I understand (guess) that cdll is probably the ctypes dll, but where
can I set it up so that it finds csound64?

best
Oeyvind

2016-10-15 3:04 GMT-07:00 Francois PINOT :
> I just pushed to my github repo an example showing how to use ctcsound from
> the py- opcodes within a running instance of Csound:
>
>
> https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>
> Notice that actually Python2 is used by default due the hardcoded choice of
> Python when building Csound.
>
> François
>
> 2016-10-14 15:23 GMT+02:00 Victor Lazzarini :
>>
>> We might need a csoundGetInstance() function or similar in ctcsound so
>> that the
>> opcodes can communicate with the running Csound.
>>
>> http://csound.github.io/docs/manual/pyinit.html
>>
>> > On 14 Oct 2016, at 13:56, Francois PINOT  wrote:
>> >
>> > pyruni "import ctcsound" in global part?
>> >
>> > François
>> >
>> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>> > :
>> > Yes, but how to I tell Csound (the py opcodes within Csound) to use
>> > ctcsound ?
>> >
>> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini :
>> > > You can just install numpy.
>> > >
>> > > Victor Lazzarini
>> > > Dean of Arts, Celtic Studies, and Philosophy
>> > > Maynooth University
>> > > Ireland
>> > >
>> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>> > >>  wrote:
>> > >>
>> > >> Ah, now I remember, I tried this earlier and did not complete
>> > >> installing Anaconda, as it seemed like it could interfere with other
>> > >> system variables so I backed out.
>> > >> Is there a way for me to configure the environment without installing
>> > >> Anaconda? I'm in the middle of several productions, so I am hesitant
>> > >> to let an installer make automatic changes to my system.
>> > >>
>> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT :
>> > >>> Only numpy is mandatory.
>> > >>>
>> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You need an
>> > >>> environment set properly for each version of Python you will use.
>> > >>> Anaconda
>> > >>> facilitates this, and it provides a lot of modules for scientific
>> > >>> computing.
>> > >>> Jupyter is a plus allowing you to use Csound within notebooks.
>> > >>>
>> > >>> François
>> > >>>
>> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>> > >>> :
>> > >>>>
>> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed
>> > >>>> the
>> > >>>> info on the list with interest, waiting to dive in.
>> > >>>> Is there some instructions on how to migrate somewhere? Do I need
>> > >>>> to
>> > >>>> install Anaconda and Jupyter, or can I just replace some modules ?
>> > >>>>
>> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>> > >>>> :
>> > >>>>> It is possible to read a Csound ftable via the API.
>> > >>>>>
>> > >>>>> I'd also suggest migrating to ctcsound if you
>> > >>>>> are using csnd6. It's excellent.
>> > >>>>>
>> > >>>>> Victor Lazzarini
>> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>> > >>>>> Maynooth University
>> > >>>>> Ireland
>> > >>>>>
>> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi  wrote:
>> > >>>>>
>> > >>>>> Yes I think that was what I was thinking of, but I'm unsure
>> > >>>>> whether it
>> > >>>>> is
>> > >>>>> supported now or not.
>> > >>>>>
>> > >>>>>
>> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>> > >>>>> 
>> > >>>>> wrote:
>> > >>>>>>
>> > >>>>>> Hi all,
>> > >>>>>> thanks for the suggestions.
>> > >>>>>> If I can read from a csound table directly in python code, that
>> > >>>>>> would
>> > >>>>>> be the best. Steven, do you mean this document
>> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> > >>>>>> There were several things in there that I did not know about, is
>> > >>>>>> the
>> > >>>>>> csound module as described there currently supported?
>> > >>>>>>
>> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi :
>> > >>>>>>> Have you tried ftables? I.e. Filling the table in Csound, then
>> > >>>>>>> reading
>> > >>>>>>> from
>> > >>>>>>> the table in the python code. I seem to remember the python
>> > >>>>>>> opcodes
>> > >>>>>>> having
>> > >>>>>>> access to ftables and that there was example code for this.
>> > >>>>>>>
>> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> > >>>>>>>  wrote:
>> > >>>>>>>>
>> > >>>>>>>> Not sure, but would --realtime switch on command line help? I
>> > >>>>>>>> don't
>> > >>>>>>>> know
>> > >>>>>>>> if that puts python to other thread from audio work...
>> > >>>>>>>>
>> > >>>>>>>>
>> > >>>>>>>> Tarmo
>> > >>>>>>>>
>> > >>>>>>>>
>> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> > >>>>>>>> :
>> > >>>>>>>>>
>> > >>>>>>>>> Hi,
>> > >>>>>>>>> I need to transfer the contents of an array from Csound to
>> > >>>>>>>>> Python,
>> > >>>>>>>>> as
>> > >>>>>>>>> I want to do some peak picking and other analysis that is
>> > >>>>>>>>> easier to
>> > >>>>>>>>> get done in Python. The problem is that my (admittedly ad hoc)
>> > >>>>>>>>> method
>> > >>>>>>>>> of transferring the values from Csound to Python incurs
>> > >>>>>>>>> significant
>> > >>>>>>>>> performance degradation (more details on how I measure this
>> > >>>>>>>>> later
>> > >>>>>>>>> in
>> > >>>>>>>>> this email).
>> > >>>>>>>>>
>> > >>>>>>>>> The basic premise is that I need Csound to be the main program
>> > >>>>>>>>> (the
>> > >>>>>>>>> host), and Python runs via the py opcodes.
>> > >>>>>>>>>
>> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to be done
>> > >>>>>>>>> once
>> > >>>>>>>>> every 1 second, for 3 of these arrays. One should think the
>> > >>>>>>>>> bandwidth
>> > >>>>>>>>> requirement are not too taxing on any system, but since I only
>> > >>>>>>>>> send
>> > >>>>>>>>> single values, there are more than 700 pycalls happening in
>> > >>>>>>>>> one
>> > >>>>>>>>> k-rate
>> > >>>>>>>>> pass.
>> > >>>>>>>>> The python function "p.fill_array" does nothing but put the
>> > >>>>>>>>> received
>> > >>>>>>>>> values one by one into a numpy array.
>> > >>>>>>>>>
>> > >>>>>>>>>  kcnt_fill = 0
>> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill,
>> > >>>>>>>>> ifftsize/2
>> > >>>>>>>>>    kcnt_fill += 1
>> > >>>>>>>>>  od
>> > >>>>>>>>>
>> > >>>>>>>>>
>> > >>>>>>>>> By performance degradation I mean that the operation seems to
>> > >>>>>>>>> let
>> > >>>>>>>>> the
>> > >>>>>>>>> different processes to wait for each other a lot, utlimately
>> > >>>>>>>>> leading
>> > >>>>>>>>> to dropouts in realtime audio. This does not show up as CPU
>> > >>>>>>>>> spikes
>> > >>>>>>>>> (running at around 50%), but shows in Reaper's performence
>> > >>>>>>>>> meter as
>> > >>>>>>>>> "RT longest-block". This meter shows the number of
>> > >>>>>>>>> milliseconds
>> > >>>>>>>>> used/available per audio processing block. The *used* must
>> > >>>>>>>>> generally
>> > >>>>>>>>> be less than the *available* time to avoid dropouts. Some
>> > >>>>>>>>> spikes
>> > >>>>>>>>> are
>> > >>>>>>>>> not necessarily bad, but in my case the *used* is generally
>> > >>>>>>>>> quite
>> > >>>>>>>>> stable and higher than the *available*, unless I comment out
>> > >>>>>>>>> the
>> > >>>>>>>>> code
>> > >>>>>>>>> excerpt given above.
>> > >>>>>>>>>
>> > >>>>>>>>> Is there any way I can send an array from Csound to Python in
>> > >>>>>>>>> one
>> > >>>>>>>>> go?
>> > >>>>>>>>> I seem to remember some black magic about letting Python
>> > >>>>>>>>> running
>> > >>>>>>>>> under
>> > >>>>>>>>> Csound get access to the (host) csound instance and thus
>> > >>>>>>>>> accessing
>> > >>>>>>>>> the
>> > >>>>>>>>> Csound API. Would that be the best way to do it, and would it
>> > >>>>>>>>> be
>> > >>>>>>>>> considered a safe way of doing it?
>> > >>>>>>>>>
>> > >>>>>>>>> best
>> > >>>>>>>>> Oeyvind
>> > >>>>>>>>>
>> > >>>>>>>>> --
>> > >>>>>>>>>
>> > >>>>>>>>> Oeyvind Brandtsegg
>> > >>>>>>>>> Professor of Music Technology
>> > >>>>>>>>> NTNU
>> > >>>>>>>>> 7491 Trondheim
>> > >>>>>>>>> Norway
>> > >>>>>>>>> Cell: +47 92 203 205
>> > >>>>>>>>>
>> > >>>>>>>>> http://www.partikkelaudio.com/
>> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>> > >>>>>>>>> http://soundcloud.com/brandtsegg
>> > >>>>>>>>> http://flyndresang.no/
>> > >>>>>>>>> http://soundcloud.com/t-emp
>> > >>>>>>>>>
>> > >>>>>>>>> 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
>> > >>>>>>
>> > >>>>>>
>> > >>>>>>
>> > >>>>>> --
>> > >>>>>>
>> > >>>>>> Oeyvind Brandtsegg
>> > >>>>>> Professor of Music Technology
>> > >>>>>> NTNU
>> > >>>>>> 7491 Trondheim
>> > >>>>>> Norway
>> > >>>>>> Cell: +47 92 203 205
>> > >>>>>>
>> > >>>>>> http://www.partikkelaudio.com/
>> > >>>>>> http://crossadaptive.hf.ntnu.no
>> > >>>>>> http://gdsp.hf.ntnu.no/
>> > >>>>>> http://soundcloud.com/brandtsegg
>> > >>>>>> http://flyndresang.no/
>> > >>>>>> http://soundcloud.com/t-emp
>> > >>>>>>
>> > >>>>>> 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
>> > >>>>
>> > >>>>
>> > >>>>
>> > >>>> --
>> > >>>>
>> > >>>> Oeyvind Brandtsegg
>> > >>>> Professor of Music Technology
>> > >>>> NTNU
>> > >>>> 7491 Trondheim
>> > >>>> Norway
>> > >>>> Cell: +47 92 203 205
>> > >>>>
>> > >>>> http://www.partikkelaudio.com/
>> > >>>> http://crossadaptive.hf.ntnu.no
>> > >>>> http://gdsp.hf.ntnu.no/
>> > >>>> http://soundcloud.com/brandtsegg
>> > >>>> http://flyndresang.no/
>> > >>>> http://soundcloud.com/t-emp
>> > >>>>
>> > >>>> 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
>> > >>
>> > >>
>> > >>
>> > >> --
>> > >>
>> > >> Oeyvind Brandtsegg
>> > >> Professor of Music Technology
>> > >> NTNU
>> > >> 7491 Trondheim
>> > >> Norway
>> > >> Cell: +47 92 203 205
>> > >>
>> > >> http://www.partikkelaudio.com/
>> > >> http://crossadaptive.hf.ntnu.no
>> > >> http://gdsp.hf.ntnu.no/
>> > >> http://soundcloud.com/brandtsegg
>> > >> http://flyndresang.no/
>> > >> http://soundcloud.com/t-emp
>> > >>
>> > >> 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
>> >
>> >
>> >
>> > --
>> >
>> > Oeyvind Brandtsegg
>> > Professor of Music Technology
>> > NTNU
>> > 7491 Trondheim
>> > Norway
>> > Cell: +47 92 203 205
>> >
>> > http://www.partikkelaudio.com/
>> > http://crossadaptive.hf.ntnu.no
>> > http://gdsp.hf.ntnu.no/
>> > http://soundcloud.com/brandtsegg
>> > http://flyndresang.no/
>> > http://soundcloud.com/t-emp
>> >
>> > 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



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-11-05 21:31
FromVictor Lazzarini
SubjectRe: Optimization tip wanted for Csound/Python
It's csound64.dll, which should be in the DLL path.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 5 Nov 2016, at 21:02, Oeyvind Brandtsegg  wrote:
> 
> Thanks,
> this was left cold for a while, but now I'm back on track.
> 
> I get
> 
>>>> import ctcsound
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "ctcsound.py", line 2411, in 
>    libcspt = cdll.csnd6
>  File "C:\Python27\Lib\ctypes\__init__.py", line 435, in __getattr__
>    dll = self._dlltype(name)
>  File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>    self._handle = _dlopen(self._name, mode)
> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
> 
> ... which I assume also relates to line 30 of ctcsound.py
> elif sys.platform.startswith('win'):
>    libcsound = cdll.csound64
> 
> I understand (guess) that cdll is probably the ctypes dll, but where
> can I set it up so that it finds csound64?
> 
> best
> Oeyvind
> 
> 2016-10-15 3:04 GMT-07:00 Francois PINOT :
>> I just pushed to my github repo an example showing how to use ctcsound from
>> the py- opcodes within a running instance of Csound:
>> 
>> 
>> https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>> 
>> Notice that actually Python2 is used by default due the hardcoded choice of
>> Python when building Csound.
>> 
>> François
>> 
>> 2016-10-14 15:23 GMT+02:00 Victor Lazzarini :
>>> 
>>> We might need a csoundGetInstance() function or similar in ctcsound so
>>> that the
>>> opcodes can communicate with the running Csound.
>>> 
>>> http://csound.github.io/docs/manual/pyinit.html
>>> 
>>>> On 14 Oct 2016, at 13:56, Francois PINOT  wrote:
>>>> 
>>>> pyruni "import ctcsound" in global part?
>>>> 
>>>> François
>>>> 
>>>> 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>>>> :
>>>> Yes, but how to I tell Csound (the py opcodes within Csound) to use
>>>> ctcsound ?
>>>> 
>>>> 2016-10-14 14:26 GMT+02:00 Victor Lazzarini :
>>>>> You can just install numpy.
>>>>> 
>>>>> Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>> Maynooth University
>>>>> Ireland
>>>>> 
>>>>>> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>>>>>>  wrote:
>>>>>> 
>>>>>> Ah, now I remember, I tried this earlier and did not complete
>>>>>> installing Anaconda, as it seemed like it could interfere with other
>>>>>> system variables so I backed out.
>>>>>> Is there a way for me to configure the environment without installing
>>>>>> Anaconda? I'm in the middle of several productions, so I am hesitant
>>>>>> to let an installer make automatic changes to my system.
>>>>>> 
>>>>>> 2016-10-14 8:54 GMT+02:00 Francois PINOT :
>>>>>>> Only numpy is mandatory.
>>>>>>> 
>>>>>>> You can use ctcsound with Python 2.x and/or Python 3.x. You need an
>>>>>>> environment set properly for each version of Python you will use.
>>>>>>> Anaconda
>>>>>>> facilitates this, and it provides a lot of modules for scientific
>>>>>>> computing.
>>>>>>> Jupyter is a plus allowing you to use Csound within notebooks.
>>>>>>> 
>>>>>>> François
>>>>>>> 
>>>>>>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>>>>>>> :
>>>>>>>> 
>>>>>>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed
>>>>>>>> the
>>>>>>>> info on the list with interest, waiting to dive in.
>>>>>>>> Is there some instructions on how to migrate somewhere? Do I need
>>>>>>>> to
>>>>>>>> install Anaconda and Jupyter, or can I just replace some modules ?
>>>>>>>> 
>>>>>>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>>>>>>>> :
>>>>>>>>> It is possible to read a Csound ftable via the API.
>>>>>>>>> 
>>>>>>>>> I'd also suggest migrating to ctcsound if you
>>>>>>>>> are using csnd6. It's excellent.
>>>>>>>>> 
>>>>>>>>> Victor Lazzarini
>>>>>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>>>>>> Maynooth University
>>>>>>>>> Ireland
>>>>>>>>> 
>>>>>>>>> On 13 Oct 2016, at 22:18, Steven Yi  wrote:
>>>>>>>>> 
>>>>>>>>> Yes I think that was what I was thinking of, but I'm unsure
>>>>>>>>> whether it
>>>>>>>>> is
>>>>>>>>> supported now or not.
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>>>>>>>>> 
>>>>>>>>> wrote:
>>>>>>>>>> 
>>>>>>>>>> Hi all,
>>>>>>>>>> thanks for the suggestions.
>>>>>>>>>> If I can read from a csound table directly in python code, that
>>>>>>>>>> would
>>>>>>>>>> be the best. Steven, do you mean this document
>>>>>>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>>>>>>>>>> There were several things in there that I did not know about, is
>>>>>>>>>> the
>>>>>>>>>> csound module as described there currently supported?
>>>>>>>>>> 
>>>>>>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi :
>>>>>>>>>>> Have you tried ftables? I.e. Filling the table in Csound, then
>>>>>>>>>>> reading
>>>>>>>>>>> from
>>>>>>>>>>> the table in the python code. I seem to remember the python
>>>>>>>>>>> opcodes
>>>>>>>>>>> having
>>>>>>>>>>> access to ftables and that there was example code for this.
>>>>>>>>>>> 
>>>>>>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>>>>>>>>>>>  wrote:
>>>>>>>>>>>> 
>>>>>>>>>>>> Not sure, but would --realtime switch on command line help? I
>>>>>>>>>>>> don't
>>>>>>>>>>>> know
>>>>>>>>>>>> if that puts python to other thread from audio work...
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Tarmo
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>>>>>>>>>>>> :
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>> I need to transfer the contents of an array from Csound to
>>>>>>>>>>>>> Python,
>>>>>>>>>>>>> as
>>>>>>>>>>>>> I want to do some peak picking and other analysis that is
>>>>>>>>>>>>> easier to
>>>>>>>>>>>>> get done in Python. The problem is that my (admittedly ad hoc)
>>>>>>>>>>>>> method
>>>>>>>>>>>>> of transferring the values from Csound to Python incurs
>>>>>>>>>>>>> significant
>>>>>>>>>>>>> performance degradation (more details on how I measure this
>>>>>>>>>>>>> later
>>>>>>>>>>>>> in
>>>>>>>>>>>>> this email).
>>>>>>>>>>>>> 
>>>>>>>>>>>>> The basic premise is that I need Csound to be the main program
>>>>>>>>>>>>> (the
>>>>>>>>>>>>> host), and Python runs via the py opcodes.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> The array kAuto is of size 256, and transfer needs to be done
>>>>>>>>>>>>> once
>>>>>>>>>>>>> every 1 second, for 3 of these arrays. One should think the
>>>>>>>>>>>>> bandwidth
>>>>>>>>>>>>> requirement are not too taxing on any system, but since I only
>>>>>>>>>>>>> send
>>>>>>>>>>>>> single values, there are more than 700 pycalls happening in
>>>>>>>>>>>>> one
>>>>>>>>>>>>> k-rate
>>>>>>>>>>>>> pass.
>>>>>>>>>>>>> The python function "p.fill_array" does nothing but put the
>>>>>>>>>>>>> received
>>>>>>>>>>>>> values one by one into a numpy array.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> kcnt_fill = 0
>>>>>>>>>>>>> while kcnt_fill < ifftsize/2 do
>>>>>>>>>>>>>   pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill,
>>>>>>>>>>>>> ifftsize/2
>>>>>>>>>>>>>   kcnt_fill += 1
>>>>>>>>>>>>> od
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> By performance degradation I mean that the operation seems to
>>>>>>>>>>>>> let
>>>>>>>>>>>>> the
>>>>>>>>>>>>> different processes to wait for each other a lot, utlimately
>>>>>>>>>>>>> leading
>>>>>>>>>>>>> to dropouts in realtime audio. This does not show up as CPU
>>>>>>>>>>>>> spikes
>>>>>>>>>>>>> (running at around 50%), but shows in Reaper's performence
>>>>>>>>>>>>> meter as
>>>>>>>>>>>>> "RT longest-block". This meter shows the number of
>>>>>>>>>>>>> milliseconds
>>>>>>>>>>>>> used/available per audio processing block. The *used* must
>>>>>>>>>>>>> generally
>>>>>>>>>>>>> be less than the *available* time to avoid dropouts. Some
>>>>>>>>>>>>> spikes
>>>>>>>>>>>>> are
>>>>>>>>>>>>> not necessarily bad, but in my case the *used* is generally
>>>>>>>>>>>>> quite
>>>>>>>>>>>>> stable and higher than the *available*, unless I comment out
>>>>>>>>>>>>> the
>>>>>>>>>>>>> code
>>>>>>>>>>>>> excerpt given above.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Is there any way I can send an array from Csound to Python in
>>>>>>>>>>>>> one
>>>>>>>>>>>>> go?
>>>>>>>>>>>>> I seem to remember some black magic about letting Python
>>>>>>>>>>>>> running
>>>>>>>>>>>>> under
>>>>>>>>>>>>> Csound get access to the (host) csound instance and thus
>>>>>>>>>>>>> accessing
>>>>>>>>>>>>> the
>>>>>>>>>>>>> Csound API. Would that be the best way to do it, and would it
>>>>>>>>>>>>> be
>>>>>>>>>>>>> considered a safe way of doing it?
>>>>>>>>>>>>> 
>>>>>>>>>>>>> best
>>>>>>>>>>>>> Oeyvind
>>>>>>>>>>>>> 
>>>>>>>>>>>>> --
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Oeyvind Brandtsegg
>>>>>>>>>>>>> Professor of Music Technology
>>>>>>>>>>>>> NTNU
>>>>>>>>>>>>> 7491 Trondheim
>>>>>>>>>>>>> Norway
>>>>>>>>>>>>> Cell: +47 92 203 205
>>>>>>>>>>>>> 
>>>>>>>>>>>>> http://www.partikkelaudio.com/
>>>>>>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>>>>>>>>> http://gdsp.hf.ntnu.no/
>>>>>>>>>>>>> http://soundcloud.com/brandtsegg
>>>>>>>>>>>>> http://flyndresang.no/
>>>>>>>>>>>>> http://soundcloud.com/t-emp
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 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
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> --
>>>>>>>>>> 
>>>>>>>>>> Oeyvind Brandtsegg
>>>>>>>>>> Professor of Music Technology
>>>>>>>>>> NTNU
>>>>>>>>>> 7491 Trondheim
>>>>>>>>>> Norway
>>>>>>>>>> Cell: +47 92 203 205
>>>>>>>>>> 
>>>>>>>>>> http://www.partikkelaudio.com/
>>>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>>>>>> http://gdsp.hf.ntnu.no/
>>>>>>>>>> http://soundcloud.com/brandtsegg
>>>>>>>>>> http://flyndresang.no/
>>>>>>>>>> http://soundcloud.com/t-emp
>>>>>>>>>> 
>>>>>>>>>> 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
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> --
>>>>>>>> 
>>>>>>>> Oeyvind Brandtsegg
>>>>>>>> Professor of Music Technology
>>>>>>>> NTNU
>>>>>>>> 7491 Trondheim
>>>>>>>> Norway
>>>>>>>> Cell: +47 92 203 205
>>>>>>>> 
>>>>>>>> http://www.partikkelaudio.com/
>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>>>> http://gdsp.hf.ntnu.no/
>>>>>>>> http://soundcloud.com/brandtsegg
>>>>>>>> http://flyndresang.no/
>>>>>>>> http://soundcloud.com/t-emp
>>>>>>>> 
>>>>>>>> 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
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> 
>>>>>> Oeyvind Brandtsegg
>>>>>> Professor of Music Technology
>>>>>> NTNU
>>>>>> 7491 Trondheim
>>>>>> Norway
>>>>>> Cell: +47 92 203 205
>>>>>> 
>>>>>> http://www.partikkelaudio.com/
>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>> http://gdsp.hf.ntnu.no/
>>>>>> http://soundcloud.com/brandtsegg
>>>>>> http://flyndresang.no/
>>>>>> http://soundcloud.com/t-emp
>>>>>> 
>>>>>> 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
>>>> 
>>>> 
>>>> 
>>>> --
>>>> 
>>>> Oeyvind Brandtsegg
>>>> Professor of Music Technology
>>>> NTNU
>>>> 7491 Trondheim
>>>> Norway
>>>> Cell: +47 92 203 205
>>>> 
>>>> http://www.partikkelaudio.com/
>>>> http://crossadaptive.hf.ntnu.no
>>>> http://gdsp.hf.ntnu.no/
>>>> http://soundcloud.com/brandtsegg
>>>> http://flyndresang.no/
>>>> http://soundcloud.com/t-emp
>>>> 
>>>> 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
> 
> 
> 
> -- 
> 
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
> 
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
> 
> 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

Date2016-11-05 21:45
FromMichael Gogins
SubjectRe: Optimization tip wanted for Csound/Python

Try passing the complete pathname.

Regards,
Mike


On Nov 5, 2016 5:31 PM, "Victor Lazzarini" <Victor.Lazzarini@nuim.ie> wrote:
It's csound64.dll, which should be in the DLL path.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 5 Nov 2016, at 21:02, Oeyvind Brandtsegg <oyvind.brandtsegg@NTNU.NO> wrote:
>
> Thanks,
> this was left cold for a while, but now I'm back on track.
>
> I get
>
>>>> import ctcsound
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "ctcsound.py", line 2411, in <module>
>    libcspt = cdll.csnd6
>  File "C:\Python27\Lib\ctypes\__init__.py", line 435, in __getattr__
>    dll = self._dlltype(name)
>  File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>    self._handle = _dlopen(self._name, mode)
> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>
> ... which I assume also relates to line 30 of ctcsound.py
> elif sys.platform.startswith('win'):
>    libcsound = cdll.csound64
>
> I understand (guess) that cdll is probably the ctypes dll, but where
> can I set it up so that it finds csound64?
>
> best
> Oeyvind
>
> 2016-10-15 3:04 GMT-07:00 Francois PINOT <fggpinot@gmail.com>:
>> I just pushed to my github repo an example showing how to use ctcsound from
>> the py- opcodes within a running instance of Csound:
>>
>>
>> https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>>
>> Notice that actually Python2 is used by default due the hardcoded choice of
>> Python when building Csound.
>>
>> François
>>
>> 2016-10-14 15:23 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>>
>>> We might need a csoundGetInstance() function or similar in ctcsound so
>>> that the
>>> opcodes can communicate with the running Csound.
>>>
>>> http://csound.github.io/docs/manual/pyinit.html
>>>
>>>> On 14 Oct 2016, at 13:56, Francois PINOT <fggpinot@gmail.com> wrote:
>>>>
>>>> pyruni "import ctcsound" in global part?
>>>>
>>>> François
>>>>
>>>> 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>>>> <oyvind.brandtsegg@ntnu.no>:
>>>> Yes, but how to I tell Csound (the py opcodes within Csound) to use
>>>> ctcsound ?
>>>>
>>>> 2016-10-14 14:26 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>>>> You can just install numpy.
>>>>>
>>>>> Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>> Maynooth University
>>>>> Ireland
>>>>>
>>>>>> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>>>>>> <oyvind.brandtsegg@NTNU.NO> wrote:
>>>>>>
>>>>>> Ah, now I remember, I tried this earlier and did not complete
>>>>>> installing Anaconda, as it seemed like it could interfere with other
>>>>>> system variables so I backed out.
>>>>>> Is there a way for me to configure the environment without installing
>>>>>> Anaconda? I'm in the middle of several productions, so I am hesitant
>>>>>> to let an installer make automatic changes to my system.
>>>>>>
>>>>>> 2016-10-14 8:54 GMT+02:00 Francois PINOT <fggpinot@gmail.com>:
>>>>>>> Only numpy is mandatory.
>>>>>>>
>>>>>>> You can use ctcsound with Python 2.x and/or Python 3.x. You need an
>>>>>>> environment set properly for each version of Python you will use.
>>>>>>> Anaconda
>>>>>>> facilitates this, and it provides a lot of modules for scientific
>>>>>>> computing.
>>>>>>> Jupyter is a plus allowing you to use Csound within notebooks.
>>>>>>>
>>>>>>> François
>>>>>>>
>>>>>>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>>>>>>> <oyvind.brandtsegg@ntnu.no>:
>>>>>>>>
>>>>>>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed
>>>>>>>> the
>>>>>>>> info on the list with interest, waiting to dive in.
>>>>>>>> Is there some instructions on how to migrate somewhere? Do I need
>>>>>>>> to
>>>>>>>> install Anaconda and Jupyter, or can I just replace some modules ?
>>>>>>>>
>>>>>>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>>>>>>>> <Victor.Lazzarini@nuim.ie>:
>>>>>>>>> It is possible to read a Csound ftable via the API.
>>>>>>>>>
>>>>>>>>> I'd also suggest migrating to ctcsound if you
>>>>>>>>> are using csnd6. It's excellent.
>>>>>>>>>
>>>>>>>>> Victor Lazzarini
>>>>>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>>>>>> Maynooth University
>>>>>>>>> Ireland
>>>>>>>>>
>>>>>>>>> On 13 Oct 2016, at 22:18, Steven Yi <stevenyi@GMAIL.COM> wrote:
>>>>>>>>>
>>>>>>>>> Yes I think that was what I was thinking of, but I'm unsure
>>>>>>>>> whether it
>>>>>>>>> is
>>>>>>>>> supported now or not.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>>>>>>>>> <oyvind.brandtsegg@ntnu.no>
>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hi all,
>>>>>>>>>> thanks for the suggestions.
>>>>>>>>>> If I can read from a csound table directly in python code, that
>>>>>>>>>> would
>>>>>>>>>> be the best. Steven, do you mean this document
>>>>>>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>>>>>>>>>> There were several things in there that I did not know about, is
>>>>>>>>>> the
>>>>>>>>>> csound module as described there currently supported?
>>>>>>>>>>
>>>>>>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi <stevenyi@gmail.com>:
>>>>>>>>>>> Have you tried ftables? I.e. Filling the table in Csound, then
>>>>>>>>>>> reading
>>>>>>>>>>> from
>>>>>>>>>>> the table in the python code. I seem to remember the python
>>>>>>>>>>> opcodes
>>>>>>>>>>> having
>>>>>>>>>>> access to ftables and that there was example code for this.
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>>>>>>>>>>> <tarmo.johannes@otsakool.edu.ee> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Not sure, but would --realtime switch on command line help? I
>>>>>>>>>>>> don't
>>>>>>>>>>>> know
>>>>>>>>>>>> if that puts python to other thread from audio work...
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Tarmo
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>>>>>>>>>>>> <oyvind.brandtsegg@ntnu.no>:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>> I need to transfer the contents of an array from Csound to
>>>>>>>>>>>>> Python,
>>>>>>>>>>>>> as
>>>>>>>>>>>>> I want to do some peak picking and other analysis that is
>>>>>>>>>>>>> easier to
>>>>>>>>>>>>> get done in Python. The problem is that my (admittedly ad hoc)
>>>>>>>>>>>>> method
>>>>>>>>>>>>> of transferring the values from Csound to Python incurs
>>>>>>>>>>>>> significant
>>>>>>>>>>>>> performance degradation (more details on how I measure this
>>>>>>>>>>>>> later
>>>>>>>>>>>>> in
>>>>>>>>>>>>> this email).
>>>>>>>>>>>>>
>>>>>>>>>>>>> The basic premise is that I need Csound to be the main program
>>>>>>>>>>>>> (the
>>>>>>>>>>>>> host), and Python runs via the py opcodes.
>>>>>>>>>>>>>
>>>>>>>>>>>>> The array kAuto is of size 256, and transfer needs to be done
>>>>>>>>>>>>> once
>>>>>>>>>>>>> every 1 second, for 3 of these arrays. One should think the
>>>>>>>>>>>>> bandwidth
>>>>>>>>>>>>> requirement are not too taxing on any system, but since I only
>>>>>>>>>>>>> send
>>>>>>>>>>>>> single values, there are more than 700 pycalls happening in
>>>>>>>>>>>>> one
>>>>>>>>>>>>> k-rate
>>>>>>>>>>>>> pass.
>>>>>>>>>>>>> The python function "p.fill_array" does nothing but put the
>>>>>>>>>>>>> received
>>>>>>>>>>>>> values one by one into a numpy array.
>>>>>>>>>>>>>
>>>>>>>>>>>>> kcnt_fill = 0
>>>>>>>>>>>>> while kcnt_fill < ifftsize/2 do
>>>>>>>>>>>>>   pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill,
>>>>>>>>>>>>> ifftsize/2
>>>>>>>>>>>>>   kcnt_fill += 1
>>>>>>>>>>>>> od
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> By performance degradation I mean that the operation seems to
>>>>>>>>>>>>> let
>>>>>>>>>>>>> the
>>>>>>>>>>>>> different processes to wait for each other a lot, utlimately
>>>>>>>>>>>>> leading
>>>>>>>>>>>>> to dropouts in realtime audio. This does not show up as CPU
>>>>>>>>>>>>> spikes
>>>>>>>>>>>>> (running at around 50%), but shows in Reaper's performence
>>>>>>>>>>>>> meter as
>>>>>>>>>>>>> "RT longest-block". This meter shows the number of
>>>>>>>>>>>>> milliseconds
>>>>>>>>>>>>> used/available per audio processing block. The *used* must
>>>>>>>>>>>>> generally
>>>>>>>>>>>>> be less than the *available* time to avoid dropouts. Some
>>>>>>>>>>>>> spikes
>>>>>>>>>>>>> are
>>>>>>>>>>>>> not necessarily bad, but in my case the *used* is generally
>>>>>>>>>>>>> quite
>>>>>>>>>>>>> stable and higher than the *available*, unless I comment out
>>>>>>>>>>>>> the
>>>>>>>>>>>>> code
>>>>>>>>>>>>> excerpt given above.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Is there any way I can send an array from Csound to Python in
>>>>>>>>>>>>> one
>>>>>>>>>>>>> go?
>>>>>>>>>>>>> I seem to remember some black magic about letting Python
>>>>>>>>>>>>> running
>>>>>>>>>>>>> under
>>>>>>>>>>>>> Csound get access to the (host) csound instance and thus
>>>>>>>>>>>>> accessing
>>>>>>>>>>>>> the
>>>>>>>>>>>>> Csound API. Would that be the best way to do it, and would it
>>>>>>>>>>>>> be
>>>>>>>>>>>>> considered a safe way of doing it?
>>>>>>>>>>>>>
>>>>>>>>>>>>> best
>>>>>>>>>>>>> Oeyvind
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>>
>>>>>>>>>>>>> Oeyvind Brandtsegg
>>>>>>>>>>>>> Professor of Music Technology
>>>>>>>>>>>>> NTNU
>>>>>>>>>>>>> 7491 Trondheim
>>>>>>>>>>>>> Norway
>>>>>>>>>>>>> Cell: +47 92 203 205
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://www.partikkelaudio.com/
>>>>>>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>>>>>>>>> http://gdsp.hf.ntnu.no/
>>>>>>>>>>>>> http://soundcloud.com/brandtsegg
>>>>>>>>>>>>> http://flyndresang.no/
>>>>>>>>>>>>> http://soundcloud.com/t-emp
>>>>>>>>>>>>>
>>>>>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>>
>>>>>>>>>> Oeyvind Brandtsegg
>>>>>>>>>> Professor of Music Technology
>>>>>>>>>> NTNU
>>>>>>>>>> 7491 Trondheim
>>>>>>>>>> Norway
>>>>>>>>>> Cell: +47 92 203 205
>>>>>>>>>>
>>>>>>>>>> http://www.partikkelaudio.com/
>>>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>>>>>> http://gdsp.hf.ntnu.no/
>>>>>>>>>> http://soundcloud.com/brandtsegg
>>>>>>>>>> http://flyndresang.no/
>>>>>>>>>> http://soundcloud.com/t-emp
>>>>>>>>>>
>>>>>>>>>> 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
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> Oeyvind Brandtsegg
>>>>>>>> Professor of Music Technology
>>>>>>>> NTNU
>>>>>>>> 7491 Trondheim
>>>>>>>> Norway
>>>>>>>> Cell: +47 92 203 205
>>>>>>>>
>>>>>>>> http://www.partikkelaudio.com/
>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>>>> http://gdsp.hf.ntnu.no/
>>>>>>>> http://soundcloud.com/brandtsegg
>>>>>>>> http://flyndresang.no/
>>>>>>>> http://soundcloud.com/t-emp
>>>>>>>>
>>>>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Oeyvind Brandtsegg
>>>>>> Professor of Music Technology
>>>>>> NTNU
>>>>>> 7491 Trondheim
>>>>>> Norway
>>>>>> Cell: +47 92 203 205
>>>>>>
>>>>>> http://www.partikkelaudio.com/
>>>>>> http://crossadaptive.hf.ntnu.no
>>>>>> http://gdsp.hf.ntnu.no/
>>>>>> http://soundcloud.com/brandtsegg
>>>>>> http://flyndresang.no/
>>>>>> http://soundcloud.com/t-emp
>>>>>>
>>>>>> 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
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Oeyvind Brandtsegg
>>>> Professor of Music Technology
>>>> NTNU
>>>> 7491 Trondheim
>>>> Norway
>>>> Cell: +47 92 203 205
>>>>
>>>> http://www.partikkelaudio.com/
>>>> http://crossadaptive.hf.ntnu.no
>>>> http://gdsp.hf.ntnu.no/
>>>> http://soundcloud.com/brandtsegg
>>>> http://flyndresang.no/
>>>> http://soundcloud.com/t-emp
>>>>
>>>> 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
>
>
>
> --
>
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
>
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
>
> 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

Date2016-11-06 11:21
FromFrancois PINOT
SubjectRe: Optimization tip wanted for Csound/Python
csound64.dll should be accessible through your PATH. Normally it is located in "C:\Program Files\Csound_x64\bin".

You can verify that this path is referenced in your PATH environment variable with this command:

  echo %PATH%

If this is not the case, you'll have to add this path to your PATH environment variable or to the system PATH environment variable.

François

2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
Thanks,
this was left cold for a while, but now I'm back on track.

I get

>>> import ctcsound
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ctcsound.py", line 2411, in <module>
    libcspt = cdll.csnd6
  File "C:\Python27\Lib\ctypes\__init__.py", line 435, in __getattr__
    dll = self._dlltype(name)
  File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] Den angitte modulen ble ikke funnet

... which I assume also relates to line 30 of ctcsound.py
elif sys.platform.startswith('win'):
    libcsound = cdll.csound64

I understand (guess) that cdll is probably the ctypes dll, but where
can I set it up so that it finds csound64?

best
Oeyvind

2016-10-15 3:04 GMT-07:00 Francois PINOT <fggpinot@gmail.com>:
> I just pushed to my github repo an example showing how to use ctcsound from
> the py- opcodes within a running instance of Csound:
>
>
> https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>
> Notice that actually Python2 is used by default due the hardcoded choice of
> Python when building Csound.
>
> François
>
> 2016-10-14 15:23 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>
>> We might need a csoundGetInstance() function or similar in ctcsound so
>> that the
>> opcodes can communicate with the running Csound.
>>
>> http://csound.github.io/docs/manual/pyinit.html
>>
>> > On 14 Oct 2016, at 13:56, Francois PINOT <fggpinot@gmail.com> wrote:
>> >
>> > pyruni "import ctcsound" in global part?
>> >
>> > François
>> >
>> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>> > <oyvind.brandtsegg@ntnu.no>:
>> > Yes, but how to I tell Csound (the py opcodes within Csound) to use
>> > ctcsound ?
>> >
>> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> > > You can just install numpy.
>> > >
>> > > Victor Lazzarini
>> > > Dean of Arts, Celtic Studies, and Philosophy
>> > > Maynooth University
>> > > Ireland
>> > >
>> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>> > >> <oyvind.brandtsegg@NTNU.NO> wrote:
>> > >>
>> > >> Ah, now I remember, I tried this earlier and did not complete
>> > >> installing Anaconda, as it seemed like it could interfere with other
>> > >> system variables so I backed out.
>> > >> Is there a way for me to configure the environment without installing
>> > >> Anaconda? I'm in the middle of several productions, so I am hesitant
>> > >> to let an installer make automatic changes to my system.
>> > >>
>> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT <fggpinot@gmail.com>:
>> > >>> Only numpy is mandatory.
>> > >>>
>> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You need an
>> > >>> environment set properly for each version of Python you will use.
>> > >>> Anaconda
>> > >>> facilitates this, and it provides a lot of modules for scientific
>> > >>> computing.
>> > >>> Jupyter is a plus allowing you to use Csound within notebooks.
>> > >>>
>> > >>> François
>> > >>>
>> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>> > >>> <oyvind.brandtsegg@ntnu.no>:
>> > >>>>
>> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed
>> > >>>> the
>> > >>>> info on the list with interest, waiting to dive in.
>> > >>>> Is there some instructions on how to migrate somewhere? Do I need
>> > >>>> to
>> > >>>> install Anaconda and Jupyter, or can I just replace some modules ?
>> > >>>>
>> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>> > >>>> <Victor.Lazzarini@nuim.ie>:
>> > >>>>> It is possible to read a Csound ftable via the API.
>> > >>>>>
>> > >>>>> I'd also suggest migrating to ctcsound if you
>> > >>>>> are using csnd6. It's excellent.
>> > >>>>>
>> > >>>>> Victor Lazzarini
>> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>> > >>>>> Maynooth University
>> > >>>>> Ireland
>> > >>>>>
>> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi <stevenyi@GMAIL.COM> wrote:
>> > >>>>>
>> > >>>>> Yes I think that was what I was thinking of, but I'm unsure
>> > >>>>> whether it
>> > >>>>> is
>> > >>>>> supported now or not.
>> > >>>>>
>> > >>>>>
>> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>> > >>>>> <oyvind.brandtsegg@ntnu.no>
>> > >>>>> wrote:
>> > >>>>>>
>> > >>>>>> Hi all,
>> > >>>>>> thanks for the suggestions.
>> > >>>>>> If I can read from a csound table directly in python code, that
>> > >>>>>> would
>> > >>>>>> be the best. Steven, do you mean this document
>> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> > >>>>>> There were several things in there that I did not know about, is
>> > >>>>>> the
>> > >>>>>> csound module as described there currently supported?
>> > >>>>>>
>> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi <stevenyi@gmail.com>:
>> > >>>>>>> Have you tried ftables? I.e. Filling the table in Csound, then
>> > >>>>>>> reading
>> > >>>>>>> from
>> > >>>>>>> the table in the python code. I seem to remember the python
>> > >>>>>>> opcodes
>> > >>>>>>> having
>> > >>>>>>> access to ftables and that there was example code for this.
>> > >>>>>>>
>> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> > >>>>>>> <tarmo.johannes@otsakool.edu.ee> wrote:
>> > >>>>>>>>
>> > >>>>>>>> Not sure, but would --realtime switch on command line help? I
>> > >>>>>>>> don't
>> > >>>>>>>> know
>> > >>>>>>>> if that puts python to other thread from audio work...
>> > >>>>>>>>
>> > >>>>>>>>
>> > >>>>>>>> Tarmo
>> > >>>>>>>>
>> > >>>>>>>>
>> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> > >>>>>>>> <oyvind.brandtsegg@ntnu.no>:
>> > >>>>>>>>>
>> > >>>>>>>>> Hi,
>> > >>>>>>>>> I need to transfer the contents of an array from Csound to
>> > >>>>>>>>> Python,
>> > >>>>>>>>> as
>> > >>>>>>>>> I want to do some peak picking and other analysis that is
>> > >>>>>>>>> easier to
>> > >>>>>>>>> get done in Python. The problem is that my (admittedly ad hoc)
>> > >>>>>>>>> method
>> > >>>>>>>>> of transferring the values from Csound to Python incurs
>> > >>>>>>>>> significant
>> > >>>>>>>>> performance degradation (more details on how I measure this
>> > >>>>>>>>> later
>> > >>>>>>>>> in
>> > >>>>>>>>> this email).
>> > >>>>>>>>>
>> > >>>>>>>>> The basic premise is that I need Csound to be the main program
>> > >>>>>>>>> (the
>> > >>>>>>>>> host), and Python runs via the py opcodes.
>> > >>>>>>>>>
>> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to be done
>> > >>>>>>>>> once
>> > >>>>>>>>> every 1 second, for 3 of these arrays. One should think the
>> > >>>>>>>>> bandwidth
>> > >>>>>>>>> requirement are not too taxing on any system, but since I only
>> > >>>>>>>>> send
>> > >>>>>>>>> single values, there are more than 700 pycalls happening in
>> > >>>>>>>>> one
>> > >>>>>>>>> k-rate
>> > >>>>>>>>> pass.
>> > >>>>>>>>> The python function "p.fill_array" does nothing but put the
>> > >>>>>>>>> received
>> > >>>>>>>>> values one by one into a numpy array.
>> > >>>>>>>>>
>> > >>>>>>>>>  kcnt_fill = 0
>> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill,
>> > >>>>>>>>> ifftsize/2
>> > >>>>>>>>>    kcnt_fill += 1
>> > >>>>>>>>>  od
>> > >>>>>>>>>
>> > >>>>>>>>>
>> > >>>>>>>>> By performance degradation I mean that the operation seems to
>> > >>>>>>>>> let
>> > >>>>>>>>> the
>> > >>>>>>>>> different processes to wait for each other a lot, utlimately
>> > >>>>>>>>> leading
>> > >>>>>>>>> to dropouts in realtime audio. This does not show up as CPU
>> > >>>>>>>>> spikes
>> > >>>>>>>>> (running at around 50%), but shows in Reaper's performence
>> > >>>>>>>>> meter as
>> > >>>>>>>>> "RT longest-block". This meter shows the number of
>> > >>>>>>>>> milliseconds
>> > >>>>>>>>> used/available per audio processing block. The *used* must
>> > >>>>>>>>> generally
>> > >>>>>>>>> be less than the *available* time to avoid dropouts. Some
>> > >>>>>>>>> spikes
>> > >>>>>>>>> are
>> > >>>>>>>>> not necessarily bad, but in my case the *used* is generally
>> > >>>>>>>>> quite
>> > >>>>>>>>> stable and higher than the *available*, unless I comment out
>> > >>>>>>>>> the
>> > >>>>>>>>> code
>> > >>>>>>>>> excerpt given above.
>> > >>>>>>>>>
>> > >>>>>>>>> Is there any way I can send an array from Csound to Python in
>> > >>>>>>>>> one
>> > >>>>>>>>> go?
>> > >>>>>>>>> I seem to remember some black magic about letting Python
>> > >>>>>>>>> running
>> > >>>>>>>>> under
>> > >>>>>>>>> Csound get access to the (host) csound instance and thus
>> > >>>>>>>>> accessing
>> > >>>>>>>>> the
>> > >>>>>>>>> Csound API. Would that be the best way to do it, and would it
>> > >>>>>>>>> be
>> > >>>>>>>>> considered a safe way of doing it?
>> > >>>>>>>>>
>> > >>>>>>>>> best
>> > >>>>>>>>> Oeyvind
>> > >>>>>>>>>
>> > >>>>>>>>> --
>> > >>>>>>>>>
>> > >>>>>>>>> Oeyvind Brandtsegg
>> > >>>>>>>>> Professor of Music Technology
>> > >>>>>>>>> NTNU
>> > >>>>>>>>> 7491 Trondheim
>> > >>>>>>>>> Norway
>> > >>>>>>>>> Cell: +47 92 203 205
>> > >>>>>>>>>
>> > >>>>>>>>> http://www.partikkelaudio.com/
>> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>> > >>>>>>>>> http://soundcloud.com/brandtsegg
>> > >>>>>>>>> http://flyndresang.no/
>> > >>>>>>>>> http://soundcloud.com/t-emp
>> > >>>>>>>>>
>> > >>>>>>>>> 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
>> > >>>>>>
>> > >>>>>>
>> > >>>>>>
>> > >>>>>> --
>> > >>>>>>
>> > >>>>>> Oeyvind Brandtsegg
>> > >>>>>> Professor of Music Technology
>> > >>>>>> NTNU
>> > >>>>>> 7491 Trondheim
>> > >>>>>> Norway
>> > >>>>>> Cell: +47 92 203 205
>> > >>>>>>
>> > >>>>>> http://www.partikkelaudio.com/
>> > >>>>>> http://crossadaptive.hf.ntnu.no
>> > >>>>>> http://gdsp.hf.ntnu.no/
>> > >>>>>> http://soundcloud.com/brandtsegg
>> > >>>>>> http://flyndresang.no/
>> > >>>>>> http://soundcloud.com/t-emp
>> > >>>>>>
>> > >>>>>> 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
>> > >>>>
>> > >>>>
>> > >>>>
>> > >>>> --
>> > >>>>
>> > >>>> Oeyvind Brandtsegg
>> > >>>> Professor of Music Technology
>> > >>>> NTNU
>> > >>>> 7491 Trondheim
>> > >>>> Norway
>> > >>>> Cell: +47 92 203 205
>> > >>>>
>> > >>>> http://www.partikkelaudio.com/
>> > >>>> http://crossadaptive.hf.ntnu.no
>> > >>>> http://gdsp.hf.ntnu.no/
>> > >>>> http://soundcloud.com/brandtsegg
>> > >>>> http://flyndresang.no/
>> > >>>> http://soundcloud.com/t-emp
>> > >>>>
>> > >>>> 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
>> > >>
>> > >>
>> > >>
>> > >> --
>> > >>
>> > >> Oeyvind Brandtsegg
>> > >> Professor of Music Technology
>> > >> NTNU
>> > >> 7491 Trondheim
>> > >> Norway
>> > >> Cell: +47 92 203 205
>> > >>
>> > >> http://www.partikkelaudio.com/
>> > >> http://crossadaptive.hf.ntnu.no
>> > >> http://gdsp.hf.ntnu.no/
>> > >> http://soundcloud.com/brandtsegg
>> > >> http://flyndresang.no/
>> > >> http://soundcloud.com/t-emp
>> > >>
>> > >> 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
>> >
>> >
>> >
>> > --
>> >
>> > Oeyvind Brandtsegg
>> > Professor of Music Technology
>> > NTNU
>> > 7491 Trondheim
>> > Norway
>> > Cell: +47 92 203 205
>> >
>> > http://www.partikkelaudio.com/
>> > http://crossadaptive.hf.ntnu.no
>> > http://gdsp.hf.ntnu.no/
>> > http://soundcloud.com/brandtsegg
>> > http://flyndresang.no/
>> > http://soundcloud.com/t-emp
>> >
>> > 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-11-07 18:20
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
Ok. It is in my path,
but now I realize that this was not the culprit,
...my bad. I had not copied in csnd.dll from my build dir.

Now I get test_ctcsound.py to this stage:
(...snip)
writing 4096 sample blks of 64-bit floats to dac
SECTION 1:
F
======================================================================
FAIL: test_inputOutputbuffer (__main__.TestGeneralIO)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_ctcsound.py", line 78, in test_inputOutputbuffer
    self.assertTrue(np.array_equal(obuf, ibuf/3.0))
AssertionError: False is not true

----------------------------------------------------------------------
Ran 6 tests in 8.216s

FAILED (failures=1)




2016-11-06 3:21 GMT-08:00 Francois PINOT :
> csound64.dll should be accessible through your PATH. Normally it is located
> in "C:\Program Files\Csound_x64\bin".
>
> You can verify that this path is referenced in your PATH environment
> variable with this command:
>
>   echo %PATH%
>
> If this is not the case, you'll have to add this path to your PATH
> environment variable or to the system PATH environment variable.
>
> François
>
> 2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg :
>>
>> Thanks,
>> this was left cold for a while, but now I'm back on track.
>>
>> I get
>>
>> >>> import ctcsound
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File "ctcsound.py", line 2411, in 
>>     libcspt = cdll.csnd6
>>   File "C:\Python27\Lib\ctypes\__init__.py", line 435, in __getattr__
>>     dll = self._dlltype(name)
>>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>>     self._handle = _dlopen(self._name, mode)
>> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>>
>> ... which I assume also relates to line 30 of ctcsound.py
>> elif sys.platform.startswith('win'):
>>     libcsound = cdll.csound64
>>
>> I understand (guess) that cdll is probably the ctypes dll, but where
>> can I set it up so that it finds csound64?
>>
>> best
>> Oeyvind
>>
>> 2016-10-15 3:04 GMT-07:00 Francois PINOT :
>> > I just pushed to my github repo an example showing how to use ctcsound
>> > from
>> > the py- opcodes within a running instance of Csound:
>> >
>> >
>> >
>> > https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>> >
>> > Notice that actually Python2 is used by default due the hardcoded choice
>> > of
>> > Python when building Csound.
>> >
>> > François
>> >
>> > 2016-10-14 15:23 GMT+02:00 Victor Lazzarini :
>> >>
>> >> We might need a csoundGetInstance() function or similar in ctcsound so
>> >> that the
>> >> opcodes can communicate with the running Csound.
>> >>
>> >> http://csound.github.io/docs/manual/pyinit.html
>> >>
>> >> > On 14 Oct 2016, at 13:56, Francois PINOT  wrote:
>> >> >
>> >> > pyruni "import ctcsound" in global part?
>> >> >
>> >> > François
>> >> >
>> >> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>> >> > :
>> >> > Yes, but how to I tell Csound (the py opcodes within Csound) to use
>> >> > ctcsound ?
>> >> >
>> >> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini
>> >> > :
>> >> > > You can just install numpy.
>> >> > >
>> >> > > Victor Lazzarini
>> >> > > Dean of Arts, Celtic Studies, and Philosophy
>> >> > > Maynooth University
>> >> > > Ireland
>> >> > >
>> >> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>> >> > >>  wrote:
>> >> > >>
>> >> > >> Ah, now I remember, I tried this earlier and did not complete
>> >> > >> installing Anaconda, as it seemed like it could interfere with
>> >> > >> other
>> >> > >> system variables so I backed out.
>> >> > >> Is there a way for me to configure the environment without
>> >> > >> installing
>> >> > >> Anaconda? I'm in the middle of several productions, so I am
>> >> > >> hesitant
>> >> > >> to let an installer make automatic changes to my system.
>> >> > >>
>> >> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT :
>> >> > >>> Only numpy is mandatory.
>> >> > >>>
>> >> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You need
>> >> > >>> an
>> >> > >>> environment set properly for each version of Python you will use.
>> >> > >>> Anaconda
>> >> > >>> facilitates this, and it provides a lot of modules for scientific
>> >> > >>> computing.
>> >> > >>> Jupyter is a plus allowing you to use Csound within notebooks.
>> >> > >>>
>> >> > >>> François
>> >> > >>>
>> >> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>> >> > >>> :
>> >> > >>>>
>> >> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed
>> >> > >>>> the
>> >> > >>>> info on the list with interest, waiting to dive in.
>> >> > >>>> Is there some instructions on how to migrate somewhere? Do I
>> >> > >>>> need
>> >> > >>>> to
>> >> > >>>> install Anaconda and Jupyter, or can I just replace some modules
>> >> > >>>> ?
>> >> > >>>>
>> >> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>> >> > >>>> :
>> >> > >>>>> It is possible to read a Csound ftable via the API.
>> >> > >>>>>
>> >> > >>>>> I'd also suggest migrating to ctcsound if you
>> >> > >>>>> are using csnd6. It's excellent.
>> >> > >>>>>
>> >> > >>>>> Victor Lazzarini
>> >> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>> >> > >>>>> Maynooth University
>> >> > >>>>> Ireland
>> >> > >>>>>
>> >> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi  wrote:
>> >> > >>>>>
>> >> > >>>>> Yes I think that was what I was thinking of, but I'm unsure
>> >> > >>>>> whether it
>> >> > >>>>> is
>> >> > >>>>> supported now or not.
>> >> > >>>>>
>> >> > >>>>>
>> >> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>> >> > >>>>> 
>> >> > >>>>> wrote:
>> >> > >>>>>>
>> >> > >>>>>> Hi all,
>> >> > >>>>>> thanks for the suggestions.
>> >> > >>>>>> If I can read from a csound table directly in python code,
>> >> > >>>>>> that
>> >> > >>>>>> would
>> >> > >>>>>> be the best. Steven, do you mean this document
>> >> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> >> > >>>>>> There were several things in there that I did not know about,
>> >> > >>>>>> is
>> >> > >>>>>> the
>> >> > >>>>>> csound module as described there currently supported?
>> >> > >>>>>>
>> >> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi :
>> >> > >>>>>>> Have you tried ftables? I.e. Filling the table in Csound,
>> >> > >>>>>>> then
>> >> > >>>>>>> reading
>> >> > >>>>>>> from
>> >> > >>>>>>> the table in the python code. I seem to remember the python
>> >> > >>>>>>> opcodes
>> >> > >>>>>>> having
>> >> > >>>>>>> access to ftables and that there was example code for this.
>> >> > >>>>>>>
>> >> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> >> > >>>>>>>  wrote:
>> >> > >>>>>>>>
>> >> > >>>>>>>> Not sure, but would --realtime switch on command line help?
>> >> > >>>>>>>> I
>> >> > >>>>>>>> don't
>> >> > >>>>>>>> know
>> >> > >>>>>>>> if that puts python to other thread from audio work...
>> >> > >>>>>>>>
>> >> > >>>>>>>>
>> >> > >>>>>>>> Tarmo
>> >> > >>>>>>>>
>> >> > >>>>>>>>
>> >> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> >> > >>>>>>>> :
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> Hi,
>> >> > >>>>>>>>> I need to transfer the contents of an array from Csound to
>> >> > >>>>>>>>> Python,
>> >> > >>>>>>>>> as
>> >> > >>>>>>>>> I want to do some peak picking and other analysis that is
>> >> > >>>>>>>>> easier to
>> >> > >>>>>>>>> get done in Python. The problem is that my (admittedly ad
>> >> > >>>>>>>>> hoc)
>> >> > >>>>>>>>> method
>> >> > >>>>>>>>> of transferring the values from Csound to Python incurs
>> >> > >>>>>>>>> significant
>> >> > >>>>>>>>> performance degradation (more details on how I measure this
>> >> > >>>>>>>>> later
>> >> > >>>>>>>>> in
>> >> > >>>>>>>>> this email).
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> The basic premise is that I need Csound to be the main
>> >> > >>>>>>>>> program
>> >> > >>>>>>>>> (the
>> >> > >>>>>>>>> host), and Python runs via the py opcodes.
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to be
>> >> > >>>>>>>>> done
>> >> > >>>>>>>>> once
>> >> > >>>>>>>>> every 1 second, for 3 of these arrays. One should think the
>> >> > >>>>>>>>> bandwidth
>> >> > >>>>>>>>> requirement are not too taxing on any system, but since I
>> >> > >>>>>>>>> only
>> >> > >>>>>>>>> send
>> >> > >>>>>>>>> single values, there are more than 700 pycalls happening in
>> >> > >>>>>>>>> one
>> >> > >>>>>>>>> k-rate
>> >> > >>>>>>>>> pass.
>> >> > >>>>>>>>> The python function "p.fill_array" does nothing but put the
>> >> > >>>>>>>>> received
>> >> > >>>>>>>>> values one by one into a numpy array.
>> >> > >>>>>>>>>
>> >> > >>>>>>>>>  kcnt_fill = 0
>> >> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>> >> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill,
>> >> > >>>>>>>>> ifftsize/2
>> >> > >>>>>>>>>    kcnt_fill += 1
>> >> > >>>>>>>>>  od
>> >> > >>>>>>>>>
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> By performance degradation I mean that the operation seems
>> >> > >>>>>>>>> to
>> >> > >>>>>>>>> let
>> >> > >>>>>>>>> the
>> >> > >>>>>>>>> different processes to wait for each other a lot,
>> >> > >>>>>>>>> utlimately
>> >> > >>>>>>>>> leading
>> >> > >>>>>>>>> to dropouts in realtime audio. This does not show up as CPU
>> >> > >>>>>>>>> spikes
>> >> > >>>>>>>>> (running at around 50%), but shows in Reaper's performence
>> >> > >>>>>>>>> meter as
>> >> > >>>>>>>>> "RT longest-block". This meter shows the number of
>> >> > >>>>>>>>> milliseconds
>> >> > >>>>>>>>> used/available per audio processing block. The *used* must
>> >> > >>>>>>>>> generally
>> >> > >>>>>>>>> be less than the *available* time to avoid dropouts. Some
>> >> > >>>>>>>>> spikes
>> >> > >>>>>>>>> are
>> >> > >>>>>>>>> not necessarily bad, but in my case the *used* is generally
>> >> > >>>>>>>>> quite
>> >> > >>>>>>>>> stable and higher than the *available*, unless I comment
>> >> > >>>>>>>>> out
>> >> > >>>>>>>>> the
>> >> > >>>>>>>>> code
>> >> > >>>>>>>>> excerpt given above.
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> Is there any way I can send an array from Csound to Python
>> >> > >>>>>>>>> in
>> >> > >>>>>>>>> one
>> >> > >>>>>>>>> go?
>> >> > >>>>>>>>> I seem to remember some black magic about letting Python
>> >> > >>>>>>>>> running
>> >> > >>>>>>>>> under
>> >> > >>>>>>>>> Csound get access to the (host) csound instance and thus
>> >> > >>>>>>>>> accessing
>> >> > >>>>>>>>> the
>> >> > >>>>>>>>> Csound API. Would that be the best way to do it, and would
>> >> > >>>>>>>>> it
>> >> > >>>>>>>>> be
>> >> > >>>>>>>>> considered a safe way of doing it?
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> best
>> >> > >>>>>>>>> Oeyvind
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> --
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> Oeyvind Brandtsegg
>> >> > >>>>>>>>> Professor of Music Technology
>> >> > >>>>>>>>> NTNU
>> >> > >>>>>>>>> 7491 Trondheim
>> >> > >>>>>>>>> Norway
>> >> > >>>>>>>>> Cell: +47 92 203 205
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> http://www.partikkelaudio.com/
>> >> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>> >> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>> >> > >>>>>>>>> http://soundcloud.com/brandtsegg
>> >> > >>>>>>>>> http://flyndresang.no/
>> >> > >>>>>>>>> http://soundcloud.com/t-emp
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> 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
>> >> > >>>>>>
>> >> > >>>>>>
>> >> > >>>>>>
>> >> > >>>>>> --
>> >> > >>>>>>
>> >> > >>>>>> Oeyvind Brandtsegg
>> >> > >>>>>> Professor of Music Technology
>> >> > >>>>>> NTNU
>> >> > >>>>>> 7491 Trondheim
>> >> > >>>>>> Norway
>> >> > >>>>>> Cell: +47 92 203 205
>> >> > >>>>>>
>> >> > >>>>>> http://www.partikkelaudio.com/
>> >> > >>>>>> http://crossadaptive.hf.ntnu.no
>> >> > >>>>>> http://gdsp.hf.ntnu.no/
>> >> > >>>>>> http://soundcloud.com/brandtsegg
>> >> > >>>>>> http://flyndresang.no/
>> >> > >>>>>> http://soundcloud.com/t-emp
>> >> > >>>>>>
>> >> > >>>>>> 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
>> >> > >>>>
>> >> > >>>>
>> >> > >>>>
>> >> > >>>> --
>> >> > >>>>
>> >> > >>>> Oeyvind Brandtsegg
>> >> > >>>> Professor of Music Technology
>> >> > >>>> NTNU
>> >> > >>>> 7491 Trondheim
>> >> > >>>> Norway
>> >> > >>>> Cell: +47 92 203 205
>> >> > >>>>
>> >> > >>>> http://www.partikkelaudio.com/
>> >> > >>>> http://crossadaptive.hf.ntnu.no
>> >> > >>>> http://gdsp.hf.ntnu.no/
>> >> > >>>> http://soundcloud.com/brandtsegg
>> >> > >>>> http://flyndresang.no/
>> >> > >>>> http://soundcloud.com/t-emp
>> >> > >>>>
>> >> > >>>> 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
>> >> > >>
>> >> > >>
>> >> > >>
>> >> > >> --
>> >> > >>
>> >> > >> Oeyvind Brandtsegg
>> >> > >> Professor of Music Technology
>> >> > >> NTNU
>> >> > >> 7491 Trondheim
>> >> > >> Norway
>> >> > >> Cell: +47 92 203 205
>> >> > >>
>> >> > >> http://www.partikkelaudio.com/
>> >> > >> http://crossadaptive.hf.ntnu.no
>> >> > >> http://gdsp.hf.ntnu.no/
>> >> > >> http://soundcloud.com/brandtsegg
>> >> > >> http://flyndresang.no/
>> >> > >> http://soundcloud.com/t-emp
>> >> > >>
>> >> > >> 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
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> >
>> >> > Oeyvind Brandtsegg
>> >> > Professor of Music Technology
>> >> > NTNU
>> >> > 7491 Trondheim
>> >> > Norway
>> >> > Cell: +47 92 203 205
>> >> >
>> >> > http://www.partikkelaudio.com/
>> >> > http://crossadaptive.hf.ntnu.no
>> >> > http://gdsp.hf.ntnu.no/
>> >> > http://soundcloud.com/brandtsegg
>> >> > http://flyndresang.no/
>> >> > http://soundcloud.com/t-emp
>> >> >
>> >> > 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-11-07 18:27
FromFrancois PINOT
SubjectRe: Optimization tip wanted for Csound/Python
Is the file "bufferInOut.csd" present in the directory you ran test_ctcsound.py from?

François

2016-11-07 19:20 GMT+01:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
Ok. It is in my path,
but now I realize that this was not the culprit,
...my bad. I had not copied in csnd.dll from my build dir.

Now I get test_ctcsound.py to this stage:
(...snip)
writing 4096 sample blks of 64-bit floats to dac
SECTION 1:
F
======================================================================
FAIL: test_inputOutputbuffer (__main__.TestGeneralIO)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_ctcsound.py", line 78, in test_inputOutputbuffer
    self.assertTrue(np.array_equal(obuf, ibuf/3.0))
AssertionError: False is not true

----------------------------------------------------------------------
Ran 6 tests in 8.216s

FAILED (failures=1)




2016-11-06 3:21 GMT-08:00 Francois PINOT <fggpinot@gmail.com>:
> csound64.dll should be accessible through your PATH. Normally it is located
> in "C:\Program Files\Csound_x64\bin".
>
> You can verify that this path is referenced in your PATH environment
> variable with this command:
>
>   echo %PATH%
>
> If this is not the case, you'll have to add this path to your PATH
> environment variable or to the system PATH environment variable.
>
> François
>
> 2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
>>
>> Thanks,
>> this was left cold for a while, but now I'm back on track.
>>
>> I get
>>
>> >>> import ctcsound
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File "ctcsound.py", line 2411, in <module>
>>     libcspt = cdll.csnd6
>>   File "C:\Python27\Lib\ctypes\__init__.py", line 435, in __getattr__
>>     dll = self._dlltype(name)
>>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>>     self._handle = _dlopen(self._name, mode)
>> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>>
>> ... which I assume also relates to line 30 of ctcsound.py
>> elif sys.platform.startswith('win'):
>>     libcsound = cdll.csound64
>>
>> I understand (guess) that cdll is probably the ctypes dll, but where
>> can I set it up so that it finds csound64?
>>
>> best
>> Oeyvind
>>
>> 2016-10-15 3:04 GMT-07:00 Francois PINOT <fggpinot@gmail.com>:
>> > I just pushed to my github repo an example showing how to use ctcsound
>> > from
>> > the py- opcodes within a running instance of Csound:
>> >
>> >
>> >
>> > https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>> >
>> > Notice that actually Python2 is used by default due the hardcoded choice
>> > of
>> > Python when building Csound.
>> >
>> > François
>> >
>> > 2016-10-14 15:23 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>> >>
>> >> We might need a csoundGetInstance() function or similar in ctcsound so
>> >> that the
>> >> opcodes can communicate with the running Csound.
>> >>
>> >> http://csound.github.io/docs/manual/pyinit.html
>> >>
>> >> > On 14 Oct 2016, at 13:56, Francois PINOT <fggpinot@gmail.com> wrote:
>> >> >
>> >> > pyruni "import ctcsound" in global part?
>> >> >
>> >> > François
>> >> >
>> >> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>> >> > <oyvind.brandtsegg@ntnu.no>:
>> >> > Yes, but how to I tell Csound (the py opcodes within Csound) to use
>> >> > ctcsound ?
>> >> >
>> >> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini
>> >> > <Victor.Lazzarini@nuim.ie>:
>> >> > > You can just install numpy.
>> >> > >
>> >> > > Victor Lazzarini
>> >> > > Dean of Arts, Celtic Studies, and Philosophy
>> >> > > Maynooth University
>> >> > > Ireland
>> >> > >
>> >> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>> >> > >> <oyvind.brandtsegg@NTNU.NO> wrote:
>> >> > >>
>> >> > >> Ah, now I remember, I tried this earlier and did not complete
>> >> > >> installing Anaconda, as it seemed like it could interfere with
>> >> > >> other
>> >> > >> system variables so I backed out.
>> >> > >> Is there a way for me to configure the environment without
>> >> > >> installing
>> >> > >> Anaconda? I'm in the middle of several productions, so I am
>> >> > >> hesitant
>> >> > >> to let an installer make automatic changes to my system.
>> >> > >>
>> >> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT <fggpinot@gmail.com>:
>> >> > >>> Only numpy is mandatory.
>> >> > >>>
>> >> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You need
>> >> > >>> an
>> >> > >>> environment set properly for each version of Python you will use.
>> >> > >>> Anaconda
>> >> > >>> facilitates this, and it provides a lot of modules for scientific
>> >> > >>> computing.
>> >> > >>> Jupyter is a plus allowing you to use Csound within notebooks.
>> >> > >>>
>> >> > >>> François
>> >> > >>>
>> >> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>> >> > >>> <oyvind.brandtsegg@ntnu.no>:
>> >> > >>>>
>> >> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just followed
>> >> > >>>> the
>> >> > >>>> info on the list with interest, waiting to dive in.
>> >> > >>>> Is there some instructions on how to migrate somewhere? Do I
>> >> > >>>> need
>> >> > >>>> to
>> >> > >>>> install Anaconda and Jupyter, or can I just replace some modules
>> >> > >>>> ?
>> >> > >>>>
>> >> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>> >> > >>>> <Victor.Lazzarini@nuim.ie>:
>> >> > >>>>> It is possible to read a Csound ftable via the API.
>> >> > >>>>>
>> >> > >>>>> I'd also suggest migrating to ctcsound if you
>> >> > >>>>> are using csnd6. It's excellent.
>> >> > >>>>>
>> >> > >>>>> Victor Lazzarini
>> >> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>> >> > >>>>> Maynooth University
>> >> > >>>>> Ireland
>> >> > >>>>>
>> >> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi <stevenyi@GMAIL.COM> wrote:
>> >> > >>>>>
>> >> > >>>>> Yes I think that was what I was thinking of, but I'm unsure
>> >> > >>>>> whether it
>> >> > >>>>> is
>> >> > >>>>> supported now or not.
>> >> > >>>>>
>> >> > >>>>>
>> >> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>> >> > >>>>> <oyvind.brandtsegg@ntnu.no>
>> >> > >>>>> wrote:
>> >> > >>>>>>
>> >> > >>>>>> Hi all,
>> >> > >>>>>> thanks for the suggestions.
>> >> > >>>>>> If I can read from a csound table directly in python code,
>> >> > >>>>>> that
>> >> > >>>>>> would
>> >> > >>>>>> be the best. Steven, do you mean this document
>> >> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> >> > >>>>>> There were several things in there that I did not know about,
>> >> > >>>>>> is
>> >> > >>>>>> the
>> >> > >>>>>> csound module as described there currently supported?
>> >> > >>>>>>
>> >> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi <stevenyi@gmail.com>:
>> >> > >>>>>>> Have you tried ftables? I.e. Filling the table in Csound,
>> >> > >>>>>>> then
>> >> > >>>>>>> reading
>> >> > >>>>>>> from
>> >> > >>>>>>> the table in the python code. I seem to remember the python
>> >> > >>>>>>> opcodes
>> >> > >>>>>>> having
>> >> > >>>>>>> access to ftables and that there was example code for this.
>> >> > >>>>>>>
>> >> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> >> > >>>>>>> <tarmo.johannes@otsakool.edu.ee> wrote:
>> >> > >>>>>>>>
>> >> > >>>>>>>> Not sure, but would --realtime switch on command line help?
>> >> > >>>>>>>> I
>> >> > >>>>>>>> don't
>> >> > >>>>>>>> know
>> >> > >>>>>>>> if that puts python to other thread from audio work...
>> >> > >>>>>>>>
>> >> > >>>>>>>>
>> >> > >>>>>>>> Tarmo
>> >> > >>>>>>>>
>> >> > >>>>>>>>
>> >> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> >> > >>>>>>>> <oyvind.brandtsegg@ntnu.no>:
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> Hi,
>> >> > >>>>>>>>> I need to transfer the contents of an array from Csound to
>> >> > >>>>>>>>> Python,
>> >> > >>>>>>>>> as
>> >> > >>>>>>>>> I want to do some peak picking and other analysis that is
>> >> > >>>>>>>>> easier to
>> >> > >>>>>>>>> get done in Python. The problem is that my (admittedly ad
>> >> > >>>>>>>>> hoc)
>> >> > >>>>>>>>> method
>> >> > >>>>>>>>> of transferring the values from Csound to Python incurs
>> >> > >>>>>>>>> significant
>> >> > >>>>>>>>> performance degradation (more details on how I measure this
>> >> > >>>>>>>>> later
>> >> > >>>>>>>>> in
>> >> > >>>>>>>>> this email).
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> The basic premise is that I need Csound to be the main
>> >> > >>>>>>>>> program
>> >> > >>>>>>>>> (the
>> >> > >>>>>>>>> host), and Python runs via the py opcodes.
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to be
>> >> > >>>>>>>>> done
>> >> > >>>>>>>>> once
>> >> > >>>>>>>>> every 1 second, for 3 of these arrays. One should think the
>> >> > >>>>>>>>> bandwidth
>> >> > >>>>>>>>> requirement are not too taxing on any system, but since I
>> >> > >>>>>>>>> only
>> >> > >>>>>>>>> send
>> >> > >>>>>>>>> single values, there are more than 700 pycalls happening in
>> >> > >>>>>>>>> one
>> >> > >>>>>>>>> k-rate
>> >> > >>>>>>>>> pass.
>> >> > >>>>>>>>> The python function "p.fill_array" does nothing but put the
>> >> > >>>>>>>>> received
>> >> > >>>>>>>>> values one by one into a numpy array.
>> >> > >>>>>>>>>
>> >> > >>>>>>>>>  kcnt_fill = 0
>> >> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>> >> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill,
>> >> > >>>>>>>>> ifftsize/2
>> >> > >>>>>>>>>    kcnt_fill += 1
>> >> > >>>>>>>>>  od
>> >> > >>>>>>>>>
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> By performance degradation I mean that the operation seems
>> >> > >>>>>>>>> to
>> >> > >>>>>>>>> let
>> >> > >>>>>>>>> the
>> >> > >>>>>>>>> different processes to wait for each other a lot,
>> >> > >>>>>>>>> utlimately
>> >> > >>>>>>>>> leading
>> >> > >>>>>>>>> to dropouts in realtime audio. This does not show up as CPU
>> >> > >>>>>>>>> spikes
>> >> > >>>>>>>>> (running at around 50%), but shows in Reaper's performence
>> >> > >>>>>>>>> meter as
>> >> > >>>>>>>>> "RT longest-block". This meter shows the number of
>> >> > >>>>>>>>> milliseconds
>> >> > >>>>>>>>> used/available per audio processing block. The *used* must
>> >> > >>>>>>>>> generally
>> >> > >>>>>>>>> be less than the *available* time to avoid dropouts. Some
>> >> > >>>>>>>>> spikes
>> >> > >>>>>>>>> are
>> >> > >>>>>>>>> not necessarily bad, but in my case the *used* is generally
>> >> > >>>>>>>>> quite
>> >> > >>>>>>>>> stable and higher than the *available*, unless I comment
>> >> > >>>>>>>>> out
>> >> > >>>>>>>>> the
>> >> > >>>>>>>>> code
>> >> > >>>>>>>>> excerpt given above.
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> Is there any way I can send an array from Csound to Python
>> >> > >>>>>>>>> in
>> >> > >>>>>>>>> one
>> >> > >>>>>>>>> go?
>> >> > >>>>>>>>> I seem to remember some black magic about letting Python
>> >> > >>>>>>>>> running
>> >> > >>>>>>>>> under
>> >> > >>>>>>>>> Csound get access to the (host) csound instance and thus
>> >> > >>>>>>>>> accessing
>> >> > >>>>>>>>> the
>> >> > >>>>>>>>> Csound API. Would that be the best way to do it, and would
>> >> > >>>>>>>>> it
>> >> > >>>>>>>>> be
>> >> > >>>>>>>>> considered a safe way of doing it?
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> best
>> >> > >>>>>>>>> Oeyvind
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> --
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> Oeyvind Brandtsegg
>> >> > >>>>>>>>> Professor of Music Technology
>> >> > >>>>>>>>> NTNU
>> >> > >>>>>>>>> 7491 Trondheim
>> >> > >>>>>>>>> Norway
>> >> > >>>>>>>>> Cell: +47 92 203 205
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> http://www.partikkelaudio.com/
>> >> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>> >> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>> >> > >>>>>>>>> http://soundcloud.com/brandtsegg
>> >> > >>>>>>>>> http://flyndresang.no/
>> >> > >>>>>>>>> http://soundcloud.com/t-emp
>> >> > >>>>>>>>>
>> >> > >>>>>>>>> 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
>> >> > >>>>>>
>> >> > >>>>>>
>> >> > >>>>>>
>> >> > >>>>>> --
>> >> > >>>>>>
>> >> > >>>>>> Oeyvind Brandtsegg
>> >> > >>>>>> Professor of Music Technology
>> >> > >>>>>> NTNU
>> >> > >>>>>> 7491 Trondheim
>> >> > >>>>>> Norway
>> >> > >>>>>> Cell: +47 92 203 205
>> >> > >>>>>>
>> >> > >>>>>> http://www.partikkelaudio.com/
>> >> > >>>>>> http://crossadaptive.hf.ntnu.no
>> >> > >>>>>> http://gdsp.hf.ntnu.no/
>> >> > >>>>>> http://soundcloud.com/brandtsegg
>> >> > >>>>>> http://flyndresang.no/
>> >> > >>>>>> http://soundcloud.com/t-emp
>> >> > >>>>>>
>> >> > >>>>>> 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
>> >> > >>>>
>> >> > >>>>
>> >> > >>>>
>> >> > >>>> --
>> >> > >>>>
>> >> > >>>> Oeyvind Brandtsegg
>> >> > >>>> Professor of Music Technology
>> >> > >>>> NTNU
>> >> > >>>> 7491 Trondheim
>> >> > >>>> Norway
>> >> > >>>> Cell: +47 92 203 205
>> >> > >>>>
>> >> > >>>> http://www.partikkelaudio.com/
>> >> > >>>> http://crossadaptive.hf.ntnu.no
>> >> > >>>> http://gdsp.hf.ntnu.no/
>> >> > >>>> http://soundcloud.com/brandtsegg
>> >> > >>>> http://flyndresang.no/
>> >> > >>>> http://soundcloud.com/t-emp
>> >> > >>>>
>> >> > >>>> 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
>> >> > >>
>> >> > >>
>> >> > >>
>> >> > >> --
>> >> > >>
>> >> > >> Oeyvind Brandtsegg
>> >> > >> Professor of Music Technology
>> >> > >> NTNU
>> >> > >> 7491 Trondheim
>> >> > >> Norway
>> >> > >> Cell: +47 92 203 205
>> >> > >>
>> >> > >> http://www.partikkelaudio.com/
>> >> > >> http://crossadaptive.hf.ntnu.no
>> >> > >> http://gdsp.hf.ntnu.no/
>> >> > >> http://soundcloud.com/brandtsegg
>> >> > >> http://flyndresang.no/
>> >> > >> http://soundcloud.com/t-emp
>> >> > >>
>> >> > >> 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
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> >
>> >> > Oeyvind Brandtsegg
>> >> > Professor of Music Technology
>> >> > NTNU
>> >> > 7491 Trondheim
>> >> > Norway
>> >> > Cell: +47 92 203 205
>> >> >
>> >> > http://www.partikkelaudio.com/
>> >> > http://crossadaptive.hf.ntnu.no
>> >> > http://gdsp.hf.ntnu.no/
>> >> > http://soundcloud.com/brandtsegg
>> >> > http://flyndresang.no/
>> >> > http://soundcloud.com/t-emp
>> >> >
>> >> > 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-11-07 18:50
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
Yes, I downloaded the full repo as a zip.


2016-11-07 10:27 GMT-08:00 Francois PINOT :
> Is the file "bufferInOut.csd" present in the directory you ran
> test_ctcsound.py from?
>
> François
>
> 2016-11-07 19:20 GMT+01:00 Oeyvind Brandtsegg :
>>
>> Ok. It is in my path,
>> but now I realize that this was not the culprit,
>> ...my bad. I had not copied in csnd.dll from my build dir.
>>
>> Now I get test_ctcsound.py to this stage:
>> (...snip)
>> writing 4096 sample blks of 64-bit floats to dac
>> SECTION 1:
>> F
>> ======================================================================
>> FAIL: test_inputOutputbuffer (__main__.TestGeneralIO)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>   File "test_ctcsound.py", line 78, in test_inputOutputbuffer
>>     self.assertTrue(np.array_equal(obuf, ibuf/3.0))
>> AssertionError: False is not true
>>
>> ----------------------------------------------------------------------
>> Ran 6 tests in 8.216s
>>
>> FAILED (failures=1)
>>
>>
>>
>>
>> 2016-11-06 3:21 GMT-08:00 Francois PINOT :
>> > csound64.dll should be accessible through your PATH. Normally it is
>> > located
>> > in "C:\Program Files\Csound_x64\bin".
>> >
>> > You can verify that this path is referenced in your PATH environment
>> > variable with this command:
>> >
>> >   echo %PATH%
>> >
>> > If this is not the case, you'll have to add this path to your PATH
>> > environment variable or to the system PATH environment variable.
>> >
>> > François
>> >
>> > 2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg
>> > :
>> >>
>> >> Thanks,
>> >> this was left cold for a while, but now I'm back on track.
>> >>
>> >> I get
>> >>
>> >> >>> import ctcsound
>> >> Traceback (most recent call last):
>> >>   File "", line 1, in 
>> >>   File "ctcsound.py", line 2411, in 
>> >>     libcspt = cdll.csnd6
>> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 435, in __getattr__
>> >>     dll = self._dlltype(name)
>> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>> >>     self._handle = _dlopen(self._name, mode)
>> >> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>> >>
>> >> ... which I assume also relates to line 30 of ctcsound.py
>> >> elif sys.platform.startswith('win'):
>> >>     libcsound = cdll.csound64
>> >>
>> >> I understand (guess) that cdll is probably the ctypes dll, but where
>> >> can I set it up so that it finds csound64?
>> >>
>> >> best
>> >> Oeyvind
>> >>
>> >> 2016-10-15 3:04 GMT-07:00 Francois PINOT :
>> >> > I just pushed to my github repo an example showing how to use
>> >> > ctcsound
>> >> > from
>> >> > the py- opcodes within a running instance of Csound:
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>> >> >
>> >> > Notice that actually Python2 is used by default due the hardcoded
>> >> > choice
>> >> > of
>> >> > Python when building Csound.
>> >> >
>> >> > François
>> >> >
>> >> > 2016-10-14 15:23 GMT+02:00 Victor Lazzarini
>> >> > :
>> >> >>
>> >> >> We might need a csoundGetInstance() function or similar in ctcsound
>> >> >> so
>> >> >> that the
>> >> >> opcodes can communicate with the running Csound.
>> >> >>
>> >> >> http://csound.github.io/docs/manual/pyinit.html
>> >> >>
>> >> >> > On 14 Oct 2016, at 13:56, Francois PINOT 
>> >> >> > wrote:
>> >> >> >
>> >> >> > pyruni "import ctcsound" in global part?
>> >> >> >
>> >> >> > François
>> >> >> >
>> >> >> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>> >> >> > :
>> >> >> > Yes, but how to I tell Csound (the py opcodes within Csound) to
>> >> >> > use
>> >> >> > ctcsound ?
>> >> >> >
>> >> >> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini
>> >> >> > :
>> >> >> > > You can just install numpy.
>> >> >> > >
>> >> >> > > Victor Lazzarini
>> >> >> > > Dean of Arts, Celtic Studies, and Philosophy
>> >> >> > > Maynooth University
>> >> >> > > Ireland
>> >> >> > >
>> >> >> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>> >> >> > >>  wrote:
>> >> >> > >>
>> >> >> > >> Ah, now I remember, I tried this earlier and did not complete
>> >> >> > >> installing Anaconda, as it seemed like it could interfere with
>> >> >> > >> other
>> >> >> > >> system variables so I backed out.
>> >> >> > >> Is there a way for me to configure the environment without
>> >> >> > >> installing
>> >> >> > >> Anaconda? I'm in the middle of several productions, so I am
>> >> >> > >> hesitant
>> >> >> > >> to let an installer make automatic changes to my system.
>> >> >> > >>
>> >> >> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT :
>> >> >> > >>> Only numpy is mandatory.
>> >> >> > >>>
>> >> >> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You
>> >> >> > >>> need
>> >> >> > >>> an
>> >> >> > >>> environment set properly for each version of Python you will
>> >> >> > >>> use.
>> >> >> > >>> Anaconda
>> >> >> > >>> facilitates this, and it provides a lot of modules for
>> >> >> > >>> scientific
>> >> >> > >>> computing.
>> >> >> > >>> Jupyter is a plus allowing you to use Csound within notebooks.
>> >> >> > >>>
>> >> >> > >>> François
>> >> >> > >>>
>> >> >> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>> >> >> > >>> :
>> >> >> > >>>>
>> >> >> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just
>> >> >> > >>>> followed
>> >> >> > >>>> the
>> >> >> > >>>> info on the list with interest, waiting to dive in.
>> >> >> > >>>> Is there some instructions on how to migrate somewhere? Do I
>> >> >> > >>>> need
>> >> >> > >>>> to
>> >> >> > >>>> install Anaconda and Jupyter, or can I just replace some
>> >> >> > >>>> modules
>> >> >> > >>>> ?
>> >> >> > >>>>
>> >> >> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>> >> >> > >>>> :
>> >> >> > >>>>> It is possible to read a Csound ftable via the API.
>> >> >> > >>>>>
>> >> >> > >>>>> I'd also suggest migrating to ctcsound if you
>> >> >> > >>>>> are using csnd6. It's excellent.
>> >> >> > >>>>>
>> >> >> > >>>>> Victor Lazzarini
>> >> >> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>> >> >> > >>>>> Maynooth University
>> >> >> > >>>>> Ireland
>> >> >> > >>>>>
>> >> >> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi 
>> >> >> > >>>>> wrote:
>> >> >> > >>>>>
>> >> >> > >>>>> Yes I think that was what I was thinking of, but I'm unsure
>> >> >> > >>>>> whether it
>> >> >> > >>>>> is
>> >> >> > >>>>> supported now or not.
>> >> >> > >>>>>
>> >> >> > >>>>>
>> >> >> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>> >> >> > >>>>> 
>> >> >> > >>>>> wrote:
>> >> >> > >>>>>>
>> >> >> > >>>>>> Hi all,
>> >> >> > >>>>>> thanks for the suggestions.
>> >> >> > >>>>>> If I can read from a csound table directly in python code,
>> >> >> > >>>>>> that
>> >> >> > >>>>>> would
>> >> >> > >>>>>> be the best. Steven, do you mean this document
>> >> >> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> >> >> > >>>>>> There were several things in there that I did not know
>> >> >> > >>>>>> about,
>> >> >> > >>>>>> is
>> >> >> > >>>>>> the
>> >> >> > >>>>>> csound module as described there currently supported?
>> >> >> > >>>>>>
>> >> >> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi :
>> >> >> > >>>>>>> Have you tried ftables? I.e. Filling the table in Csound,
>> >> >> > >>>>>>> then
>> >> >> > >>>>>>> reading
>> >> >> > >>>>>>> from
>> >> >> > >>>>>>> the table in the python code. I seem to remember the
>> >> >> > >>>>>>> python
>> >> >> > >>>>>>> opcodes
>> >> >> > >>>>>>> having
>> >> >> > >>>>>>> access to ftables and that there was example code for
>> >> >> > >>>>>>> this.
>> >> >> > >>>>>>>
>> >> >> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> >> >> > >>>>>>>  wrote:
>> >> >> > >>>>>>>>
>> >> >> > >>>>>>>> Not sure, but would --realtime switch on command line
>> >> >> > >>>>>>>> help?
>> >> >> > >>>>>>>> I
>> >> >> > >>>>>>>> don't
>> >> >> > >>>>>>>> know
>> >> >> > >>>>>>>> if that puts python to other thread from audio work...
>> >> >> > >>>>>>>>
>> >> >> > >>>>>>>>
>> >> >> > >>>>>>>> Tarmo
>> >> >> > >>>>>>>>
>> >> >> > >>>>>>>>
>> >> >> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> >> >> > >>>>>>>> :
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> Hi,
>> >> >> > >>>>>>>>> I need to transfer the contents of an array from Csound
>> >> >> > >>>>>>>>> to
>> >> >> > >>>>>>>>> Python,
>> >> >> > >>>>>>>>> as
>> >> >> > >>>>>>>>> I want to do some peak picking and other analysis that
>> >> >> > >>>>>>>>> is
>> >> >> > >>>>>>>>> easier to
>> >> >> > >>>>>>>>> get done in Python. The problem is that my (admittedly
>> >> >> > >>>>>>>>> ad
>> >> >> > >>>>>>>>> hoc)
>> >> >> > >>>>>>>>> method
>> >> >> > >>>>>>>>> of transferring the values from Csound to Python incurs
>> >> >> > >>>>>>>>> significant
>> >> >> > >>>>>>>>> performance degradation (more details on how I measure
>> >> >> > >>>>>>>>> this
>> >> >> > >>>>>>>>> later
>> >> >> > >>>>>>>>> in
>> >> >> > >>>>>>>>> this email).
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> The basic premise is that I need Csound to be the main
>> >> >> > >>>>>>>>> program
>> >> >> > >>>>>>>>> (the
>> >> >> > >>>>>>>>> host), and Python runs via the py opcodes.
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to be
>> >> >> > >>>>>>>>> done
>> >> >> > >>>>>>>>> once
>> >> >> > >>>>>>>>> every 1 second, for 3 of these arrays. One should think
>> >> >> > >>>>>>>>> the
>> >> >> > >>>>>>>>> bandwidth
>> >> >> > >>>>>>>>> requirement are not too taxing on any system, but since
>> >> >> > >>>>>>>>> I
>> >> >> > >>>>>>>>> only
>> >> >> > >>>>>>>>> send
>> >> >> > >>>>>>>>> single values, there are more than 700 pycalls happening
>> >> >> > >>>>>>>>> in
>> >> >> > >>>>>>>>> one
>> >> >> > >>>>>>>>> k-rate
>> >> >> > >>>>>>>>> pass.
>> >> >> > >>>>>>>>> The python function "p.fill_array" does nothing but put
>> >> >> > >>>>>>>>> the
>> >> >> > >>>>>>>>> received
>> >> >> > >>>>>>>>> values one by one into a numpy array.
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>>  kcnt_fill = 0
>> >> >> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>> >> >> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill,
>> >> >> > >>>>>>>>> ifftsize/2
>> >> >> > >>>>>>>>>    kcnt_fill += 1
>> >> >> > >>>>>>>>>  od
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> By performance degradation I mean that the operation
>> >> >> > >>>>>>>>> seems
>> >> >> > >>>>>>>>> to
>> >> >> > >>>>>>>>> let
>> >> >> > >>>>>>>>> the
>> >> >> > >>>>>>>>> different processes to wait for each other a lot,
>> >> >> > >>>>>>>>> utlimately
>> >> >> > >>>>>>>>> leading
>> >> >> > >>>>>>>>> to dropouts in realtime audio. This does not show up as
>> >> >> > >>>>>>>>> CPU
>> >> >> > >>>>>>>>> spikes
>> >> >> > >>>>>>>>> (running at around 50%), but shows in Reaper's
>> >> >> > >>>>>>>>> performence
>> >> >> > >>>>>>>>> meter as
>> >> >> > >>>>>>>>> "RT longest-block". This meter shows the number of
>> >> >> > >>>>>>>>> milliseconds
>> >> >> > >>>>>>>>> used/available per audio processing block. The *used*
>> >> >> > >>>>>>>>> must
>> >> >> > >>>>>>>>> generally
>> >> >> > >>>>>>>>> be less than the *available* time to avoid dropouts.
>> >> >> > >>>>>>>>> Some
>> >> >> > >>>>>>>>> spikes
>> >> >> > >>>>>>>>> are
>> >> >> > >>>>>>>>> not necessarily bad, but in my case the *used* is
>> >> >> > >>>>>>>>> generally
>> >> >> > >>>>>>>>> quite
>> >> >> > >>>>>>>>> stable and higher than the *available*, unless I comment
>> >> >> > >>>>>>>>> out
>> >> >> > >>>>>>>>> the
>> >> >> > >>>>>>>>> code
>> >> >> > >>>>>>>>> excerpt given above.
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> Is there any way I can send an array from Csound to
>> >> >> > >>>>>>>>> Python
>> >> >> > >>>>>>>>> in
>> >> >> > >>>>>>>>> one
>> >> >> > >>>>>>>>> go?
>> >> >> > >>>>>>>>> I seem to remember some black magic about letting Python
>> >> >> > >>>>>>>>> running
>> >> >> > >>>>>>>>> under
>> >> >> > >>>>>>>>> Csound get access to the (host) csound instance and thus
>> >> >> > >>>>>>>>> accessing
>> >> >> > >>>>>>>>> the
>> >> >> > >>>>>>>>> Csound API. Would that be the best way to do it, and
>> >> >> > >>>>>>>>> would
>> >> >> > >>>>>>>>> it
>> >> >> > >>>>>>>>> be
>> >> >> > >>>>>>>>> considered a safe way of doing it?
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> best
>> >> >> > >>>>>>>>> Oeyvind
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> --
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> Oeyvind Brandtsegg
>> >> >> > >>>>>>>>> Professor of Music Technology
>> >> >> > >>>>>>>>> NTNU
>> >> >> > >>>>>>>>> 7491 Trondheim
>> >> >> > >>>>>>>>> Norway
>> >> >> > >>>>>>>>> Cell: +47 92 203 205
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> http://www.partikkelaudio.com/
>> >> >> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>> >> >> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>> >> >> > >>>>>>>>> http://soundcloud.com/brandtsegg
>> >> >> > >>>>>>>>> http://flyndresang.no/
>> >> >> > >>>>>>>>> http://soundcloud.com/t-emp
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> 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
>> >> >> > >>>>>>
>> >> >> > >>>>>>
>> >> >> > >>>>>>
>> >> >> > >>>>>> --
>> >> >> > >>>>>>
>> >> >> > >>>>>> Oeyvind Brandtsegg
>> >> >> > >>>>>> Professor of Music Technology
>> >> >> > >>>>>> NTNU
>> >> >> > >>>>>> 7491 Trondheim
>> >> >> > >>>>>> Norway
>> >> >> > >>>>>> Cell: +47 92 203 205
>> >> >> > >>>>>>
>> >> >> > >>>>>> http://www.partikkelaudio.com/
>> >> >> > >>>>>> http://crossadaptive.hf.ntnu.no
>> >> >> > >>>>>> http://gdsp.hf.ntnu.no/
>> >> >> > >>>>>> http://soundcloud.com/brandtsegg
>> >> >> > >>>>>> http://flyndresang.no/
>> >> >> > >>>>>> http://soundcloud.com/t-emp
>> >> >> > >>>>>>
>> >> >> > >>>>>> 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
>> >> >> > >>>>
>> >> >> > >>>>
>> >> >> > >>>>
>> >> >> > >>>> --
>> >> >> > >>>>
>> >> >> > >>>> Oeyvind Brandtsegg
>> >> >> > >>>> Professor of Music Technology
>> >> >> > >>>> NTNU
>> >> >> > >>>> 7491 Trondheim
>> >> >> > >>>> Norway
>> >> >> > >>>> Cell: +47 92 203 205
>> >> >> > >>>>
>> >> >> > >>>> http://www.partikkelaudio.com/
>> >> >> > >>>> http://crossadaptive.hf.ntnu.no
>> >> >> > >>>> http://gdsp.hf.ntnu.no/
>> >> >> > >>>> http://soundcloud.com/brandtsegg
>> >> >> > >>>> http://flyndresang.no/
>> >> >> > >>>> http://soundcloud.com/t-emp
>> >> >> > >>>>
>> >> >> > >>>> 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
>> >> >> > >>
>> >> >> > >>
>> >> >> > >>
>> >> >> > >> --
>> >> >> > >>
>> >> >> > >> Oeyvind Brandtsegg
>> >> >> > >> Professor of Music Technology
>> >> >> > >> NTNU
>> >> >> > >> 7491 Trondheim
>> >> >> > >> Norway
>> >> >> > >> Cell: +47 92 203 205
>> >> >> > >>
>> >> >> > >> http://www.partikkelaudio.com/
>> >> >> > >> http://crossadaptive.hf.ntnu.no
>> >> >> > >> http://gdsp.hf.ntnu.no/
>> >> >> > >> http://soundcloud.com/brandtsegg
>> >> >> > >> http://flyndresang.no/
>> >> >> > >> http://soundcloud.com/t-emp
>> >> >> > >>
>> >> >> > >> 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
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> >
>> >> >> > Oeyvind Brandtsegg
>> >> >> > Professor of Music Technology
>> >> >> > NTNU
>> >> >> > 7491 Trondheim
>> >> >> > Norway
>> >> >> > Cell: +47 92 203 205
>> >> >> >
>> >> >> > http://www.partikkelaudio.com/
>> >> >> > http://crossadaptive.hf.ntnu.no
>> >> >> > http://gdsp.hf.ntnu.no/
>> >> >> > http://soundcloud.com/brandtsegg
>> >> >> > http://flyndresang.no/
>> >> >> > http://soundcloud.com/t-emp
>> >> >> >
>> >> >> > 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
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Oeyvind Brandtsegg
>> >> Professor of Music Technology
>> >> NTNU
>> >> 7491 Trondheim
>> >> Norway
>> >> Cell: +47 92 203 205
>> >>
>> >> http://www.partikkelaudio.com/
>> >> http://crossadaptive.hf.ntnu.no
>> >> http://gdsp.hf.ntnu.no/
>> >> http://soundcloud.com/brandtsegg
>> >> http://flyndresang.no/
>> >> http://soundcloud.com/t-emp
>> >>
>> >> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-11-07 19:08
FromFrancois PINOT
SubjectRe: Optimization tip wanted for Csound/Python
I think this is due to small floating point differences in the order of 1e-04. The test for equality is not appropriate here. You should consider that ctcsound is working on your system.

François

2016-11-07 19:50 GMT+01:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
Yes, I downloaded the full repo as a zip.


2016-11-07 10:27 GMT-08:00 Francois PINOT <fggpinot@gmail.com>:
> Is the file "bufferInOut.csd" present in the directory you ran
> test_ctcsound.py from?
>
> François
>
> 2016-11-07 19:20 GMT+01:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
>>
>> Ok. It is in my path,
>> but now I realize that this was not the culprit,
>> ...my bad. I had not copied in csnd.dll from my build dir.
>>
>> Now I get test_ctcsound.py to this stage:
>> (...snip)
>> writing 4096 sample blks of 64-bit floats to dac
>> SECTION 1:
>> F
>> ======================================================================
>> FAIL: test_inputOutputbuffer (__main__.TestGeneralIO)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>   File "test_ctcsound.py", line 78, in test_inputOutputbuffer
>>     self.assertTrue(np.array_equal(obuf, ibuf/3.0))
>> AssertionError: False is not true
>>
>> ----------------------------------------------------------------------
>> Ran 6 tests in 8.216s
>>
>> FAILED (failures=1)
>>
>>
>>
>>
>> 2016-11-06 3:21 GMT-08:00 Francois PINOT <fggpinot@gmail.com>:
>> > csound64.dll should be accessible through your PATH. Normally it is
>> > located
>> > in "C:\Program Files\Csound_x64\bin".
>> >
>> > You can verify that this path is referenced in your PATH environment
>> > variable with this command:
>> >
>> >   echo %PATH%
>> >
>> > If this is not the case, you'll have to add this path to your PATH
>> > environment variable or to the system PATH environment variable.
>> >
>> > François
>> >
>> > 2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg
>> > <oyvind.brandtsegg@ntnu.no>:
>> >>
>> >> Thanks,
>> >> this was left cold for a while, but now I'm back on track.
>> >>
>> >> I get
>> >>
>> >> >>> import ctcsound
>> >> Traceback (most recent call last):
>> >>   File "<stdin>", line 1, in <module>
>> >>   File "ctcsound.py", line 2411, in <module>
>> >>     libcspt = cdll.csnd6
>> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 435, in __getattr__
>> >>     dll = self._dlltype(name)
>> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>> >>     self._handle = _dlopen(self._name, mode)
>> >> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>> >>
>> >> ... which I assume also relates to line 30 of ctcsound.py
>> >> elif sys.platform.startswith('win'):
>> >>     libcsound = cdll.csound64
>> >>
>> >> I understand (guess) that cdll is probably the ctypes dll, but where
>> >> can I set it up so that it finds csound64?
>> >>
>> >> best
>> >> Oeyvind
>> >>
>> >> 2016-10-15 3:04 GMT-07:00 Francois PINOT <fggpinot@gmail.com>:
>> >> > I just pushed to my github repo an example showing how to use
>> >> > ctcsound
>> >> > from
>> >> > the py- opcodes within a running instance of Csound:
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>> >> >
>> >> > Notice that actually Python2 is used by default due the hardcoded
>> >> > choice
>> >> > of
>> >> > Python when building Csound.
>> >> >
>> >> > François
>> >> >
>> >> > 2016-10-14 15:23 GMT+02:00 Victor Lazzarini
>> >> > <Victor.Lazzarini@nuim.ie>:
>> >> >>
>> >> >> We might need a csoundGetInstance() function or similar in ctcsound
>> >> >> so
>> >> >> that the
>> >> >> opcodes can communicate with the running Csound.
>> >> >>
>> >> >> http://csound.github.io/docs/manual/pyinit.html
>> >> >>
>> >> >> > On 14 Oct 2016, at 13:56, Francois PINOT <fggpinot@gmail.com>
>> >> >> > wrote:
>> >> >> >
>> >> >> > pyruni "import ctcsound" in global part?
>> >> >> >
>> >> >> > François
>> >> >> >
>> >> >> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>> >> >> > <oyvind.brandtsegg@ntnu.no>:
>> >> >> > Yes, but how to I tell Csound (the py opcodes within Csound) to
>> >> >> > use
>> >> >> > ctcsound ?
>> >> >> >
>> >> >> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini
>> >> >> > <Victor.Lazzarini@nuim.ie>:
>> >> >> > > You can just install numpy.
>> >> >> > >
>> >> >> > > Victor Lazzarini
>> >> >> > > Dean of Arts, Celtic Studies, and Philosophy
>> >> >> > > Maynooth University
>> >> >> > > Ireland
>> >> >> > >
>> >> >> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>> >> >> > >> <oyvind.brandtsegg@NTNU.NO> wrote:
>> >> >> > >>
>> >> >> > >> Ah, now I remember, I tried this earlier and did not complete
>> >> >> > >> installing Anaconda, as it seemed like it could interfere with
>> >> >> > >> other
>> >> >> > >> system variables so I backed out.
>> >> >> > >> Is there a way for me to configure the environment without
>> >> >> > >> installing
>> >> >> > >> Anaconda? I'm in the middle of several productions, so I am
>> >> >> > >> hesitant
>> >> >> > >> to let an installer make automatic changes to my system.
>> >> >> > >>
>> >> >> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT <fggpinot@gmail.com>:
>> >> >> > >>> Only numpy is mandatory.
>> >> >> > >>>
>> >> >> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You
>> >> >> > >>> need
>> >> >> > >>> an
>> >> >> > >>> environment set properly for each version of Python you will
>> >> >> > >>> use.
>> >> >> > >>> Anaconda
>> >> >> > >>> facilitates this, and it provides a lot of modules for
>> >> >> > >>> scientific
>> >> >> > >>> computing.
>> >> >> > >>> Jupyter is a plus allowing you to use Csound within notebooks.
>> >> >> > >>>
>> >> >> > >>> François
>> >> >> > >>>
>> >> >> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>> >> >> > >>> <oyvind.brandtsegg@ntnu.no>:
>> >> >> > >>>>
>> >> >> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just
>> >> >> > >>>> followed
>> >> >> > >>>> the
>> >> >> > >>>> info on the list with interest, waiting to dive in.
>> >> >> > >>>> Is there some instructions on how to migrate somewhere? Do I
>> >> >> > >>>> need
>> >> >> > >>>> to
>> >> >> > >>>> install Anaconda and Jupyter, or can I just replace some
>> >> >> > >>>> modules
>> >> >> > >>>> ?
>> >> >> > >>>>
>> >> >> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>> >> >> > >>>> <Victor.Lazzarini@nuim.ie>:
>> >> >> > >>>>> It is possible to read a Csound ftable via the API.
>> >> >> > >>>>>
>> >> >> > >>>>> I'd also suggest migrating to ctcsound if you
>> >> >> > >>>>> are using csnd6. It's excellent.
>> >> >> > >>>>>
>> >> >> > >>>>> Victor Lazzarini
>> >> >> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>> >> >> > >>>>> Maynooth University
>> >> >> > >>>>> Ireland
>> >> >> > >>>>>
>> >> >> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi <stevenyi@GMAIL.COM>
>> >> >> > >>>>> wrote:
>> >> >> > >>>>>
>> >> >> > >>>>> Yes I think that was what I was thinking of, but I'm unsure
>> >> >> > >>>>> whether it
>> >> >> > >>>>> is
>> >> >> > >>>>> supported now or not.
>> >> >> > >>>>>
>> >> >> > >>>>>
>> >> >> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>> >> >> > >>>>> <oyvind.brandtsegg@ntnu.no>
>> >> >> > >>>>> wrote:
>> >> >> > >>>>>>
>> >> >> > >>>>>> Hi all,
>> >> >> > >>>>>> thanks for the suggestions.
>> >> >> > >>>>>> If I can read from a csound table directly in python code,
>> >> >> > >>>>>> that
>> >> >> > >>>>>> would
>> >> >> > >>>>>> be the best. Steven, do you mean this document
>> >> >> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> >> >> > >>>>>> There were several things in there that I did not know
>> >> >> > >>>>>> about,
>> >> >> > >>>>>> is
>> >> >> > >>>>>> the
>> >> >> > >>>>>> csound module as described there currently supported?
>> >> >> > >>>>>>
>> >> >> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi <stevenyi@gmail.com>:
>> >> >> > >>>>>>> Have you tried ftables? I.e. Filling the table in Csound,
>> >> >> > >>>>>>> then
>> >> >> > >>>>>>> reading
>> >> >> > >>>>>>> from
>> >> >> > >>>>>>> the table in the python code. I seem to remember the
>> >> >> > >>>>>>> python
>> >> >> > >>>>>>> opcodes
>> >> >> > >>>>>>> having
>> >> >> > >>>>>>> access to ftables and that there was example code for
>> >> >> > >>>>>>> this.
>> >> >> > >>>>>>>
>> >> >> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> >> >> > >>>>>>> <tarmo.johannes@otsakool.edu.ee> wrote:
>> >> >> > >>>>>>>>
>> >> >> > >>>>>>>> Not sure, but would --realtime switch on command line
>> >> >> > >>>>>>>> help?
>> >> >> > >>>>>>>> I
>> >> >> > >>>>>>>> don't
>> >> >> > >>>>>>>> know
>> >> >> > >>>>>>>> if that puts python to other thread from audio work...
>> >> >> > >>>>>>>>
>> >> >> > >>>>>>>>
>> >> >> > >>>>>>>> Tarmo
>> >> >> > >>>>>>>>
>> >> >> > >>>>>>>>
>> >> >> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind Brandtsegg"
>> >> >> > >>>>>>>> <oyvind.brandtsegg@ntnu.no>:
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> Hi,
>> >> >> > >>>>>>>>> I need to transfer the contents of an array from Csound
>> >> >> > >>>>>>>>> to
>> >> >> > >>>>>>>>> Python,
>> >> >> > >>>>>>>>> as
>> >> >> > >>>>>>>>> I want to do some peak picking and other analysis that
>> >> >> > >>>>>>>>> is
>> >> >> > >>>>>>>>> easier to
>> >> >> > >>>>>>>>> get done in Python. The problem is that my (admittedly
>> >> >> > >>>>>>>>> ad
>> >> >> > >>>>>>>>> hoc)
>> >> >> > >>>>>>>>> method
>> >> >> > >>>>>>>>> of transferring the values from Csound to Python incurs
>> >> >> > >>>>>>>>> significant
>> >> >> > >>>>>>>>> performance degradation (more details on how I measure
>> >> >> > >>>>>>>>> this
>> >> >> > >>>>>>>>> later
>> >> >> > >>>>>>>>> in
>> >> >> > >>>>>>>>> this email).
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> The basic premise is that I need Csound to be the main
>> >> >> > >>>>>>>>> program
>> >> >> > >>>>>>>>> (the
>> >> >> > >>>>>>>>> host), and Python runs via the py opcodes.
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to be
>> >> >> > >>>>>>>>> done
>> >> >> > >>>>>>>>> once
>> >> >> > >>>>>>>>> every 1 second, for 3 of these arrays. One should think
>> >> >> > >>>>>>>>> the
>> >> >> > >>>>>>>>> bandwidth
>> >> >> > >>>>>>>>> requirement are not too taxing on any system, but since
>> >> >> > >>>>>>>>> I
>> >> >> > >>>>>>>>> only
>> >> >> > >>>>>>>>> send
>> >> >> > >>>>>>>>> single values, there are more than 700 pycalls happening
>> >> >> > >>>>>>>>> in
>> >> >> > >>>>>>>>> one
>> >> >> > >>>>>>>>> k-rate
>> >> >> > >>>>>>>>> pass.
>> >> >> > >>>>>>>>> The python function "p.fill_array" does nothing but put
>> >> >> > >>>>>>>>> the
>> >> >> > >>>>>>>>> received
>> >> >> > >>>>>>>>> values one by one into a numpy array.
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>>  kcnt_fill = 0
>> >> >> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>> >> >> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill], kcnt_fill,
>> >> >> > >>>>>>>>> ifftsize/2
>> >> >> > >>>>>>>>>    kcnt_fill += 1
>> >> >> > >>>>>>>>>  od
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> By performance degradation I mean that the operation
>> >> >> > >>>>>>>>> seems
>> >> >> > >>>>>>>>> to
>> >> >> > >>>>>>>>> let
>> >> >> > >>>>>>>>> the
>> >> >> > >>>>>>>>> different processes to wait for each other a lot,
>> >> >> > >>>>>>>>> utlimately
>> >> >> > >>>>>>>>> leading
>> >> >> > >>>>>>>>> to dropouts in realtime audio. This does not show up as
>> >> >> > >>>>>>>>> CPU
>> >> >> > >>>>>>>>> spikes
>> >> >> > >>>>>>>>> (running at around 50%), but shows in Reaper's
>> >> >> > >>>>>>>>> performence
>> >> >> > >>>>>>>>> meter as
>> >> >> > >>>>>>>>> "RT longest-block". This meter shows the number of
>> >> >> > >>>>>>>>> milliseconds
>> >> >> > >>>>>>>>> used/available per audio processing block. The *used*
>> >> >> > >>>>>>>>> must
>> >> >> > >>>>>>>>> generally
>> >> >> > >>>>>>>>> be less than the *available* time to avoid dropouts.
>> >> >> > >>>>>>>>> Some
>> >> >> > >>>>>>>>> spikes
>> >> >> > >>>>>>>>> are
>> >> >> > >>>>>>>>> not necessarily bad, but in my case the *used* is
>> >> >> > >>>>>>>>> generally
>> >> >> > >>>>>>>>> quite
>> >> >> > >>>>>>>>> stable and higher than the *available*, unless I comment
>> >> >> > >>>>>>>>> out
>> >> >> > >>>>>>>>> the
>> >> >> > >>>>>>>>> code
>> >> >> > >>>>>>>>> excerpt given above.
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> Is there any way I can send an array from Csound to
>> >> >> > >>>>>>>>> Python
>> >> >> > >>>>>>>>> in
>> >> >> > >>>>>>>>> one
>> >> >> > >>>>>>>>> go?
>> >> >> > >>>>>>>>> I seem to remember some black magic about letting Python
>> >> >> > >>>>>>>>> running
>> >> >> > >>>>>>>>> under
>> >> >> > >>>>>>>>> Csound get access to the (host) csound instance and thus
>> >> >> > >>>>>>>>> accessing
>> >> >> > >>>>>>>>> the
>> >> >> > >>>>>>>>> Csound API. Would that be the best way to do it, and
>> >> >> > >>>>>>>>> would
>> >> >> > >>>>>>>>> it
>> >> >> > >>>>>>>>> be
>> >> >> > >>>>>>>>> considered a safe way of doing it?
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> best
>> >> >> > >>>>>>>>> Oeyvind
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> --
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> Oeyvind Brandtsegg
>> >> >> > >>>>>>>>> Professor of Music Technology
>> >> >> > >>>>>>>>> NTNU
>> >> >> > >>>>>>>>> 7491 Trondheim
>> >> >> > >>>>>>>>> Norway
>> >> >> > >>>>>>>>> Cell: +47 92 203 205
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> http://www.partikkelaudio.com/
>> >> >> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>> >> >> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>> >> >> > >>>>>>>>> http://soundcloud.com/brandtsegg
>> >> >> > >>>>>>>>> http://flyndresang.no/
>> >> >> > >>>>>>>>> http://soundcloud.com/t-emp
>> >> >> > >>>>>>>>>
>> >> >> > >>>>>>>>> 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
>> >> >> > >>>>>>
>> >> >> > >>>>>>
>> >> >> > >>>>>>
>> >> >> > >>>>>> --
>> >> >> > >>>>>>
>> >> >> > >>>>>> Oeyvind Brandtsegg
>> >> >> > >>>>>> Professor of Music Technology
>> >> >> > >>>>>> NTNU
>> >> >> > >>>>>> 7491 Trondheim
>> >> >> > >>>>>> Norway
>> >> >> > >>>>>> Cell: +47 92 203 205
>> >> >> > >>>>>>
>> >> >> > >>>>>> http://www.partikkelaudio.com/
>> >> >> > >>>>>> http://crossadaptive.hf.ntnu.no
>> >> >> > >>>>>> http://gdsp.hf.ntnu.no/
>> >> >> > >>>>>> http://soundcloud.com/brandtsegg
>> >> >> > >>>>>> http://flyndresang.no/
>> >> >> > >>>>>> http://soundcloud.com/t-emp
>> >> >> > >>>>>>
>> >> >> > >>>>>> 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
>> >> >> > >>>>
>> >> >> > >>>>
>> >> >> > >>>>
>> >> >> > >>>> --
>> >> >> > >>>>
>> >> >> > >>>> Oeyvind Brandtsegg
>> >> >> > >>>> Professor of Music Technology
>> >> >> > >>>> NTNU
>> >> >> > >>>> 7491 Trondheim
>> >> >> > >>>> Norway
>> >> >> > >>>> Cell: +47 92 203 205
>> >> >> > >>>>
>> >> >> > >>>> http://www.partikkelaudio.com/
>> >> >> > >>>> http://crossadaptive.hf.ntnu.no
>> >> >> > >>>> http://gdsp.hf.ntnu.no/
>> >> >> > >>>> http://soundcloud.com/brandtsegg
>> >> >> > >>>> http://flyndresang.no/
>> >> >> > >>>> http://soundcloud.com/t-emp
>> >> >> > >>>>
>> >> >> > >>>> 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
>> >> >> > >>
>> >> >> > >>
>> >> >> > >>
>> >> >> > >> --
>> >> >> > >>
>> >> >> > >> Oeyvind Brandtsegg
>> >> >> > >> Professor of Music Technology
>> >> >> > >> NTNU
>> >> >> > >> 7491 Trondheim
>> >> >> > >> Norway
>> >> >> > >> Cell: +47 92 203 205
>> >> >> > >>
>> >> >> > >> http://www.partikkelaudio.com/
>> >> >> > >> http://crossadaptive.hf.ntnu.no
>> >> >> > >> http://gdsp.hf.ntnu.no/
>> >> >> > >> http://soundcloud.com/brandtsegg
>> >> >> > >> http://flyndresang.no/
>> >> >> > >> http://soundcloud.com/t-emp
>> >> >> > >>
>> >> >> > >> 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
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> >
>> >> >> > Oeyvind Brandtsegg
>> >> >> > Professor of Music Technology
>> >> >> > NTNU
>> >> >> > 7491 Trondheim
>> >> >> > Norway
>> >> >> > Cell: +47 92 203 205
>> >> >> >
>> >> >> > http://www.partikkelaudio.com/
>> >> >> > http://crossadaptive.hf.ntnu.no
>> >> >> > http://gdsp.hf.ntnu.no/
>> >> >> > http://soundcloud.com/brandtsegg
>> >> >> > http://flyndresang.no/
>> >> >> > http://soundcloud.com/t-emp
>> >> >> >
>> >> >> > 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
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Oeyvind Brandtsegg
>> >> Professor of Music Technology
>> >> NTNU
>> >> 7491 Trondheim
>> >> Norway
>> >> Cell: +47 92 203 205
>> >>
>> >> http://www.partikkelaudio.com/
>> >> http://crossadaptive.hf.ntnu.no
>> >> http://gdsp.hf.ntnu.no/
>> >> http://soundcloud.com/brandtsegg
>> >> http://flyndresang.no/
>> >> http://soundcloud.com/t-emp
>> >>
>> >> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-11-08 17:52
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
Great, thankl you so much for the help.
I'll probably be back with more questions shortly :-)

2016-11-07 11:08 GMT-08:00 Francois PINOT :
> I think this is due to small floating point differences in the order of
> 1e-04. The test for equality is not appropriate here. You should consider
> that ctcsound is working on your system.
>
> François
>
> 2016-11-07 19:50 GMT+01:00 Oeyvind Brandtsegg :
>>
>> Yes, I downloaded the full repo as a zip.
>>
>>
>> 2016-11-07 10:27 GMT-08:00 Francois PINOT :
>> > Is the file "bufferInOut.csd" present in the directory you ran
>> > test_ctcsound.py from?
>> >
>> > François
>> >
>> > 2016-11-07 19:20 GMT+01:00 Oeyvind Brandtsegg
>> > :
>> >>
>> >> Ok. It is in my path,
>> >> but now I realize that this was not the culprit,
>> >> ...my bad. I had not copied in csnd.dll from my build dir.
>> >>
>> >> Now I get test_ctcsound.py to this stage:
>> >> (...snip)
>> >> writing 4096 sample blks of 64-bit floats to dac
>> >> SECTION 1:
>> >> F
>> >> ======================================================================
>> >> FAIL: test_inputOutputbuffer (__main__.TestGeneralIO)
>> >> ----------------------------------------------------------------------
>> >> Traceback (most recent call last):
>> >>   File "test_ctcsound.py", line 78, in test_inputOutputbuffer
>> >>     self.assertTrue(np.array_equal(obuf, ibuf/3.0))
>> >> AssertionError: False is not true
>> >>
>> >> ----------------------------------------------------------------------
>> >> Ran 6 tests in 8.216s
>> >>
>> >> FAILED (failures=1)
>> >>
>> >>
>> >>
>> >>
>> >> 2016-11-06 3:21 GMT-08:00 Francois PINOT :
>> >> > csound64.dll should be accessible through your PATH. Normally it is
>> >> > located
>> >> > in "C:\Program Files\Csound_x64\bin".
>> >> >
>> >> > You can verify that this path is referenced in your PATH environment
>> >> > variable with this command:
>> >> >
>> >> >   echo %PATH%
>> >> >
>> >> > If this is not the case, you'll have to add this path to your PATH
>> >> > environment variable or to the system PATH environment variable.
>> >> >
>> >> > François
>> >> >
>> >> > 2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg
>> >> > :
>> >> >>
>> >> >> Thanks,
>> >> >> this was left cold for a while, but now I'm back on track.
>> >> >>
>> >> >> I get
>> >> >>
>> >> >> >>> import ctcsound
>> >> >> Traceback (most recent call last):
>> >> >>   File "", line 1, in 
>> >> >>   File "ctcsound.py", line 2411, in 
>> >> >>     libcspt = cdll.csnd6
>> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 435, in
>> >> >> __getattr__
>> >> >>     dll = self._dlltype(name)
>> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>> >> >>     self._handle = _dlopen(self._name, mode)
>> >> >> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>> >> >>
>> >> >> ... which I assume also relates to line 30 of ctcsound.py
>> >> >> elif sys.platform.startswith('win'):
>> >> >>     libcsound = cdll.csound64
>> >> >>
>> >> >> I understand (guess) that cdll is probably the ctypes dll, but where
>> >> >> can I set it up so that it finds csound64?
>> >> >>
>> >> >> best
>> >> >> Oeyvind
>> >> >>
>> >> >> 2016-10-15 3:04 GMT-07:00 Francois PINOT :
>> >> >> > I just pushed to my github repo an example showing how to use
>> >> >> > ctcsound
>> >> >> > from
>> >> >> > the py- opcodes within a running instance of Csound:
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>> >> >> >
>> >> >> > Notice that actually Python2 is used by default due the hardcoded
>> >> >> > choice
>> >> >> > of
>> >> >> > Python when building Csound.
>> >> >> >
>> >> >> > François
>> >> >> >
>> >> >> > 2016-10-14 15:23 GMT+02:00 Victor Lazzarini
>> >> >> > :
>> >> >> >>
>> >> >> >> We might need a csoundGetInstance() function or similar in
>> >> >> >> ctcsound
>> >> >> >> so
>> >> >> >> that the
>> >> >> >> opcodes can communicate with the running Csound.
>> >> >> >>
>> >> >> >> http://csound.github.io/docs/manual/pyinit.html
>> >> >> >>
>> >> >> >> > On 14 Oct 2016, at 13:56, Francois PINOT 
>> >> >> >> > wrote:
>> >> >> >> >
>> >> >> >> > pyruni "import ctcsound" in global part?
>> >> >> >> >
>> >> >> >> > François
>> >> >> >> >
>> >> >> >> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>> >> >> >> > :
>> >> >> >> > Yes, but how to I tell Csound (the py opcodes within Csound) to
>> >> >> >> > use
>> >> >> >> > ctcsound ?
>> >> >> >> >
>> >> >> >> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini
>> >> >> >> > :
>> >> >> >> > > You can just install numpy.
>> >> >> >> > >
>> >> >> >> > > Victor Lazzarini
>> >> >> >> > > Dean of Arts, Celtic Studies, and Philosophy
>> >> >> >> > > Maynooth University
>> >> >> >> > > Ireland
>> >> >> >> > >
>> >> >> >> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>> >> >> >> > >>  wrote:
>> >> >> >> > >>
>> >> >> >> > >> Ah, now I remember, I tried this earlier and did not
>> >> >> >> > >> complete
>> >> >> >> > >> installing Anaconda, as it seemed like it could interfere
>> >> >> >> > >> with
>> >> >> >> > >> other
>> >> >> >> > >> system variables so I backed out.
>> >> >> >> > >> Is there a way for me to configure the environment without
>> >> >> >> > >> installing
>> >> >> >> > >> Anaconda? I'm in the middle of several productions, so I am
>> >> >> >> > >> hesitant
>> >> >> >> > >> to let an installer make automatic changes to my system.
>> >> >> >> > >>
>> >> >> >> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT
>> >> >> >> > >> :
>> >> >> >> > >>> Only numpy is mandatory.
>> >> >> >> > >>>
>> >> >> >> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You
>> >> >> >> > >>> need
>> >> >> >> > >>> an
>> >> >> >> > >>> environment set properly for each version of Python you
>> >> >> >> > >>> will
>> >> >> >> > >>> use.
>> >> >> >> > >>> Anaconda
>> >> >> >> > >>> facilitates this, and it provides a lot of modules for
>> >> >> >> > >>> scientific
>> >> >> >> > >>> computing.
>> >> >> >> > >>> Jupyter is a plus allowing you to use Csound within
>> >> >> >> > >>> notebooks.
>> >> >> >> > >>>
>> >> >> >> > >>> François
>> >> >> >> > >>>
>> >> >> >> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>> >> >> >> > >>> :
>> >> >> >> > >>>>
>> >> >> >> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just
>> >> >> >> > >>>> followed
>> >> >> >> > >>>> the
>> >> >> >> > >>>> info on the list with interest, waiting to dive in.
>> >> >> >> > >>>> Is there some instructions on how to migrate somewhere? Do
>> >> >> >> > >>>> I
>> >> >> >> > >>>> need
>> >> >> >> > >>>> to
>> >> >> >> > >>>> install Anaconda and Jupyter, or can I just replace some
>> >> >> >> > >>>> modules
>> >> >> >> > >>>> ?
>> >> >> >> > >>>>
>> >> >> >> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>> >> >> >> > >>>> :
>> >> >> >> > >>>>> It is possible to read a Csound ftable via the API.
>> >> >> >> > >>>>>
>> >> >> >> > >>>>> I'd also suggest migrating to ctcsound if you
>> >> >> >> > >>>>> are using csnd6. It's excellent.
>> >> >> >> > >>>>>
>> >> >> >> > >>>>> Victor Lazzarini
>> >> >> >> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>> >> >> >> > >>>>> Maynooth University
>> >> >> >> > >>>>> Ireland
>> >> >> >> > >>>>>
>> >> >> >> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi 
>> >> >> >> > >>>>> wrote:
>> >> >> >> > >>>>>
>> >> >> >> > >>>>> Yes I think that was what I was thinking of, but I'm
>> >> >> >> > >>>>> unsure
>> >> >> >> > >>>>> whether it
>> >> >> >> > >>>>> is
>> >> >> >> > >>>>> supported now or not.
>> >> >> >> > >>>>>
>> >> >> >> > >>>>>
>> >> >> >> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>> >> >> >> > >>>>> 
>> >> >> >> > >>>>> wrote:
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> Hi all,
>> >> >> >> > >>>>>> thanks for the suggestions.
>> >> >> >> > >>>>>> If I can read from a csound table directly in python
>> >> >> >> > >>>>>> code,
>> >> >> >> > >>>>>> that
>> >> >> >> > >>>>>> would
>> >> >> >> > >>>>>> be the best. Steven, do you mean this document
>> >> >> >> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> >> >> >> > >>>>>> There were several things in there that I did not know
>> >> >> >> > >>>>>> about,
>> >> >> >> > >>>>>> is
>> >> >> >> > >>>>>> the
>> >> >> >> > >>>>>> csound module as described there currently supported?
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi
>> >> >> >> > >>>>>> :
>> >> >> >> > >>>>>>> Have you tried ftables? I.e. Filling the table in
>> >> >> >> > >>>>>>> Csound,
>> >> >> >> > >>>>>>> then
>> >> >> >> > >>>>>>> reading
>> >> >> >> > >>>>>>> from
>> >> >> >> > >>>>>>> the table in the python code. I seem to remember the
>> >> >> >> > >>>>>>> python
>> >> >> >> > >>>>>>> opcodes
>> >> >> >> > >>>>>>> having
>> >> >> >> > >>>>>>> access to ftables and that there was example code for
>> >> >> >> > >>>>>>> this.
>> >> >> >> > >>>>>>>
>> >> >> >> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> >> >> >> > >>>>>>>  wrote:
>> >> >> >> > >>>>>>>>
>> >> >> >> > >>>>>>>> Not sure, but would --realtime switch on command line
>> >> >> >> > >>>>>>>> help?
>> >> >> >> > >>>>>>>> I
>> >> >> >> > >>>>>>>> don't
>> >> >> >> > >>>>>>>> know
>> >> >> >> > >>>>>>>> if that puts python to other thread from audio work...
>> >> >> >> > >>>>>>>>
>> >> >> >> > >>>>>>>>
>> >> >> >> > >>>>>>>> Tarmo
>> >> >> >> > >>>>>>>>
>> >> >> >> > >>>>>>>>
>> >> >> >> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind
>> >> >> >> > >>>>>>>> Brandtsegg"
>> >> >> >> > >>>>>>>> :
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> Hi,
>> >> >> >> > >>>>>>>>> I need to transfer the contents of an array from
>> >> >> >> > >>>>>>>>> Csound
>> >> >> >> > >>>>>>>>> to
>> >> >> >> > >>>>>>>>> Python,
>> >> >> >> > >>>>>>>>> as
>> >> >> >> > >>>>>>>>> I want to do some peak picking and other analysis
>> >> >> >> > >>>>>>>>> that
>> >> >> >> > >>>>>>>>> is
>> >> >> >> > >>>>>>>>> easier to
>> >> >> >> > >>>>>>>>> get done in Python. The problem is that my
>> >> >> >> > >>>>>>>>> (admittedly
>> >> >> >> > >>>>>>>>> ad
>> >> >> >> > >>>>>>>>> hoc)
>> >> >> >> > >>>>>>>>> method
>> >> >> >> > >>>>>>>>> of transferring the values from Csound to Python
>> >> >> >> > >>>>>>>>> incurs
>> >> >> >> > >>>>>>>>> significant
>> >> >> >> > >>>>>>>>> performance degradation (more details on how I
>> >> >> >> > >>>>>>>>> measure
>> >> >> >> > >>>>>>>>> this
>> >> >> >> > >>>>>>>>> later
>> >> >> >> > >>>>>>>>> in
>> >> >> >> > >>>>>>>>> this email).
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> The basic premise is that I need Csound to be the
>> >> >> >> > >>>>>>>>> main
>> >> >> >> > >>>>>>>>> program
>> >> >> >> > >>>>>>>>> (the
>> >> >> >> > >>>>>>>>> host), and Python runs via the py opcodes.
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to
>> >> >> >> > >>>>>>>>> be
>> >> >> >> > >>>>>>>>> done
>> >> >> >> > >>>>>>>>> once
>> >> >> >> > >>>>>>>>> every 1 second, for 3 of these arrays. One should
>> >> >> >> > >>>>>>>>> think
>> >> >> >> > >>>>>>>>> the
>> >> >> >> > >>>>>>>>> bandwidth
>> >> >> >> > >>>>>>>>> requirement are not too taxing on any system, but
>> >> >> >> > >>>>>>>>> since
>> >> >> >> > >>>>>>>>> I
>> >> >> >> > >>>>>>>>> only
>> >> >> >> > >>>>>>>>> send
>> >> >> >> > >>>>>>>>> single values, there are more than 700 pycalls
>> >> >> >> > >>>>>>>>> happening
>> >> >> >> > >>>>>>>>> in
>> >> >> >> > >>>>>>>>> one
>> >> >> >> > >>>>>>>>> k-rate
>> >> >> >> > >>>>>>>>> pass.
>> >> >> >> > >>>>>>>>> The python function "p.fill_array" does nothing but
>> >> >> >> > >>>>>>>>> put
>> >> >> >> > >>>>>>>>> the
>> >> >> >> > >>>>>>>>> received
>> >> >> >> > >>>>>>>>> values one by one into a numpy array.
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>>  kcnt_fill = 0
>> >> >> >> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>> >> >> >> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill],
>> >> >> >> > >>>>>>>>> kcnt_fill,
>> >> >> >> > >>>>>>>>> ifftsize/2
>> >> >> >> > >>>>>>>>>    kcnt_fill += 1
>> >> >> >> > >>>>>>>>>  od
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> By performance degradation I mean that the operation
>> >> >> >> > >>>>>>>>> seems
>> >> >> >> > >>>>>>>>> to
>> >> >> >> > >>>>>>>>> let
>> >> >> >> > >>>>>>>>> the
>> >> >> >> > >>>>>>>>> different processes to wait for each other a lot,
>> >> >> >> > >>>>>>>>> utlimately
>> >> >> >> > >>>>>>>>> leading
>> >> >> >> > >>>>>>>>> to dropouts in realtime audio. This does not show up
>> >> >> >> > >>>>>>>>> as
>> >> >> >> > >>>>>>>>> CPU
>> >> >> >> > >>>>>>>>> spikes
>> >> >> >> > >>>>>>>>> (running at around 50%), but shows in Reaper's
>> >> >> >> > >>>>>>>>> performence
>> >> >> >> > >>>>>>>>> meter as
>> >> >> >> > >>>>>>>>> "RT longest-block". This meter shows the number of
>> >> >> >> > >>>>>>>>> milliseconds
>> >> >> >> > >>>>>>>>> used/available per audio processing block. The *used*
>> >> >> >> > >>>>>>>>> must
>> >> >> >> > >>>>>>>>> generally
>> >> >> >> > >>>>>>>>> be less than the *available* time to avoid dropouts.
>> >> >> >> > >>>>>>>>> Some
>> >> >> >> > >>>>>>>>> spikes
>> >> >> >> > >>>>>>>>> are
>> >> >> >> > >>>>>>>>> not necessarily bad, but in my case the *used* is
>> >> >> >> > >>>>>>>>> generally
>> >> >> >> > >>>>>>>>> quite
>> >> >> >> > >>>>>>>>> stable and higher than the *available*, unless I
>> >> >> >> > >>>>>>>>> comment
>> >> >> >> > >>>>>>>>> out
>> >> >> >> > >>>>>>>>> the
>> >> >> >> > >>>>>>>>> code
>> >> >> >> > >>>>>>>>> excerpt given above.
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> Is there any way I can send an array from Csound to
>> >> >> >> > >>>>>>>>> Python
>> >> >> >> > >>>>>>>>> in
>> >> >> >> > >>>>>>>>> one
>> >> >> >> > >>>>>>>>> go?
>> >> >> >> > >>>>>>>>> I seem to remember some black magic about letting
>> >> >> >> > >>>>>>>>> Python
>> >> >> >> > >>>>>>>>> running
>> >> >> >> > >>>>>>>>> under
>> >> >> >> > >>>>>>>>> Csound get access to the (host) csound instance and
>> >> >> >> > >>>>>>>>> thus
>> >> >> >> > >>>>>>>>> accessing
>> >> >> >> > >>>>>>>>> the
>> >> >> >> > >>>>>>>>> Csound API. Would that be the best way to do it, and
>> >> >> >> > >>>>>>>>> would
>> >> >> >> > >>>>>>>>> it
>> >> >> >> > >>>>>>>>> be
>> >> >> >> > >>>>>>>>> considered a safe way of doing it?
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> best
>> >> >> >> > >>>>>>>>> Oeyvind
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> --
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> Oeyvind Brandtsegg
>> >> >> >> > >>>>>>>>> Professor of Music Technology
>> >> >> >> > >>>>>>>>> NTNU
>> >> >> >> > >>>>>>>>> 7491 Trondheim
>> >> >> >> > >>>>>>>>> Norway
>> >> >> >> > >>>>>>>>> Cell: +47 92 203 205
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> http://www.partikkelaudio.com/
>> >> >> >> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>> >> >> >> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>> >> >> >> > >>>>>>>>> http://soundcloud.com/brandtsegg
>> >> >> >> > >>>>>>>>> http://flyndresang.no/
>> >> >> >> > >>>>>>>>> http://soundcloud.com/t-emp
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> 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
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> --
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> Oeyvind Brandtsegg
>> >> >> >> > >>>>>> Professor of Music Technology
>> >> >> >> > >>>>>> NTNU
>> >> >> >> > >>>>>> 7491 Trondheim
>> >> >> >> > >>>>>> Norway
>> >> >> >> > >>>>>> Cell: +47 92 203 205
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> http://www.partikkelaudio.com/
>> >> >> >> > >>>>>> http://crossadaptive.hf.ntnu.no
>> >> >> >> > >>>>>> http://gdsp.hf.ntnu.no/
>> >> >> >> > >>>>>> http://soundcloud.com/brandtsegg
>> >> >> >> > >>>>>> http://flyndresang.no/
>> >> >> >> > >>>>>> http://soundcloud.com/t-emp
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> 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
>> >> >> >> > >>>>
>> >> >> >> > >>>>
>> >> >> >> > >>>>
>> >> >> >> > >>>> --
>> >> >> >> > >>>>
>> >> >> >> > >>>> Oeyvind Brandtsegg
>> >> >> >> > >>>> Professor of Music Technology
>> >> >> >> > >>>> NTNU
>> >> >> >> > >>>> 7491 Trondheim
>> >> >> >> > >>>> Norway
>> >> >> >> > >>>> Cell: +47 92 203 205
>> >> >> >> > >>>>
>> >> >> >> > >>>> http://www.partikkelaudio.com/
>> >> >> >> > >>>> http://crossadaptive.hf.ntnu.no
>> >> >> >> > >>>> http://gdsp.hf.ntnu.no/
>> >> >> >> > >>>> http://soundcloud.com/brandtsegg
>> >> >> >> > >>>> http://flyndresang.no/
>> >> >> >> > >>>> http://soundcloud.com/t-emp
>> >> >> >> > >>>>
>> >> >> >> > >>>> 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
>> >> >> >> > >>
>> >> >> >> > >>
>> >> >> >> > >>
>> >> >> >> > >> --
>> >> >> >> > >>
>> >> >> >> > >> Oeyvind Brandtsegg
>> >> >> >> > >> Professor of Music Technology
>> >> >> >> > >> NTNU
>> >> >> >> > >> 7491 Trondheim
>> >> >> >> > >> Norway
>> >> >> >> > >> Cell: +47 92 203 205
>> >> >> >> > >>
>> >> >> >> > >> http://www.partikkelaudio.com/
>> >> >> >> > >> http://crossadaptive.hf.ntnu.no
>> >> >> >> > >> http://gdsp.hf.ntnu.no/
>> >> >> >> > >> http://soundcloud.com/brandtsegg
>> >> >> >> > >> http://flyndresang.no/
>> >> >> >> > >> http://soundcloud.com/t-emp
>> >> >> >> > >>
>> >> >> >> > >> 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
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> >
>> >> >> >> > Oeyvind Brandtsegg
>> >> >> >> > Professor of Music Technology
>> >> >> >> > NTNU
>> >> >> >> > 7491 Trondheim
>> >> >> >> > Norway
>> >> >> >> > Cell: +47 92 203 205
>> >> >> >> >
>> >> >> >> > http://www.partikkelaudio.com/
>> >> >> >> > http://crossadaptive.hf.ntnu.no
>> >> >> >> > http://gdsp.hf.ntnu.no/
>> >> >> >> > http://soundcloud.com/brandtsegg
>> >> >> >> > http://flyndresang.no/
>> >> >> >> > http://soundcloud.com/t-emp
>> >> >> >> >
>> >> >> >> > 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
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >>
>> >> >> Oeyvind Brandtsegg
>> >> >> Professor of Music Technology
>> >> >> NTNU
>> >> >> 7491 Trondheim
>> >> >> Norway
>> >> >> Cell: +47 92 203 205
>> >> >>
>> >> >> http://www.partikkelaudio.com/
>> >> >> http://crossadaptive.hf.ntnu.no
>> >> >> http://gdsp.hf.ntnu.no/
>> >> >> http://soundcloud.com/brandtsegg
>> >> >> http://flyndresang.no/
>> >> >> http://soundcloud.com/t-emp
>> >> >>
>> >> >> 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
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Oeyvind Brandtsegg
>> >> Professor of Music Technology
>> >> NTNU
>> >> 7491 Trondheim
>> >> Norway
>> >> Cell: +47 92 203 205
>> >>
>> >> http://www.partikkelaudio.com/
>> >> http://crossadaptive.hf.ntnu.no
>> >> http://gdsp.hf.ntnu.no/
>> >> http://soundcloud.com/brandtsegg
>> >> http://flyndresang.no/
>> >> http://soundcloud.com/t-emp
>> >>
>> >> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-11-08 18:31
FromRory Walsh
SubjectRe: Optimization tip wanted for Csound/Python
Btw Oeyvind, is ctcsound a possible solution to the issues we are having with Python opcodes and Live on OSX? 

On 8 November 2016 at 17:52, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
Great, thankl you so much for the help.
I'll probably be back with more questions shortly :-)

2016-11-07 11:08 GMT-08:00 Francois PINOT <fggpinot@gmail.com>:
> I think this is due to small floating point differences in the order of
> 1e-04. The test for equality is not appropriate here. You should consider
> that ctcsound is working on your system.
>
> François
>
> 2016-11-07 19:50 GMT+01:00 Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>:
>>
>> Yes, I downloaded the full repo as a zip.
>>
>>
>> 2016-11-07 10:27 GMT-08:00 Francois PINOT <fggpinot@gmail.com>:
>> > Is the file "bufferInOut.csd" present in the directory you ran
>> > test_ctcsound.py from?
>> >
>> > François
>> >
>> > 2016-11-07 19:20 GMT+01:00 Oeyvind Brandtsegg
>> > <oyvind.brandtsegg@ntnu.no>:
>> >>
>> >> Ok. It is in my path,
>> >> but now I realize that this was not the culprit,
>> >> ...my bad. I had not copied in csnd.dll from my build dir.
>> >>
>> >> Now I get test_ctcsound.py to this stage:
>> >> (...snip)
>> >> writing 4096 sample blks of 64-bit floats to dac
>> >> SECTION 1:
>> >> F
>> >> ======================================================================
>> >> FAIL: test_inputOutputbuffer (__main__.TestGeneralIO)
>> >> ----------------------------------------------------------------------
>> >> Traceback (most recent call last):
>> >>   File "test_ctcsound.py", line 78, in test_inputOutputbuffer
>> >>     self.assertTrue(np.array_equal(obuf, ibuf/3.0))
>> >> AssertionError: False is not true
>> >>
>> >> ----------------------------------------------------------------------
>> >> Ran 6 tests in 8.216s
>> >>
>> >> FAILED (failures=1)
>> >>
>> >>
>> >>
>> >>
>> >> 2016-11-06 3:21 GMT-08:00 Francois PINOT <fggpinot@gmail.com>:
>> >> > csound64.dll should be accessible through your PATH. Normally it is
>> >> > located
>> >> > in "C:\Program Files\Csound_x64\bin".
>> >> >
>> >> > You can verify that this path is referenced in your PATH environment
>> >> > variable with this command:
>> >> >
>> >> >   echo %PATH%
>> >> >
>> >> > If this is not the case, you'll have to add this path to your PATH
>> >> > environment variable or to the system PATH environment variable.
>> >> >
>> >> > François
>> >> >
>> >> > 2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg
>> >> > <oyvind.brandtsegg@ntnu.no>:
>> >> >>
>> >> >> Thanks,
>> >> >> this was left cold for a while, but now I'm back on track.
>> >> >>
>> >> >> I get
>> >> >>
>> >> >> >>> import ctcsound
>> >> >> Traceback (most recent call last):
>> >> >>   File "<stdin>", line 1, in <module>
>> >> >>   File "ctcsound.py", line 2411, in <module>
>> >> >>     libcspt = cdll.csnd6
>> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 435, in
>> >> >> __getattr__
>> >> >>     dll = self._dlltype(name)
>> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>> >> >>     self._handle = _dlopen(self._name, mode)
>> >> >> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>> >> >>
>> >> >> ... which I assume also relates to line 30 of ctcsound.py
>> >> >> elif sys.platform.startswith('win'):
>> >> >>     libcsound = cdll.csound64
>> >> >>
>> >> >> I understand (guess) that cdll is probably the ctypes dll, but where
>> >> >> can I set it up so that it finds csound64?
>> >> >>
>> >> >> best
>> >> >> Oeyvind
>> >> >>
>> >> >> 2016-10-15 3:04 GMT-07:00 Francois PINOT <fggpinot@gmail.com>:
>> >> >> > I just pushed to my github repo an example showing how to use
>> >> >> > ctcsound
>> >> >> > from
>> >> >> > the py- opcodes within a running instance of Csound:
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>> >> >> >
>> >> >> > Notice that actually Python2 is used by default due the hardcoded
>> >> >> > choice
>> >> >> > of
>> >> >> > Python when building Csound.
>> >> >> >
>> >> >> > François
>> >> >> >
>> >> >> > 2016-10-14 15:23 GMT+02:00 Victor Lazzarini
>> >> >> > <Victor.Lazzarini@nuim.ie>:
>> >> >> >>
>> >> >> >> We might need a csoundGetInstance() function or similar in
>> >> >> >> ctcsound
>> >> >> >> so
>> >> >> >> that the
>> >> >> >> opcodes can communicate with the running Csound.
>> >> >> >>
>> >> >> >> http://csound.github.io/docs/manual/pyinit.html
>> >> >> >>
>> >> >> >> > On 14 Oct 2016, at 13:56, Francois PINOT <fggpinot@gmail.com>
>> >> >> >> > wrote:
>> >> >> >> >
>> >> >> >> > pyruni "import ctcsound" in global part?
>> >> >> >> >
>> >> >> >> > François
>> >> >> >> >
>> >> >> >> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>> >> >> >> > <oyvind.brandtsegg@ntnu.no>:
>> >> >> >> > Yes, but how to I tell Csound (the py opcodes within Csound) to
>> >> >> >> > use
>> >> >> >> > ctcsound ?
>> >> >> >> >
>> >> >> >> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini
>> >> >> >> > <Victor.Lazzarini@nuim.ie>:
>> >> >> >> > > You can just install numpy.
>> >> >> >> > >
>> >> >> >> > > Victor Lazzarini
>> >> >> >> > > Dean of Arts, Celtic Studies, and Philosophy
>> >> >> >> > > Maynooth University
>> >> >> >> > > Ireland
>> >> >> >> > >
>> >> >> >> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>> >> >> >> > >> <oyvind.brandtsegg@NTNU.NO> wrote:
>> >> >> >> > >>
>> >> >> >> > >> Ah, now I remember, I tried this earlier and did not
>> >> >> >> > >> complete
>> >> >> >> > >> installing Anaconda, as it seemed like it could interfere
>> >> >> >> > >> with
>> >> >> >> > >> other
>> >> >> >> > >> system variables so I backed out.
>> >> >> >> > >> Is there a way for me to configure the environment without
>> >> >> >> > >> installing
>> >> >> >> > >> Anaconda? I'm in the middle of several productions, so I am
>> >> >> >> > >> hesitant
>> >> >> >> > >> to let an installer make automatic changes to my system.
>> >> >> >> > >>
>> >> >> >> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT
>> >> >> >> > >> <fggpinot@gmail.com>:
>> >> >> >> > >>> Only numpy is mandatory.
>> >> >> >> > >>>
>> >> >> >> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You
>> >> >> >> > >>> need
>> >> >> >> > >>> an
>> >> >> >> > >>> environment set properly for each version of Python you
>> >> >> >> > >>> will
>> >> >> >> > >>> use.
>> >> >> >> > >>> Anaconda
>> >> >> >> > >>> facilitates this, and it provides a lot of modules for
>> >> >> >> > >>> scientific
>> >> >> >> > >>> computing.
>> >> >> >> > >>> Jupyter is a plus allowing you to use Csound within
>> >> >> >> > >>> notebooks.
>> >> >> >> > >>>
>> >> >> >> > >>> François
>> >> >> >> > >>>
>> >> >> >> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>> >> >> >> > >>> <oyvind.brandtsegg@ntnu.no>:
>> >> >> >> > >>>>
>> >> >> >> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just
>> >> >> >> > >>>> followed
>> >> >> >> > >>>> the
>> >> >> >> > >>>> info on the list with interest, waiting to dive in.
>> >> >> >> > >>>> Is there some instructions on how to migrate somewhere? Do
>> >> >> >> > >>>> I
>> >> >> >> > >>>> need
>> >> >> >> > >>>> to
>> >> >> >> > >>>> install Anaconda and Jupyter, or can I just replace some
>> >> >> >> > >>>> modules
>> >> >> >> > >>>> ?
>> >> >> >> > >>>>
>> >> >> >> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>> >> >> >> > >>>> <Victor.Lazzarini@nuim.ie>:
>> >> >> >> > >>>>> It is possible to read a Csound ftable via the API.
>> >> >> >> > >>>>>
>> >> >> >> > >>>>> I'd also suggest migrating to ctcsound if you
>> >> >> >> > >>>>> are using csnd6. It's excellent.
>> >> >> >> > >>>>>
>> >> >> >> > >>>>> Victor Lazzarini
>> >> >> >> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>> >> >> >> > >>>>> Maynooth University
>> >> >> >> > >>>>> Ireland
>> >> >> >> > >>>>>
>> >> >> >> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi <stevenyi@GMAIL.COM>
>> >> >> >> > >>>>> wrote:
>> >> >> >> > >>>>>
>> >> >> >> > >>>>> Yes I think that was what I was thinking of, but I'm
>> >> >> >> > >>>>> unsure
>> >> >> >> > >>>>> whether it
>> >> >> >> > >>>>> is
>> >> >> >> > >>>>> supported now or not.
>> >> >> >> > >>>>>
>> >> >> >> > >>>>>
>> >> >> >> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>> >> >> >> > >>>>> <oyvind.brandtsegg@ntnu.no>
>> >> >> >> > >>>>> wrote:
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> Hi all,
>> >> >> >> > >>>>>> thanks for the suggestions.
>> >> >> >> > >>>>>> If I can read from a csound table directly in python
>> >> >> >> > >>>>>> code,
>> >> >> >> > >>>>>> that
>> >> >> >> > >>>>>> would
>> >> >> >> > >>>>>> be the best. Steven, do you mean this document
>> >> >> >> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> >> >> >> > >>>>>> There were several things in there that I did not know
>> >> >> >> > >>>>>> about,
>> >> >> >> > >>>>>> is
>> >> >> >> > >>>>>> the
>> >> >> >> > >>>>>> csound module as described there currently supported?
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi
>> >> >> >> > >>>>>> <stevenyi@gmail.com>:
>> >> >> >> > >>>>>>> Have you tried ftables? I.e. Filling the table in
>> >> >> >> > >>>>>>> Csound,
>> >> >> >> > >>>>>>> then
>> >> >> >> > >>>>>>> reading
>> >> >> >> > >>>>>>> from
>> >> >> >> > >>>>>>> the table in the python code. I seem to remember the
>> >> >> >> > >>>>>>> python
>> >> >> >> > >>>>>>> opcodes
>> >> >> >> > >>>>>>> having
>> >> >> >> > >>>>>>> access to ftables and that there was example code for
>> >> >> >> > >>>>>>> this.
>> >> >> >> > >>>>>>>
>> >> >> >> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> >> >> >> > >>>>>>> <tarmo.johannes@otsakool.edu.ee> wrote:
>> >> >> >> > >>>>>>>>
>> >> >> >> > >>>>>>>> Not sure, but would --realtime switch on command line
>> >> >> >> > >>>>>>>> help?
>> >> >> >> > >>>>>>>> I
>> >> >> >> > >>>>>>>> don't
>> >> >> >> > >>>>>>>> know
>> >> >> >> > >>>>>>>> if that puts python to other thread from audio work...
>> >> >> >> > >>>>>>>>
>> >> >> >> > >>>>>>>>
>> >> >> >> > >>>>>>>> Tarmo
>> >> >> >> > >>>>>>>>
>> >> >> >> > >>>>>>>>
>> >> >> >> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind
>> >> >> >> > >>>>>>>> Brandtsegg"
>> >> >> >> > >>>>>>>> <oyvind.brandtsegg@ntnu.no>:
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> Hi,
>> >> >> >> > >>>>>>>>> I need to transfer the contents of an array from
>> >> >> >> > >>>>>>>>> Csound
>> >> >> >> > >>>>>>>>> to
>> >> >> >> > >>>>>>>>> Python,
>> >> >> >> > >>>>>>>>> as
>> >> >> >> > >>>>>>>>> I want to do some peak picking and other analysis
>> >> >> >> > >>>>>>>>> that
>> >> >> >> > >>>>>>>>> is
>> >> >> >> > >>>>>>>>> easier to
>> >> >> >> > >>>>>>>>> get done in Python. The problem is that my
>> >> >> >> > >>>>>>>>> (admittedly
>> >> >> >> > >>>>>>>>> ad
>> >> >> >> > >>>>>>>>> hoc)
>> >> >> >> > >>>>>>>>> method
>> >> >> >> > >>>>>>>>> of transferring the values from Csound to Python
>> >> >> >> > >>>>>>>>> incurs
>> >> >> >> > >>>>>>>>> significant
>> >> >> >> > >>>>>>>>> performance degradation (more details on how I
>> >> >> >> > >>>>>>>>> measure
>> >> >> >> > >>>>>>>>> this
>> >> >> >> > >>>>>>>>> later
>> >> >> >> > >>>>>>>>> in
>> >> >> >> > >>>>>>>>> this email).
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> The basic premise is that I need Csound to be the
>> >> >> >> > >>>>>>>>> main
>> >> >> >> > >>>>>>>>> program
>> >> >> >> > >>>>>>>>> (the
>> >> >> >> > >>>>>>>>> host), and Python runs via the py opcodes.
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to
>> >> >> >> > >>>>>>>>> be
>> >> >> >> > >>>>>>>>> done
>> >> >> >> > >>>>>>>>> once
>> >> >> >> > >>>>>>>>> every 1 second, for 3 of these arrays. One should
>> >> >> >> > >>>>>>>>> think
>> >> >> >> > >>>>>>>>> the
>> >> >> >> > >>>>>>>>> bandwidth
>> >> >> >> > >>>>>>>>> requirement are not too taxing on any system, but
>> >> >> >> > >>>>>>>>> since
>> >> >> >> > >>>>>>>>> I
>> >> >> >> > >>>>>>>>> only
>> >> >> >> > >>>>>>>>> send
>> >> >> >> > >>>>>>>>> single values, there are more than 700 pycalls
>> >> >> >> > >>>>>>>>> happening
>> >> >> >> > >>>>>>>>> in
>> >> >> >> > >>>>>>>>> one
>> >> >> >> > >>>>>>>>> k-rate
>> >> >> >> > >>>>>>>>> pass.
>> >> >> >> > >>>>>>>>> The python function "p.fill_array" does nothing but
>> >> >> >> > >>>>>>>>> put
>> >> >> >> > >>>>>>>>> the
>> >> >> >> > >>>>>>>>> received
>> >> >> >> > >>>>>>>>> values one by one into a numpy array.
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>>  kcnt_fill = 0
>> >> >> >> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>> >> >> >> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill],
>> >> >> >> > >>>>>>>>> kcnt_fill,
>> >> >> >> > >>>>>>>>> ifftsize/2
>> >> >> >> > >>>>>>>>>    kcnt_fill += 1
>> >> >> >> > >>>>>>>>>  od
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> By performance degradation I mean that the operation
>> >> >> >> > >>>>>>>>> seems
>> >> >> >> > >>>>>>>>> to
>> >> >> >> > >>>>>>>>> let
>> >> >> >> > >>>>>>>>> the
>> >> >> >> > >>>>>>>>> different processes to wait for each other a lot,
>> >> >> >> > >>>>>>>>> utlimately
>> >> >> >> > >>>>>>>>> leading
>> >> >> >> > >>>>>>>>> to dropouts in realtime audio. This does not show up
>> >> >> >> > >>>>>>>>> as
>> >> >> >> > >>>>>>>>> CPU
>> >> >> >> > >>>>>>>>> spikes
>> >> >> >> > >>>>>>>>> (running at around 50%), but shows in Reaper's
>> >> >> >> > >>>>>>>>> performence
>> >> >> >> > >>>>>>>>> meter as
>> >> >> >> > >>>>>>>>> "RT longest-block". This meter shows the number of
>> >> >> >> > >>>>>>>>> milliseconds
>> >> >> >> > >>>>>>>>> used/available per audio processing block. The *used*
>> >> >> >> > >>>>>>>>> must
>> >> >> >> > >>>>>>>>> generally
>> >> >> >> > >>>>>>>>> be less than the *available* time to avoid dropouts.
>> >> >> >> > >>>>>>>>> Some
>> >> >> >> > >>>>>>>>> spikes
>> >> >> >> > >>>>>>>>> are
>> >> >> >> > >>>>>>>>> not necessarily bad, but in my case the *used* is
>> >> >> >> > >>>>>>>>> generally
>> >> >> >> > >>>>>>>>> quite
>> >> >> >> > >>>>>>>>> stable and higher than the *available*, unless I
>> >> >> >> > >>>>>>>>> comment
>> >> >> >> > >>>>>>>>> out
>> >> >> >> > >>>>>>>>> the
>> >> >> >> > >>>>>>>>> code
>> >> >> >> > >>>>>>>>> excerpt given above.
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> Is there any way I can send an array from Csound to
>> >> >> >> > >>>>>>>>> Python
>> >> >> >> > >>>>>>>>> in
>> >> >> >> > >>>>>>>>> one
>> >> >> >> > >>>>>>>>> go?
>> >> >> >> > >>>>>>>>> I seem to remember some black magic about letting
>> >> >> >> > >>>>>>>>> Python
>> >> >> >> > >>>>>>>>> running
>> >> >> >> > >>>>>>>>> under
>> >> >> >> > >>>>>>>>> Csound get access to the (host) csound instance and
>> >> >> >> > >>>>>>>>> thus
>> >> >> >> > >>>>>>>>> accessing
>> >> >> >> > >>>>>>>>> the
>> >> >> >> > >>>>>>>>> Csound API. Would that be the best way to do it, and
>> >> >> >> > >>>>>>>>> would
>> >> >> >> > >>>>>>>>> it
>> >> >> >> > >>>>>>>>> be
>> >> >> >> > >>>>>>>>> considered a safe way of doing it?
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> best
>> >> >> >> > >>>>>>>>> Oeyvind
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> --
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> Oeyvind Brandtsegg
>> >> >> >> > >>>>>>>>> Professor of Music Technology
>> >> >> >> > >>>>>>>>> NTNU
>> >> >> >> > >>>>>>>>> 7491 Trondheim
>> >> >> >> > >>>>>>>>> Norway
>> >> >> >> > >>>>>>>>> Cell: +47 92 203 205
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> http://www.partikkelaudio.com/
>> >> >> >> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>> >> >> >> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>> >> >> >> > >>>>>>>>> http://soundcloud.com/brandtsegg
>> >> >> >> > >>>>>>>>> http://flyndresang.no/
>> >> >> >> > >>>>>>>>> http://soundcloud.com/t-emp
>> >> >> >> > >>>>>>>>>
>> >> >> >> > >>>>>>>>> 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
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> --
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> Oeyvind Brandtsegg
>> >> >> >> > >>>>>> Professor of Music Technology
>> >> >> >> > >>>>>> NTNU
>> >> >> >> > >>>>>> 7491 Trondheim
>> >> >> >> > >>>>>> Norway
>> >> >> >> > >>>>>> Cell: +47 92 203 205
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> http://www.partikkelaudio.com/
>> >> >> >> > >>>>>> http://crossadaptive.hf.ntnu.no
>> >> >> >> > >>>>>> http://gdsp.hf.ntnu.no/
>> >> >> >> > >>>>>> http://soundcloud.com/brandtsegg
>> >> >> >> > >>>>>> http://flyndresang.no/
>> >> >> >> > >>>>>> http://soundcloud.com/t-emp
>> >> >> >> > >>>>>>
>> >> >> >> > >>>>>> 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
>> >> >> >> > >>>>
>> >> >> >> > >>>>
>> >> >> >> > >>>>
>> >> >> >> > >>>> --
>> >> >> >> > >>>>
>> >> >> >> > >>>> Oeyvind Brandtsegg
>> >> >> >> > >>>> Professor of Music Technology
>> >> >> >> > >>>> NTNU
>> >> >> >> > >>>> 7491 Trondheim
>> >> >> >> > >>>> Norway
>> >> >> >> > >>>> Cell: +47 92 203 205
>> >> >> >> > >>>>
>> >> >> >> > >>>> http://www.partikkelaudio.com/
>> >> >> >> > >>>> http://crossadaptive.hf.ntnu.no
>> >> >> >> > >>>> http://gdsp.hf.ntnu.no/
>> >> >> >> > >>>> http://soundcloud.com/brandtsegg
>> >> >> >> > >>>> http://flyndresang.no/
>> >> >> >> > >>>> http://soundcloud.com/t-emp
>> >> >> >> > >>>>
>> >> >> >> > >>>> 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
>> >> >> >> > >>
>> >> >> >> > >>
>> >> >> >> > >>
>> >> >> >> > >> --
>> >> >> >> > >>
>> >> >> >> > >> Oeyvind Brandtsegg
>> >> >> >> > >> Professor of Music Technology
>> >> >> >> > >> NTNU
>> >> >> >> > >> 7491 Trondheim
>> >> >> >> > >> Norway
>> >> >> >> > >> Cell: +47 92 203 205
>> >> >> >> > >>
>> >> >> >> > >> http://www.partikkelaudio.com/
>> >> >> >> > >> http://crossadaptive.hf.ntnu.no
>> >> >> >> > >> http://gdsp.hf.ntnu.no/
>> >> >> >> > >> http://soundcloud.com/brandtsegg
>> >> >> >> > >> http://flyndresang.no/
>> >> >> >> > >> http://soundcloud.com/t-emp
>> >> >> >> > >>
>> >> >> >> > >> 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
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> >
>> >> >> >> > Oeyvind Brandtsegg
>> >> >> >> > Professor of Music Technology
>> >> >> >> > NTNU
>> >> >> >> > 7491 Trondheim
>> >> >> >> > Norway
>> >> >> >> > Cell: +47 92 203 205
>> >> >> >> >
>> >> >> >> > http://www.partikkelaudio.com/
>> >> >> >> > http://crossadaptive.hf.ntnu.no
>> >> >> >> > http://gdsp.hf.ntnu.no/
>> >> >> >> > http://soundcloud.com/brandtsegg
>> >> >> >> > http://flyndresang.no/
>> >> >> >> > http://soundcloud.com/t-emp
>> >> >> >> >
>> >> >> >> > 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
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >>
>> >> >> Oeyvind Brandtsegg
>> >> >> Professor of Music Technology
>> >> >> NTNU
>> >> >> 7491 Trondheim
>> >> >> Norway
>> >> >> Cell: +47 92 203 205
>> >> >>
>> >> >> http://www.partikkelaudio.com/
>> >> >> http://crossadaptive.hf.ntnu.no
>> >> >> http://gdsp.hf.ntnu.no/
>> >> >> http://soundcloud.com/brandtsegg
>> >> >> http://flyndresang.no/
>> >> >> http://soundcloud.com/t-emp
>> >> >>
>> >> >> 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
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Oeyvind Brandtsegg
>> >> Professor of Music Technology
>> >> NTNU
>> >> 7491 Trondheim
>> >> Norway
>> >> Cell: +47 92 203 205
>> >>
>> >> http://www.partikkelaudio.com/
>> >> http://crossadaptive.hf.ntnu.no
>> >> http://gdsp.hf.ntnu.no/
>> >> http://soundcloud.com/brandtsegg
>> >> http://flyndresang.no/
>> >> http://soundcloud.com/t-emp
>> >>
>> >> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-11-08 19:28
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
That will be one thing to look into very soon, maybe those problems
will just vanish... haha, we'll see.
I have a few more workshops and presentations this week, after that I
should be able to spend some more time on it.

2016-11-08 10:31 GMT-08:00 Rory Walsh :
> Btw Oeyvind, is ctcsound a possible solution to the issues we are having
> with Python opcodes and Live on OSX?
>
> On 8 November 2016 at 17:52, Oeyvind Brandtsegg 
> wrote:
>>
>> Great, thankl you so much for the help.
>> I'll probably be back with more questions shortly :-)
>>
>> 2016-11-07 11:08 GMT-08:00 Francois PINOT :
>> > I think this is due to small floating point differences in the order of
>> > 1e-04. The test for equality is not appropriate here. You should
>> > consider
>> > that ctcsound is working on your system.
>> >
>> > François
>> >
>> > 2016-11-07 19:50 GMT+01:00 Oeyvind Brandtsegg
>> > :
>> >>
>> >> Yes, I downloaded the full repo as a zip.
>> >>
>> >>
>> >> 2016-11-07 10:27 GMT-08:00 Francois PINOT :
>> >> > Is the file "bufferInOut.csd" present in the directory you ran
>> >> > test_ctcsound.py from?
>> >> >
>> >> > François
>> >> >
>> >> > 2016-11-07 19:20 GMT+01:00 Oeyvind Brandtsegg
>> >> > :
>> >> >>
>> >> >> Ok. It is in my path,
>> >> >> but now I realize that this was not the culprit,
>> >> >> ...my bad. I had not copied in csnd.dll from my build dir.
>> >> >>
>> >> >> Now I get test_ctcsound.py to this stage:
>> >> >> (...snip)
>> >> >> writing 4096 sample blks of 64-bit floats to dac
>> >> >> SECTION 1:
>> >> >> F
>> >> >>
>> >> >> ======================================================================
>> >> >> FAIL: test_inputOutputbuffer (__main__.TestGeneralIO)
>> >> >>
>> >> >> ----------------------------------------------------------------------
>> >> >> Traceback (most recent call last):
>> >> >>   File "test_ctcsound.py", line 78, in test_inputOutputbuffer
>> >> >>     self.assertTrue(np.array_equal(obuf, ibuf/3.0))
>> >> >> AssertionError: False is not true
>> >> >>
>> >> >>
>> >> >> ----------------------------------------------------------------------
>> >> >> Ran 6 tests in 8.216s
>> >> >>
>> >> >> FAILED (failures=1)
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> 2016-11-06 3:21 GMT-08:00 Francois PINOT :
>> >> >> > csound64.dll should be accessible through your PATH. Normally it
>> >> >> > is
>> >> >> > located
>> >> >> > in "C:\Program Files\Csound_x64\bin".
>> >> >> >
>> >> >> > You can verify that this path is referenced in your PATH
>> >> >> > environment
>> >> >> > variable with this command:
>> >> >> >
>> >> >> >   echo %PATH%
>> >> >> >
>> >> >> > If this is not the case, you'll have to add this path to your PATH
>> >> >> > environment variable or to the system PATH environment variable.
>> >> >> >
>> >> >> > François
>> >> >> >
>> >> >> > 2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg
>> >> >> > :
>> >> >> >>
>> >> >> >> Thanks,
>> >> >> >> this was left cold for a while, but now I'm back on track.
>> >> >> >>
>> >> >> >> I get
>> >> >> >>
>> >> >> >> >>> import ctcsound
>> >> >> >> Traceback (most recent call last):
>> >> >> >>   File "", line 1, in 
>> >> >> >>   File "ctcsound.py", line 2411, in 
>> >> >> >>     libcspt = cdll.csnd6
>> >> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 435, in
>> >> >> >> __getattr__
>> >> >> >>     dll = self._dlltype(name)
>> >> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in
>> >> >> >> __init__
>> >> >> >>     self._handle = _dlopen(self._name, mode)
>> >> >> >> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>> >> >> >>
>> >> >> >> ... which I assume also relates to line 30 of ctcsound.py
>> >> >> >> elif sys.platform.startswith('win'):
>> >> >> >>     libcsound = cdll.csound64
>> >> >> >>
>> >> >> >> I understand (guess) that cdll is probably the ctypes dll, but
>> >> >> >> where
>> >> >> >> can I set it up so that it finds csound64?
>> >> >> >>
>> >> >> >> best
>> >> >> >> Oeyvind
>> >> >> >>
>> >> >> >> 2016-10-15 3:04 GMT-07:00 Francois PINOT :
>> >> >> >> > I just pushed to my github repo an example showing how to use
>> >> >> >> > ctcsound
>> >> >> >> > from
>> >> >> >> > the py- opcodes within a running instance of Csound:
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>> >> >> >> >
>> >> >> >> > Notice that actually Python2 is used by default due the
>> >> >> >> > hardcoded
>> >> >> >> > choice
>> >> >> >> > of
>> >> >> >> > Python when building Csound.
>> >> >> >> >
>> >> >> >> > François
>> >> >> >> >
>> >> >> >> > 2016-10-14 15:23 GMT+02:00 Victor Lazzarini
>> >> >> >> > :
>> >> >> >> >>
>> >> >> >> >> We might need a csoundGetInstance() function or similar in
>> >> >> >> >> ctcsound
>> >> >> >> >> so
>> >> >> >> >> that the
>> >> >> >> >> opcodes can communicate with the running Csound.
>> >> >> >> >>
>> >> >> >> >> http://csound.github.io/docs/manual/pyinit.html
>> >> >> >> >>
>> >> >> >> >> > On 14 Oct 2016, at 13:56, Francois PINOT
>> >> >> >> >> > 
>> >> >> >> >> > wrote:
>> >> >> >> >> >
>> >> >> >> >> > pyruni "import ctcsound" in global part?
>> >> >> >> >> >
>> >> >> >> >> > François
>> >> >> >> >> >
>> >> >> >> >> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>> >> >> >> >> > :
>> >> >> >> >> > Yes, but how to I tell Csound (the py opcodes within Csound)
>> >> >> >> >> > to
>> >> >> >> >> > use
>> >> >> >> >> > ctcsound ?
>> >> >> >> >> >
>> >> >> >> >> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini
>> >> >> >> >> > :
>> >> >> >> >> > > You can just install numpy.
>> >> >> >> >> > >
>> >> >> >> >> > > Victor Lazzarini
>> >> >> >> >> > > Dean of Arts, Celtic Studies, and Philosophy
>> >> >> >> >> > > Maynooth University
>> >> >> >> >> > > Ireland
>> >> >> >> >> > >
>> >> >> >> >> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>> >> >> >> >> > >>  wrote:
>> >> >> >> >> > >>
>> >> >> >> >> > >> Ah, now I remember, I tried this earlier and did not
>> >> >> >> >> > >> complete
>> >> >> >> >> > >> installing Anaconda, as it seemed like it could interfere
>> >> >> >> >> > >> with
>> >> >> >> >> > >> other
>> >> >> >> >> > >> system variables so I backed out.
>> >> >> >> >> > >> Is there a way for me to configure the environment
>> >> >> >> >> > >> without
>> >> >> >> >> > >> installing
>> >> >> >> >> > >> Anaconda? I'm in the middle of several productions, so I
>> >> >> >> >> > >> am
>> >> >> >> >> > >> hesitant
>> >> >> >> >> > >> to let an installer make automatic changes to my system.
>> >> >> >> >> > >>
>> >> >> >> >> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT
>> >> >> >> >> > >> :
>> >> >> >> >> > >>> Only numpy is mandatory.
>> >> >> >> >> > >>>
>> >> >> >> >> > >>> You can use ctcsound with Python 2.x and/or Python 3.x.
>> >> >> >> >> > >>> You
>> >> >> >> >> > >>> need
>> >> >> >> >> > >>> an
>> >> >> >> >> > >>> environment set properly for each version of Python you
>> >> >> >> >> > >>> will
>> >> >> >> >> > >>> use.
>> >> >> >> >> > >>> Anaconda
>> >> >> >> >> > >>> facilitates this, and it provides a lot of modules for
>> >> >> >> >> > >>> scientific
>> >> >> >> >> > >>> computing.
>> >> >> >> >> > >>> Jupyter is a plus allowing you to use Csound within
>> >> >> >> >> > >>> notebooks.
>> >> >> >> >> > >>>
>> >> >> >> >> > >>> François
>> >> >> >> >> > >>>
>> >> >> >> >> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>> >> >> >> >> > >>> :
>> >> >> >> >> > >>>>
>> >> >> >> >> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just
>> >> >> >> >> > >>>> followed
>> >> >> >> >> > >>>> the
>> >> >> >> >> > >>>> info on the list with interest, waiting to dive in.
>> >> >> >> >> > >>>> Is there some instructions on how to migrate somewhere?
>> >> >> >> >> > >>>> Do
>> >> >> >> >> > >>>> I
>> >> >> >> >> > >>>> need
>> >> >> >> >> > >>>> to
>> >> >> >> >> > >>>> install Anaconda and Jupyter, or can I just replace
>> >> >> >> >> > >>>> some
>> >> >> >> >> > >>>> modules
>> >> >> >> >> > >>>> ?
>> >> >> >> >> > >>>>
>> >> >> >> >> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>> >> >> >> >> > >>>> :
>> >> >> >> >> > >>>>> It is possible to read a Csound ftable via the API.
>> >> >> >> >> > >>>>>
>> >> >> >> >> > >>>>> I'd also suggest migrating to ctcsound if you
>> >> >> >> >> > >>>>> are using csnd6. It's excellent.
>> >> >> >> >> > >>>>>
>> >> >> >> >> > >>>>> Victor Lazzarini
>> >> >> >> >> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>> >> >> >> >> > >>>>> Maynooth University
>> >> >> >> >> > >>>>> Ireland
>> >> >> >> >> > >>>>>
>> >> >> >> >> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi
>> >> >> >> >> > >>>>> 
>> >> >> >> >> > >>>>> wrote:
>> >> >> >> >> > >>>>>
>> >> >> >> >> > >>>>> Yes I think that was what I was thinking of, but I'm
>> >> >> >> >> > >>>>> unsure
>> >> >> >> >> > >>>>> whether it
>> >> >> >> >> > >>>>> is
>> >> >> >> >> > >>>>> supported now or not.
>> >> >> >> >> > >>>>>
>> >> >> >> >> > >>>>>
>> >> >> >> >> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>> >> >> >> >> > >>>>> 
>> >> >> >> >> > >>>>> wrote:
>> >> >> >> >> > >>>>>>
>> >> >> >> >> > >>>>>> Hi all,
>> >> >> >> >> > >>>>>> thanks for the suggestions.
>> >> >> >> >> > >>>>>> If I can read from a csound table directly in python
>> >> >> >> >> > >>>>>> code,
>> >> >> >> >> > >>>>>> that
>> >> >> >> >> > >>>>>> would
>> >> >> >> >> > >>>>>> be the best. Steven, do you mean this document
>> >> >> >> >> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>> >> >> >> >> > >>>>>> There were several things in there that I did not
>> >> >> >> >> > >>>>>> know
>> >> >> >> >> > >>>>>> about,
>> >> >> >> >> > >>>>>> is
>> >> >> >> >> > >>>>>> the
>> >> >> >> >> > >>>>>> csound module as described there currently supported?
>> >> >> >> >> > >>>>>>
>> >> >> >> >> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi
>> >> >> >> >> > >>>>>> :
>> >> >> >> >> > >>>>>>> Have you tried ftables? I.e. Filling the table in
>> >> >> >> >> > >>>>>>> Csound,
>> >> >> >> >> > >>>>>>> then
>> >> >> >> >> > >>>>>>> reading
>> >> >> >> >> > >>>>>>> from
>> >> >> >> >> > >>>>>>> the table in the python code. I seem to remember the
>> >> >> >> >> > >>>>>>> python
>> >> >> >> >> > >>>>>>> opcodes
>> >> >> >> >> > >>>>>>> having
>> >> >> >> >> > >>>>>>> access to ftables and that there was example code
>> >> >> >> >> > >>>>>>> for
>> >> >> >> >> > >>>>>>> this.
>> >> >> >> >> > >>>>>>>
>> >> >> >> >> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>> >> >> >> >> > >>>>>>>  wrote:
>> >> >> >> >> > >>>>>>>>
>> >> >> >> >> > >>>>>>>> Not sure, but would --realtime switch on command
>> >> >> >> >> > >>>>>>>> line
>> >> >> >> >> > >>>>>>>> help?
>> >> >> >> >> > >>>>>>>> I
>> >> >> >> >> > >>>>>>>> don't
>> >> >> >> >> > >>>>>>>> know
>> >> >> >> >> > >>>>>>>> if that puts python to other thread from audio
>> >> >> >> >> > >>>>>>>> work...
>> >> >> >> >> > >>>>>>>>
>> >> >> >> >> > >>>>>>>>
>> >> >> >> >> > >>>>>>>> Tarmo
>> >> >> >> >> > >>>>>>>>
>> >> >> >> >> > >>>>>>>>
>> >> >> >> >> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind
>> >> >> >> >> > >>>>>>>> Brandtsegg"
>> >> >> >> >> > >>>>>>>> :
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>> Hi,
>> >> >> >> >> > >>>>>>>>> I need to transfer the contents of an array from
>> >> >> >> >> > >>>>>>>>> Csound
>> >> >> >> >> > >>>>>>>>> to
>> >> >> >> >> > >>>>>>>>> Python,
>> >> >> >> >> > >>>>>>>>> as
>> >> >> >> >> > >>>>>>>>> I want to do some peak picking and other analysis
>> >> >> >> >> > >>>>>>>>> that
>> >> >> >> >> > >>>>>>>>> is
>> >> >> >> >> > >>>>>>>>> easier to
>> >> >> >> >> > >>>>>>>>> get done in Python. The problem is that my
>> >> >> >> >> > >>>>>>>>> (admittedly
>> >> >> >> >> > >>>>>>>>> ad
>> >> >> >> >> > >>>>>>>>> hoc)
>> >> >> >> >> > >>>>>>>>> method
>> >> >> >> >> > >>>>>>>>> of transferring the values from Csound to Python
>> >> >> >> >> > >>>>>>>>> incurs
>> >> >> >> >> > >>>>>>>>> significant
>> >> >> >> >> > >>>>>>>>> performance degradation (more details on how I
>> >> >> >> >> > >>>>>>>>> measure
>> >> >> >> >> > >>>>>>>>> this
>> >> >> >> >> > >>>>>>>>> later
>> >> >> >> >> > >>>>>>>>> in
>> >> >> >> >> > >>>>>>>>> this email).
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>> The basic premise is that I need Csound to be the
>> >> >> >> >> > >>>>>>>>> main
>> >> >> >> >> > >>>>>>>>> program
>> >> >> >> >> > >>>>>>>>> (the
>> >> >> >> >> > >>>>>>>>> host), and Python runs via the py opcodes.
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>> The array kAuto is of size 256, and transfer needs
>> >> >> >> >> > >>>>>>>>> to
>> >> >> >> >> > >>>>>>>>> be
>> >> >> >> >> > >>>>>>>>> done
>> >> >> >> >> > >>>>>>>>> once
>> >> >> >> >> > >>>>>>>>> every 1 second, for 3 of these arrays. One should
>> >> >> >> >> > >>>>>>>>> think
>> >> >> >> >> > >>>>>>>>> the
>> >> >> >> >> > >>>>>>>>> bandwidth
>> >> >> >> >> > >>>>>>>>> requirement are not too taxing on any system, but
>> >> >> >> >> > >>>>>>>>> since
>> >> >> >> >> > >>>>>>>>> I
>> >> >> >> >> > >>>>>>>>> only
>> >> >> >> >> > >>>>>>>>> send
>> >> >> >> >> > >>>>>>>>> single values, there are more than 700 pycalls
>> >> >> >> >> > >>>>>>>>> happening
>> >> >> >> >> > >>>>>>>>> in
>> >> >> >> >> > >>>>>>>>> one
>> >> >> >> >> > >>>>>>>>> k-rate
>> >> >> >> >> > >>>>>>>>> pass.
>> >> >> >> >> > >>>>>>>>> The python function "p.fill_array" does nothing
>> >> >> >> >> > >>>>>>>>> but
>> >> >> >> >> > >>>>>>>>> put
>> >> >> >> >> > >>>>>>>>> the
>> >> >> >> >> > >>>>>>>>> received
>> >> >> >> >> > >>>>>>>>> values one by one into a numpy array.
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>>  kcnt_fill = 0
>> >> >> >> >> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>> >> >> >> >> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill],
>> >> >> >> >> > >>>>>>>>> kcnt_fill,
>> >> >> >> >> > >>>>>>>>> ifftsize/2
>> >> >> >> >> > >>>>>>>>>    kcnt_fill += 1
>> >> >> >> >> > >>>>>>>>>  od
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>> By performance degradation I mean that the
>> >> >> >> >> > >>>>>>>>> operation
>> >> >> >> >> > >>>>>>>>> seems
>> >> >> >> >> > >>>>>>>>> to
>> >> >> >> >> > >>>>>>>>> let
>> >> >> >> >> > >>>>>>>>> the
>> >> >> >> >> > >>>>>>>>> different processes to wait for each other a lot,
>> >> >> >> >> > >>>>>>>>> utlimately
>> >> >> >> >> > >>>>>>>>> leading
>> >> >> >> >> > >>>>>>>>> to dropouts in realtime audio. This does not show
>> >> >> >> >> > >>>>>>>>> up
>> >> >> >> >> > >>>>>>>>> as
>> >> >> >> >> > >>>>>>>>> CPU
>> >> >> >> >> > >>>>>>>>> spikes
>> >> >> >> >> > >>>>>>>>> (running at around 50%), but shows in Reaper's
>> >> >> >> >> > >>>>>>>>> performence
>> >> >> >> >> > >>>>>>>>> meter as
>> >> >> >> >> > >>>>>>>>> "RT longest-block". This meter shows the number of
>> >> >> >> >> > >>>>>>>>> milliseconds
>> >> >> >> >> > >>>>>>>>> used/available per audio processing block. The
>> >> >> >> >> > >>>>>>>>> *used*
>> >> >> >> >> > >>>>>>>>> must
>> >> >> >> >> > >>>>>>>>> generally
>> >> >> >> >> > >>>>>>>>> be less than the *available* time to avoid
>> >> >> >> >> > >>>>>>>>> dropouts.
>> >> >> >> >> > >>>>>>>>> Some
>> >> >> >> >> > >>>>>>>>> spikes
>> >> >> >> >> > >>>>>>>>> are
>> >> >> >> >> > >>>>>>>>> not necessarily bad, but in my case the *used* is
>> >> >> >> >> > >>>>>>>>> generally
>> >> >> >> >> > >>>>>>>>> quite
>> >> >> >> >> > >>>>>>>>> stable and higher than the *available*, unless I
>> >> >> >> >> > >>>>>>>>> comment
>> >> >> >> >> > >>>>>>>>> out
>> >> >> >> >> > >>>>>>>>> the
>> >> >> >> >> > >>>>>>>>> code
>> >> >> >> >> > >>>>>>>>> excerpt given above.
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>> Is there any way I can send an array from Csound
>> >> >> >> >> > >>>>>>>>> to
>> >> >> >> >> > >>>>>>>>> Python
>> >> >> >> >> > >>>>>>>>> in
>> >> >> >> >> > >>>>>>>>> one
>> >> >> >> >> > >>>>>>>>> go?
>> >> >> >> >> > >>>>>>>>> I seem to remember some black magic about letting
>> >> >> >> >> > >>>>>>>>> Python
>> >> >> >> >> > >>>>>>>>> running
>> >> >> >> >> > >>>>>>>>> under
>> >> >> >> >> > >>>>>>>>> Csound get access to the (host) csound instance
>> >> >> >> >> > >>>>>>>>> and
>> >> >> >> >> > >>>>>>>>> thus
>> >> >> >> >> > >>>>>>>>> accessing
>> >> >> >> >> > >>>>>>>>> the
>> >> >> >> >> > >>>>>>>>> Csound API. Would that be the best way to do it,
>> >> >> >> >> > >>>>>>>>> and
>> >> >> >> >> > >>>>>>>>> would
>> >> >> >> >> > >>>>>>>>> it
>> >> >> >> >> > >>>>>>>>> be
>> >> >> >> >> > >>>>>>>>> considered a safe way of doing it?
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>> best
>> >> >> >> >> > >>>>>>>>> Oeyvind
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>> --
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>> Oeyvind Brandtsegg
>> >> >> >> >> > >>>>>>>>> Professor of Music Technology
>> >> >> >> >> > >>>>>>>>> NTNU
>> >> >> >> >> > >>>>>>>>> 7491 Trondheim
>> >> >> >> >> > >>>>>>>>> Norway
>> >> >> >> >> > >>>>>>>>> Cell: +47 92 203 205
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>> http://www.partikkelaudio.com/
>> >> >> >> >> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>> >> >> >> >> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>> >> >> >> >> > >>>>>>>>> http://soundcloud.com/brandtsegg
>> >> >> >> >> > >>>>>>>>> http://flyndresang.no/
>> >> >> >> >> > >>>>>>>>> http://soundcloud.com/t-emp
>> >> >> >> >> > >>>>>>>>>
>> >> >> >> >> > >>>>>>>>> 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
>> >> >> >> >> > >>>>>>
>> >> >> >> >> > >>>>>>
>> >> >> >> >> > >>>>>>
>> >> >> >> >> > >>>>>> --
>> >> >> >> >> > >>>>>>
>> >> >> >> >> > >>>>>> Oeyvind Brandtsegg
>> >> >> >> >> > >>>>>> Professor of Music Technology
>> >> >> >> >> > >>>>>> NTNU
>> >> >> >> >> > >>>>>> 7491 Trondheim
>> >> >> >> >> > >>>>>> Norway
>> >> >> >> >> > >>>>>> Cell: +47 92 203 205
>> >> >> >> >> > >>>>>>
>> >> >> >> >> > >>>>>> http://www.partikkelaudio.com/
>> >> >> >> >> > >>>>>> http://crossadaptive.hf.ntnu.no
>> >> >> >> >> > >>>>>> http://gdsp.hf.ntnu.no/
>> >> >> >> >> > >>>>>> http://soundcloud.com/brandtsegg
>> >> >> >> >> > >>>>>> http://flyndresang.no/
>> >> >> >> >> > >>>>>> http://soundcloud.com/t-emp
>> >> >> >> >> > >>>>>>
>> >> >> >> >> > >>>>>> 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
>> >> >> >> >> > >>>>
>> >> >> >> >> > >>>>
>> >> >> >> >> > >>>>
>> >> >> >> >> > >>>> --
>> >> >> >> >> > >>>>
>> >> >> >> >> > >>>> Oeyvind Brandtsegg
>> >> >> >> >> > >>>> Professor of Music Technology
>> >> >> >> >> > >>>> NTNU
>> >> >> >> >> > >>>> 7491 Trondheim
>> >> >> >> >> > >>>> Norway
>> >> >> >> >> > >>>> Cell: +47 92 203 205
>> >> >> >> >> > >>>>
>> >> >> >> >> > >>>> http://www.partikkelaudio.com/
>> >> >> >> >> > >>>> http://crossadaptive.hf.ntnu.no
>> >> >> >> >> > >>>> http://gdsp.hf.ntnu.no/
>> >> >> >> >> > >>>> http://soundcloud.com/brandtsegg
>> >> >> >> >> > >>>> http://flyndresang.no/
>> >> >> >> >> > >>>> http://soundcloud.com/t-emp
>> >> >> >> >> > >>>>
>> >> >> >> >> > >>>> 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
>> >> >> >> >> > >>
>> >> >> >> >> > >>
>> >> >> >> >> > >>
>> >> >> >> >> > >> --
>> >> >> >> >> > >>
>> >> >> >> >> > >> Oeyvind Brandtsegg
>> >> >> >> >> > >> Professor of Music Technology
>> >> >> >> >> > >> NTNU
>> >> >> >> >> > >> 7491 Trondheim
>> >> >> >> >> > >> Norway
>> >> >> >> >> > >> Cell: +47 92 203 205
>> >> >> >> >> > >>
>> >> >> >> >> > >> http://www.partikkelaudio.com/
>> >> >> >> >> > >> http://crossadaptive.hf.ntnu.no
>> >> >> >> >> > >> http://gdsp.hf.ntnu.no/
>> >> >> >> >> > >> http://soundcloud.com/brandtsegg
>> >> >> >> >> > >> http://flyndresang.no/
>> >> >> >> >> > >> http://soundcloud.com/t-emp
>> >> >> >> >> > >>
>> >> >> >> >> > >> 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
>> >> >> >> >> >
>> >> >> >> >> >
>> >> >> >> >> >
>> >> >> >> >> > --
>> >> >> >> >> >
>> >> >> >> >> > Oeyvind Brandtsegg
>> >> >> >> >> > Professor of Music Technology
>> >> >> >> >> > NTNU
>> >> >> >> >> > 7491 Trondheim
>> >> >> >> >> > Norway
>> >> >> >> >> > Cell: +47 92 203 205
>> >> >> >> >> >
>> >> >> >> >> > http://www.partikkelaudio.com/
>> >> >> >> >> > http://crossadaptive.hf.ntnu.no
>> >> >> >> >> > http://gdsp.hf.ntnu.no/
>> >> >> >> >> > http://soundcloud.com/brandtsegg
>> >> >> >> >> > http://flyndresang.no/
>> >> >> >> >> > http://soundcloud.com/t-emp
>> >> >> >> >> >
>> >> >> >> >> > 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
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> --
>> >> >> >>
>> >> >> >> Oeyvind Brandtsegg
>> >> >> >> Professor of Music Technology
>> >> >> >> NTNU
>> >> >> >> 7491 Trondheim
>> >> >> >> Norway
>> >> >> >> Cell: +47 92 203 205
>> >> >> >>
>> >> >> >> http://www.partikkelaudio.com/
>> >> >> >> http://crossadaptive.hf.ntnu.no
>> >> >> >> http://gdsp.hf.ntnu.no/
>> >> >> >> http://soundcloud.com/brandtsegg
>> >> >> >> http://flyndresang.no/
>> >> >> >> http://soundcloud.com/t-emp
>> >> >> >>
>> >> >> >> 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
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >>
>> >> >> Oeyvind Brandtsegg
>> >> >> Professor of Music Technology
>> >> >> NTNU
>> >> >> 7491 Trondheim
>> >> >> Norway
>> >> >> Cell: +47 92 203 205
>> >> >>
>> >> >> http://www.partikkelaudio.com/
>> >> >> http://crossadaptive.hf.ntnu.no
>> >> >> http://gdsp.hf.ntnu.no/
>> >> >> http://soundcloud.com/brandtsegg
>> >> >> http://flyndresang.no/
>> >> >> http://soundcloud.com/t-emp
>> >> >>
>> >> >> 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
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Oeyvind Brandtsegg
>> >> Professor of Music Technology
>> >> NTNU
>> >> 7491 Trondheim
>> >> Norway
>> >> Cell: +47 92 203 205
>> >>
>> >> http://www.partikkelaudio.com/
>> >> http://crossadaptive.hf.ntnu.no
>> >> http://gdsp.hf.ntnu.no/
>> >> http://soundcloud.com/brandtsegg
>> >> http://flyndresang.no/
>> >> http://soundcloud.com/t-emp
>> >>
>> >> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-12-01 20:45
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
I'm looking at this in Jupyter Notebook now, and it looks and works great.
Nice work, Francios!

2016-11-08 9:52 GMT-08:00 Oeyvind Brandtsegg :
> Great, thankl you so much for the help.
> I'll probably be back with more questions shortly :-)
>
> 2016-11-07 11:08 GMT-08:00 Francois PINOT :
>> I think this is due to small floating point differences in the order of
>> 1e-04. The test for equality is not appropriate here. You should consider
>> that ctcsound is working on your system.
>>
>> François
>>
>> 2016-11-07 19:50 GMT+01:00 Oeyvind Brandtsegg :
>>>
>>> Yes, I downloaded the full repo as a zip.
>>>
>>>
>>> 2016-11-07 10:27 GMT-08:00 Francois PINOT :
>>> > Is the file "bufferInOut.csd" present in the directory you ran
>>> > test_ctcsound.py from?
>>> >
>>> > François
>>> >
>>> > 2016-11-07 19:20 GMT+01:00 Oeyvind Brandtsegg
>>> > :
>>> >>
>>> >> Ok. It is in my path,
>>> >> but now I realize that this was not the culprit,
>>> >> ...my bad. I had not copied in csnd.dll from my build dir.
>>> >>
>>> >> Now I get test_ctcsound.py to this stage:
>>> >> (...snip)
>>> >> writing 4096 sample blks of 64-bit floats to dac
>>> >> SECTION 1:
>>> >> F
>>> >> ======================================================================
>>> >> FAIL: test_inputOutputbuffer (__main__.TestGeneralIO)
>>> >> ----------------------------------------------------------------------
>>> >> Traceback (most recent call last):
>>> >>   File "test_ctcsound.py", line 78, in test_inputOutputbuffer
>>> >>     self.assertTrue(np.array_equal(obuf, ibuf/3.0))
>>> >> AssertionError: False is not true
>>> >>
>>> >> ----------------------------------------------------------------------
>>> >> Ran 6 tests in 8.216s
>>> >>
>>> >> FAILED (failures=1)
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> 2016-11-06 3:21 GMT-08:00 Francois PINOT :
>>> >> > csound64.dll should be accessible through your PATH. Normally it is
>>> >> > located
>>> >> > in "C:\Program Files\Csound_x64\bin".
>>> >> >
>>> >> > You can verify that this path is referenced in your PATH environment
>>> >> > variable with this command:
>>> >> >
>>> >> >   echo %PATH%
>>> >> >
>>> >> > If this is not the case, you'll have to add this path to your PATH
>>> >> > environment variable or to the system PATH environment variable.
>>> >> >
>>> >> > François
>>> >> >
>>> >> > 2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg
>>> >> > :
>>> >> >>
>>> >> >> Thanks,
>>> >> >> this was left cold for a while, but now I'm back on track.
>>> >> >>
>>> >> >> I get
>>> >> >>
>>> >> >> >>> import ctcsound
>>> >> >> Traceback (most recent call last):
>>> >> >>   File "", line 1, in 
>>> >> >>   File "ctcsound.py", line 2411, in 
>>> >> >>     libcspt = cdll.csnd6
>>> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 435, in
>>> >> >> __getattr__
>>> >> >>     dll = self._dlltype(name)
>>> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>>> >> >>     self._handle = _dlopen(self._name, mode)
>>> >> >> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>>> >> >>
>>> >> >> ... which I assume also relates to line 30 of ctcsound.py
>>> >> >> elif sys.platform.startswith('win'):
>>> >> >>     libcsound = cdll.csound64
>>> >> >>
>>> >> >> I understand (guess) that cdll is probably the ctypes dll, but where
>>> >> >> can I set it up so that it finds csound64?
>>> >> >>
>>> >> >> best
>>> >> >> Oeyvind
>>> >> >>
>>> >> >> 2016-10-15 3:04 GMT-07:00 Francois PINOT :
>>> >> >> > I just pushed to my github repo an example showing how to use
>>> >> >> > ctcsound
>>> >> >> > from
>>> >> >> > the py- opcodes within a running instance of Csound:
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>>> >> >> >
>>> >> >> > Notice that actually Python2 is used by default due the hardcoded
>>> >> >> > choice
>>> >> >> > of
>>> >> >> > Python when building Csound.
>>> >> >> >
>>> >> >> > François
>>> >> >> >
>>> >> >> > 2016-10-14 15:23 GMT+02:00 Victor Lazzarini
>>> >> >> > :
>>> >> >> >>
>>> >> >> >> We might need a csoundGetInstance() function or similar in
>>> >> >> >> ctcsound
>>> >> >> >> so
>>> >> >> >> that the
>>> >> >> >> opcodes can communicate with the running Csound.
>>> >> >> >>
>>> >> >> >> http://csound.github.io/docs/manual/pyinit.html
>>> >> >> >>
>>> >> >> >> > On 14 Oct 2016, at 13:56, Francois PINOT 
>>> >> >> >> > wrote:
>>> >> >> >> >
>>> >> >> >> > pyruni "import ctcsound" in global part?
>>> >> >> >> >
>>> >> >> >> > François
>>> >> >> >> >
>>> >> >> >> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>>> >> >> >> > :
>>> >> >> >> > Yes, but how to I tell Csound (the py opcodes within Csound) to
>>> >> >> >> > use
>>> >> >> >> > ctcsound ?
>>> >> >> >> >
>>> >> >> >> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini
>>> >> >> >> > :
>>> >> >> >> > > You can just install numpy.
>>> >> >> >> > >
>>> >> >> >> > > Victor Lazzarini
>>> >> >> >> > > Dean of Arts, Celtic Studies, and Philosophy
>>> >> >> >> > > Maynooth University
>>> >> >> >> > > Ireland
>>> >> >> >> > >
>>> >> >> >> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>>> >> >> >> > >>  wrote:
>>> >> >> >> > >>
>>> >> >> >> > >> Ah, now I remember, I tried this earlier and did not
>>> >> >> >> > >> complete
>>> >> >> >> > >> installing Anaconda, as it seemed like it could interfere
>>> >> >> >> > >> with
>>> >> >> >> > >> other
>>> >> >> >> > >> system variables so I backed out.
>>> >> >> >> > >> Is there a way for me to configure the environment without
>>> >> >> >> > >> installing
>>> >> >> >> > >> Anaconda? I'm in the middle of several productions, so I am
>>> >> >> >> > >> hesitant
>>> >> >> >> > >> to let an installer make automatic changes to my system.
>>> >> >> >> > >>
>>> >> >> >> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT
>>> >> >> >> > >> :
>>> >> >> >> > >>> Only numpy is mandatory.
>>> >> >> >> > >>>
>>> >> >> >> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You
>>> >> >> >> > >>> need
>>> >> >> >> > >>> an
>>> >> >> >> > >>> environment set properly for each version of Python you
>>> >> >> >> > >>> will
>>> >> >> >> > >>> use.
>>> >> >> >> > >>> Anaconda
>>> >> >> >> > >>> facilitates this, and it provides a lot of modules for
>>> >> >> >> > >>> scientific
>>> >> >> >> > >>> computing.
>>> >> >> >> > >>> Jupyter is a plus allowing you to use Csound within
>>> >> >> >> > >>> notebooks.
>>> >> >> >> > >>>
>>> >> >> >> > >>> François
>>> >> >> >> > >>>
>>> >> >> >> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>>> >> >> >> > >>> :
>>> >> >> >> > >>>>
>>> >> >> >> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just
>>> >> >> >> > >>>> followed
>>> >> >> >> > >>>> the
>>> >> >> >> > >>>> info on the list with interest, waiting to dive in.
>>> >> >> >> > >>>> Is there some instructions on how to migrate somewhere? Do
>>> >> >> >> > >>>> I
>>> >> >> >> > >>>> need
>>> >> >> >> > >>>> to
>>> >> >> >> > >>>> install Anaconda and Jupyter, or can I just replace some
>>> >> >> >> > >>>> modules
>>> >> >> >> > >>>> ?
>>> >> >> >> > >>>>
>>> >> >> >> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>>> >> >> >> > >>>> :
>>> >> >> >> > >>>>> It is possible to read a Csound ftable via the API.
>>> >> >> >> > >>>>>
>>> >> >> >> > >>>>> I'd also suggest migrating to ctcsound if you
>>> >> >> >> > >>>>> are using csnd6. It's excellent.
>>> >> >> >> > >>>>>
>>> >> >> >> > >>>>> Victor Lazzarini
>>> >> >> >> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>>> >> >> >> > >>>>> Maynooth University
>>> >> >> >> > >>>>> Ireland
>>> >> >> >> > >>>>>
>>> >> >> >> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi 
>>> >> >> >> > >>>>> wrote:
>>> >> >> >> > >>>>>
>>> >> >> >> > >>>>> Yes I think that was what I was thinking of, but I'm
>>> >> >> >> > >>>>> unsure
>>> >> >> >> > >>>>> whether it
>>> >> >> >> > >>>>> is
>>> >> >> >> > >>>>> supported now or not.
>>> >> >> >> > >>>>>
>>> >> >> >> > >>>>>
>>> >> >> >> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>>> >> >> >> > >>>>> 
>>> >> >> >> > >>>>> wrote:
>>> >> >> >> > >>>>>>
>>> >> >> >> > >>>>>> Hi all,
>>> >> >> >> > >>>>>> thanks for the suggestions.
>>> >> >> >> > >>>>>> If I can read from a csound table directly in python
>>> >> >> >> > >>>>>> code,
>>> >> >> >> > >>>>>> that
>>> >> >> >> > >>>>>> would
>>> >> >> >> > >>>>>> be the best. Steven, do you mean this document
>>> >> >> >> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>>> >> >> >> > >>>>>> There were several things in there that I did not know
>>> >> >> >> > >>>>>> about,
>>> >> >> >> > >>>>>> is
>>> >> >> >> > >>>>>> the
>>> >> >> >> > >>>>>> csound module as described there currently supported?
>>> >> >> >> > >>>>>>
>>> >> >> >> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi
>>> >> >> >> > >>>>>> :
>>> >> >> >> > >>>>>>> Have you tried ftables? I.e. Filling the table in
>>> >> >> >> > >>>>>>> Csound,
>>> >> >> >> > >>>>>>> then
>>> >> >> >> > >>>>>>> reading
>>> >> >> >> > >>>>>>> from
>>> >> >> >> > >>>>>>> the table in the python code. I seem to remember the
>>> >> >> >> > >>>>>>> python
>>> >> >> >> > >>>>>>> opcodes
>>> >> >> >> > >>>>>>> having
>>> >> >> >> > >>>>>>> access to ftables and that there was example code for
>>> >> >> >> > >>>>>>> this.
>>> >> >> >> > >>>>>>>
>>> >> >> >> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>>> >> >> >> > >>>>>>>  wrote:
>>> >> >> >> > >>>>>>>>
>>> >> >> >> > >>>>>>>> Not sure, but would --realtime switch on command line
>>> >> >> >> > >>>>>>>> help?
>>> >> >> >> > >>>>>>>> I
>>> >> >> >> > >>>>>>>> don't
>>> >> >> >> > >>>>>>>> know
>>> >> >> >> > >>>>>>>> if that puts python to other thread from audio work...
>>> >> >> >> > >>>>>>>>
>>> >> >> >> > >>>>>>>>
>>> >> >> >> > >>>>>>>> Tarmo
>>> >> >> >> > >>>>>>>>
>>> >> >> >> > >>>>>>>>
>>> >> >> >> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind
>>> >> >> >> > >>>>>>>> Brandtsegg"
>>> >> >> >> > >>>>>>>> :
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>> Hi,
>>> >> >> >> > >>>>>>>>> I need to transfer the contents of an array from
>>> >> >> >> > >>>>>>>>> Csound
>>> >> >> >> > >>>>>>>>> to
>>> >> >> >> > >>>>>>>>> Python,
>>> >> >> >> > >>>>>>>>> as
>>> >> >> >> > >>>>>>>>> I want to do some peak picking and other analysis
>>> >> >> >> > >>>>>>>>> that
>>> >> >> >> > >>>>>>>>> is
>>> >> >> >> > >>>>>>>>> easier to
>>> >> >> >> > >>>>>>>>> get done in Python. The problem is that my
>>> >> >> >> > >>>>>>>>> (admittedly
>>> >> >> >> > >>>>>>>>> ad
>>> >> >> >> > >>>>>>>>> hoc)
>>> >> >> >> > >>>>>>>>> method
>>> >> >> >> > >>>>>>>>> of transferring the values from Csound to Python
>>> >> >> >> > >>>>>>>>> incurs
>>> >> >> >> > >>>>>>>>> significant
>>> >> >> >> > >>>>>>>>> performance degradation (more details on how I
>>> >> >> >> > >>>>>>>>> measure
>>> >> >> >> > >>>>>>>>> this
>>> >> >> >> > >>>>>>>>> later
>>> >> >> >> > >>>>>>>>> in
>>> >> >> >> > >>>>>>>>> this email).
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>> The basic premise is that I need Csound to be the
>>> >> >> >> > >>>>>>>>> main
>>> >> >> >> > >>>>>>>>> program
>>> >> >> >> > >>>>>>>>> (the
>>> >> >> >> > >>>>>>>>> host), and Python runs via the py opcodes.
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to
>>> >> >> >> > >>>>>>>>> be
>>> >> >> >> > >>>>>>>>> done
>>> >> >> >> > >>>>>>>>> once
>>> >> >> >> > >>>>>>>>> every 1 second, for 3 of these arrays. One should
>>> >> >> >> > >>>>>>>>> think
>>> >> >> >> > >>>>>>>>> the
>>> >> >> >> > >>>>>>>>> bandwidth
>>> >> >> >> > >>>>>>>>> requirement are not too taxing on any system, but
>>> >> >> >> > >>>>>>>>> since
>>> >> >> >> > >>>>>>>>> I
>>> >> >> >> > >>>>>>>>> only
>>> >> >> >> > >>>>>>>>> send
>>> >> >> >> > >>>>>>>>> single values, there are more than 700 pycalls
>>> >> >> >> > >>>>>>>>> happening
>>> >> >> >> > >>>>>>>>> in
>>> >> >> >> > >>>>>>>>> one
>>> >> >> >> > >>>>>>>>> k-rate
>>> >> >> >> > >>>>>>>>> pass.
>>> >> >> >> > >>>>>>>>> The python function "p.fill_array" does nothing but
>>> >> >> >> > >>>>>>>>> put
>>> >> >> >> > >>>>>>>>> the
>>> >> >> >> > >>>>>>>>> received
>>> >> >> >> > >>>>>>>>> values one by one into a numpy array.
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>>  kcnt_fill = 0
>>> >> >> >> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>>> >> >> >> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill],
>>> >> >> >> > >>>>>>>>> kcnt_fill,
>>> >> >> >> > >>>>>>>>> ifftsize/2
>>> >> >> >> > >>>>>>>>>    kcnt_fill += 1
>>> >> >> >> > >>>>>>>>>  od
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>> By performance degradation I mean that the operation
>>> >> >> >> > >>>>>>>>> seems
>>> >> >> >> > >>>>>>>>> to
>>> >> >> >> > >>>>>>>>> let
>>> >> >> >> > >>>>>>>>> the
>>> >> >> >> > >>>>>>>>> different processes to wait for each other a lot,
>>> >> >> >> > >>>>>>>>> utlimately
>>> >> >> >> > >>>>>>>>> leading
>>> >> >> >> > >>>>>>>>> to dropouts in realtime audio. This does not show up
>>> >> >> >> > >>>>>>>>> as
>>> >> >> >> > >>>>>>>>> CPU
>>> >> >> >> > >>>>>>>>> spikes
>>> >> >> >> > >>>>>>>>> (running at around 50%), but shows in Reaper's
>>> >> >> >> > >>>>>>>>> performence
>>> >> >> >> > >>>>>>>>> meter as
>>> >> >> >> > >>>>>>>>> "RT longest-block". This meter shows the number of
>>> >> >> >> > >>>>>>>>> milliseconds
>>> >> >> >> > >>>>>>>>> used/available per audio processing block. The *used*
>>> >> >> >> > >>>>>>>>> must
>>> >> >> >> > >>>>>>>>> generally
>>> >> >> >> > >>>>>>>>> be less than the *available* time to avoid dropouts.
>>> >> >> >> > >>>>>>>>> Some
>>> >> >> >> > >>>>>>>>> spikes
>>> >> >> >> > >>>>>>>>> are
>>> >> >> >> > >>>>>>>>> not necessarily bad, but in my case the *used* is
>>> >> >> >> > >>>>>>>>> generally
>>> >> >> >> > >>>>>>>>> quite
>>> >> >> >> > >>>>>>>>> stable and higher than the *available*, unless I
>>> >> >> >> > >>>>>>>>> comment
>>> >> >> >> > >>>>>>>>> out
>>> >> >> >> > >>>>>>>>> the
>>> >> >> >> > >>>>>>>>> code
>>> >> >> >> > >>>>>>>>> excerpt given above.
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>> Is there any way I can send an array from Csound to
>>> >> >> >> > >>>>>>>>> Python
>>> >> >> >> > >>>>>>>>> in
>>> >> >> >> > >>>>>>>>> one
>>> >> >> >> > >>>>>>>>> go?
>>> >> >> >> > >>>>>>>>> I seem to remember some black magic about letting
>>> >> >> >> > >>>>>>>>> Python
>>> >> >> >> > >>>>>>>>> running
>>> >> >> >> > >>>>>>>>> under
>>> >> >> >> > >>>>>>>>> Csound get access to the (host) csound instance and
>>> >> >> >> > >>>>>>>>> thus
>>> >> >> >> > >>>>>>>>> accessing
>>> >> >> >> > >>>>>>>>> the
>>> >> >> >> > >>>>>>>>> Csound API. Would that be the best way to do it, and
>>> >> >> >> > >>>>>>>>> would
>>> >> >> >> > >>>>>>>>> it
>>> >> >> >> > >>>>>>>>> be
>>> >> >> >> > >>>>>>>>> considered a safe way of doing it?
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>> best
>>> >> >> >> > >>>>>>>>> Oeyvind
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>> --
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>> Oeyvind Brandtsegg
>>> >> >> >> > >>>>>>>>> Professor of Music Technology
>>> >> >> >> > >>>>>>>>> NTNU
>>> >> >> >> > >>>>>>>>> 7491 Trondheim
>>> >> >> >> > >>>>>>>>> Norway
>>> >> >> >> > >>>>>>>>> Cell: +47 92 203 205
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>> http://www.partikkelaudio.com/
>>> >> >> >> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>>> >> >> >> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>>> >> >> >> > >>>>>>>>> http://soundcloud.com/brandtsegg
>>> >> >> >> > >>>>>>>>> http://flyndresang.no/
>>> >> >> >> > >>>>>>>>> http://soundcloud.com/t-emp
>>> >> >> >> > >>>>>>>>>
>>> >> >> >> > >>>>>>>>> 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
>>> >> >> >> > >>>>>>
>>> >> >> >> > >>>>>>
>>> >> >> >> > >>>>>>
>>> >> >> >> > >>>>>> --
>>> >> >> >> > >>>>>>
>>> >> >> >> > >>>>>> Oeyvind Brandtsegg
>>> >> >> >> > >>>>>> Professor of Music Technology
>>> >> >> >> > >>>>>> NTNU
>>> >> >> >> > >>>>>> 7491 Trondheim
>>> >> >> >> > >>>>>> Norway
>>> >> >> >> > >>>>>> Cell: +47 92 203 205
>>> >> >> >> > >>>>>>
>>> >> >> >> > >>>>>> http://www.partikkelaudio.com/
>>> >> >> >> > >>>>>> http://crossadaptive.hf.ntnu.no
>>> >> >> >> > >>>>>> http://gdsp.hf.ntnu.no/
>>> >> >> >> > >>>>>> http://soundcloud.com/brandtsegg
>>> >> >> >> > >>>>>> http://flyndresang.no/
>>> >> >> >> > >>>>>> http://soundcloud.com/t-emp
>>> >> >> >> > >>>>>>
>>> >> >> >> > >>>>>> 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
>>> >> >> >> > >>>>
>>> >> >> >> > >>>>
>>> >> >> >> > >>>>
>>> >> >> >> > >>>> --
>>> >> >> >> > >>>>
>>> >> >> >> > >>>> Oeyvind Brandtsegg
>>> >> >> >> > >>>> Professor of Music Technology
>>> >> >> >> > >>>> NTNU
>>> >> >> >> > >>>> 7491 Trondheim
>>> >> >> >> > >>>> Norway
>>> >> >> >> > >>>> Cell: +47 92 203 205
>>> >> >> >> > >>>>
>>> >> >> >> > >>>> http://www.partikkelaudio.com/
>>> >> >> >> > >>>> http://crossadaptive.hf.ntnu.no
>>> >> >> >> > >>>> http://gdsp.hf.ntnu.no/
>>> >> >> >> > >>>> http://soundcloud.com/brandtsegg
>>> >> >> >> > >>>> http://flyndresang.no/
>>> >> >> >> > >>>> http://soundcloud.com/t-emp
>>> >> >> >> > >>>>
>>> >> >> >> > >>>> 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
>>> >> >> >> > >>
>>> >> >> >> > >>
>>> >> >> >> > >>
>>> >> >> >> > >> --
>>> >> >> >> > >>
>>> >> >> >> > >> Oeyvind Brandtsegg
>>> >> >> >> > >> Professor of Music Technology
>>> >> >> >> > >> NTNU
>>> >> >> >> > >> 7491 Trondheim
>>> >> >> >> > >> Norway
>>> >> >> >> > >> Cell: +47 92 203 205
>>> >> >> >> > >>
>>> >> >> >> > >> http://www.partikkelaudio.com/
>>> >> >> >> > >> http://crossadaptive.hf.ntnu.no
>>> >> >> >> > >> http://gdsp.hf.ntnu.no/
>>> >> >> >> > >> http://soundcloud.com/brandtsegg
>>> >> >> >> > >> http://flyndresang.no/
>>> >> >> >> > >> http://soundcloud.com/t-emp
>>> >> >> >> > >>
>>> >> >> >> > >> 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
>>> >> >> >> >
>>> >> >> >> >
>>> >> >> >> >
>>> >> >> >> > --
>>> >> >> >> >
>>> >> >> >> > Oeyvind Brandtsegg
>>> >> >> >> > Professor of Music Technology
>>> >> >> >> > NTNU
>>> >> >> >> > 7491 Trondheim
>>> >> >> >> > Norway
>>> >> >> >> > Cell: +47 92 203 205
>>> >> >> >> >
>>> >> >> >> > http://www.partikkelaudio.com/
>>> >> >> >> > http://crossadaptive.hf.ntnu.no
>>> >> >> >> > http://gdsp.hf.ntnu.no/
>>> >> >> >> > http://soundcloud.com/brandtsegg
>>> >> >> >> > http://flyndresang.no/
>>> >> >> >> > http://soundcloud.com/t-emp
>>> >> >> >> >
>>> >> >> >> > 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
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >> --
>>> >> >>
>>> >> >> Oeyvind Brandtsegg
>>> >> >> Professor of Music Technology
>>> >> >> NTNU
>>> >> >> 7491 Trondheim
>>> >> >> Norway
>>> >> >> Cell: +47 92 203 205
>>> >> >>
>>> >> >> http://www.partikkelaudio.com/
>>> >> >> http://crossadaptive.hf.ntnu.no
>>> >> >> http://gdsp.hf.ntnu.no/
>>> >> >> http://soundcloud.com/brandtsegg
>>> >> >> http://flyndresang.no/
>>> >> >> http://soundcloud.com/t-emp
>>> >> >>
>>> >> >> 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
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >>
>>> >> Oeyvind Brandtsegg
>>> >> Professor of Music Technology
>>> >> NTNU
>>> >> 7491 Trondheim
>>> >> Norway
>>> >> Cell: +47 92 203 205
>>> >>
>>> >> http://www.partikkelaudio.com/
>>> >> http://crossadaptive.hf.ntnu.no
>>> >> http://gdsp.hf.ntnu.no/
>>> >> http://soundcloud.com/brandtsegg
>>> >> http://flyndresang.no/
>>> >> http://soundcloud.com/t-emp
>>> >>
>>> >> 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
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> 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
>
>
>
> --
>
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
>
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-12-01 20:56
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
One minor problem remaining though, when I try to run
embeddedCtcsound.csd, I get errors.
The error seems to be related to
import ctcsound
as run within the csd.

I can run
import ctcsound
in a python interpreter, or in IPython or Jupyter.

But when I run it within a csd, like this:
pyinit
pyruni {{
import ctcsound
}}
... I get:
pyruni: python exception
Traceback (most recent call last):
  File "", line 2, in 
  File "C:\Users\Administrator\AppData\Roaming\Python\Python27\site-packages\ctcsound.py",
line 24, in 
    from ctypes import *
  File "C:\Python27\Lib\ctypes\__init__.py", line 10, in 
    from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes

I recognize some similarity to another issue I had with paths being
different when Python is run through different interfaces (commandline
python ,or pyinit within a csd),
but I'm unsure as to what I need to set the path to, .. what to add to
the path in this case.

2016-12-01 12:45 GMT-08:00 Oeyvind Brandtsegg :
> I'm looking at this in Jupyter Notebook now, and it looks and works great.
> Nice work, Francios!
>
> 2016-11-08 9:52 GMT-08:00 Oeyvind Brandtsegg :
>> Great, thankl you so much for the help.
>> I'll probably be back with more questions shortly :-)
>>
>> 2016-11-07 11:08 GMT-08:00 Francois PINOT :
>>> I think this is due to small floating point differences in the order of
>>> 1e-04. The test for equality is not appropriate here. You should consider
>>> that ctcsound is working on your system.
>>>
>>> François
>>>
>>> 2016-11-07 19:50 GMT+01:00 Oeyvind Brandtsegg :
>>>>
>>>> Yes, I downloaded the full repo as a zip.
>>>>
>>>>
>>>> 2016-11-07 10:27 GMT-08:00 Francois PINOT :
>>>> > Is the file "bufferInOut.csd" present in the directory you ran
>>>> > test_ctcsound.py from?
>>>> >
>>>> > François
>>>> >
>>>> > 2016-11-07 19:20 GMT+01:00 Oeyvind Brandtsegg
>>>> > :
>>>> >>
>>>> >> Ok. It is in my path,
>>>> >> but now I realize that this was not the culprit,
>>>> >> ...my bad. I had not copied in csnd.dll from my build dir.
>>>> >>
>>>> >> Now I get test_ctcsound.py to this stage:
>>>> >> (...snip)
>>>> >> writing 4096 sample blks of 64-bit floats to dac
>>>> >> SECTION 1:
>>>> >> F
>>>> >> ======================================================================
>>>> >> FAIL: test_inputOutputbuffer (__main__.TestGeneralIO)
>>>> >> ----------------------------------------------------------------------
>>>> >> Traceback (most recent call last):
>>>> >>   File "test_ctcsound.py", line 78, in test_inputOutputbuffer
>>>> >>     self.assertTrue(np.array_equal(obuf, ibuf/3.0))
>>>> >> AssertionError: False is not true
>>>> >>
>>>> >> ----------------------------------------------------------------------
>>>> >> Ran 6 tests in 8.216s
>>>> >>
>>>> >> FAILED (failures=1)
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >> 2016-11-06 3:21 GMT-08:00 Francois PINOT :
>>>> >> > csound64.dll should be accessible through your PATH. Normally it is
>>>> >> > located
>>>> >> > in "C:\Program Files\Csound_x64\bin".
>>>> >> >
>>>> >> > You can verify that this path is referenced in your PATH environment
>>>> >> > variable with this command:
>>>> >> >
>>>> >> >   echo %PATH%
>>>> >> >
>>>> >> > If this is not the case, you'll have to add this path to your PATH
>>>> >> > environment variable or to the system PATH environment variable.
>>>> >> >
>>>> >> > François
>>>> >> >
>>>> >> > 2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg
>>>> >> > :
>>>> >> >>
>>>> >> >> Thanks,
>>>> >> >> this was left cold for a while, but now I'm back on track.
>>>> >> >>
>>>> >> >> I get
>>>> >> >>
>>>> >> >> >>> import ctcsound
>>>> >> >> Traceback (most recent call last):
>>>> >> >>   File "", line 1, in 
>>>> >> >>   File "ctcsound.py", line 2411, in 
>>>> >> >>     libcspt = cdll.csnd6
>>>> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 435, in
>>>> >> >> __getattr__
>>>> >> >>     dll = self._dlltype(name)
>>>> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>>>> >> >>     self._handle = _dlopen(self._name, mode)
>>>> >> >> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>>>> >> >>
>>>> >> >> ... which I assume also relates to line 30 of ctcsound.py
>>>> >> >> elif sys.platform.startswith('win'):
>>>> >> >>     libcsound = cdll.csound64
>>>> >> >>
>>>> >> >> I understand (guess) that cdll is probably the ctypes dll, but where
>>>> >> >> can I set it up so that it finds csound64?
>>>> >> >>
>>>> >> >> best
>>>> >> >> Oeyvind
>>>> >> >>
>>>> >> >> 2016-10-15 3:04 GMT-07:00 Francois PINOT :
>>>> >> >> > I just pushed to my github repo an example showing how to use
>>>> >> >> > ctcsound
>>>> >> >> > from
>>>> >> >> > the py- opcodes within a running instance of Csound:
>>>> >> >> >
>>>> >> >> >
>>>> >> >> >
>>>> >> >> >
>>>> >> >> >
>>>> >> >> > https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>>>> >> >> >
>>>> >> >> > Notice that actually Python2 is used by default due the hardcoded
>>>> >> >> > choice
>>>> >> >> > of
>>>> >> >> > Python when building Csound.
>>>> >> >> >
>>>> >> >> > François
>>>> >> >> >
>>>> >> >> > 2016-10-14 15:23 GMT+02:00 Victor Lazzarini
>>>> >> >> > :
>>>> >> >> >>
>>>> >> >> >> We might need a csoundGetInstance() function or similar in
>>>> >> >> >> ctcsound
>>>> >> >> >> so
>>>> >> >> >> that the
>>>> >> >> >> opcodes can communicate with the running Csound.
>>>> >> >> >>
>>>> >> >> >> http://csound.github.io/docs/manual/pyinit.html
>>>> >> >> >>
>>>> >> >> >> > On 14 Oct 2016, at 13:56, Francois PINOT 
>>>> >> >> >> > wrote:
>>>> >> >> >> >
>>>> >> >> >> > pyruni "import ctcsound" in global part?
>>>> >> >> >> >
>>>> >> >> >> > François
>>>> >> >> >> >
>>>> >> >> >> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>>>> >> >> >> > :
>>>> >> >> >> > Yes, but how to I tell Csound (the py opcodes within Csound) to
>>>> >> >> >> > use
>>>> >> >> >> > ctcsound ?
>>>> >> >> >> >
>>>> >> >> >> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini
>>>> >> >> >> > :
>>>> >> >> >> > > You can just install numpy.
>>>> >> >> >> > >
>>>> >> >> >> > > Victor Lazzarini
>>>> >> >> >> > > Dean of Arts, Celtic Studies, and Philosophy
>>>> >> >> >> > > Maynooth University
>>>> >> >> >> > > Ireland
>>>> >> >> >> > >
>>>> >> >> >> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>>>> >> >> >> > >>  wrote:
>>>> >> >> >> > >>
>>>> >> >> >> > >> Ah, now I remember, I tried this earlier and did not
>>>> >> >> >> > >> complete
>>>> >> >> >> > >> installing Anaconda, as it seemed like it could interfere
>>>> >> >> >> > >> with
>>>> >> >> >> > >> other
>>>> >> >> >> > >> system variables so I backed out.
>>>> >> >> >> > >> Is there a way for me to configure the environment without
>>>> >> >> >> > >> installing
>>>> >> >> >> > >> Anaconda? I'm in the middle of several productions, so I am
>>>> >> >> >> > >> hesitant
>>>> >> >> >> > >> to let an installer make automatic changes to my system.
>>>> >> >> >> > >>
>>>> >> >> >> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT
>>>> >> >> >> > >> :
>>>> >> >> >> > >>> Only numpy is mandatory.
>>>> >> >> >> > >>>
>>>> >> >> >> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You
>>>> >> >> >> > >>> need
>>>> >> >> >> > >>> an
>>>> >> >> >> > >>> environment set properly for each version of Python you
>>>> >> >> >> > >>> will
>>>> >> >> >> > >>> use.
>>>> >> >> >> > >>> Anaconda
>>>> >> >> >> > >>> facilitates this, and it provides a lot of modules for
>>>> >> >> >> > >>> scientific
>>>> >> >> >> > >>> computing.
>>>> >> >> >> > >>> Jupyter is a plus allowing you to use Csound within
>>>> >> >> >> > >>> notebooks.
>>>> >> >> >> > >>>
>>>> >> >> >> > >>> François
>>>> >> >> >> > >>>
>>>> >> >> >> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>>>> >> >> >> > >>> :
>>>> >> >> >> > >>>>
>>>> >> >> >> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just
>>>> >> >> >> > >>>> followed
>>>> >> >> >> > >>>> the
>>>> >> >> >> > >>>> info on the list with interest, waiting to dive in.
>>>> >> >> >> > >>>> Is there some instructions on how to migrate somewhere? Do
>>>> >> >> >> > >>>> I
>>>> >> >> >> > >>>> need
>>>> >> >> >> > >>>> to
>>>> >> >> >> > >>>> install Anaconda and Jupyter, or can I just replace some
>>>> >> >> >> > >>>> modules
>>>> >> >> >> > >>>> ?
>>>> >> >> >> > >>>>
>>>> >> >> >> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>>>> >> >> >> > >>>> :
>>>> >> >> >> > >>>>> It is possible to read a Csound ftable via the API.
>>>> >> >> >> > >>>>>
>>>> >> >> >> > >>>>> I'd also suggest migrating to ctcsound if you
>>>> >> >> >> > >>>>> are using csnd6. It's excellent.
>>>> >> >> >> > >>>>>
>>>> >> >> >> > >>>>> Victor Lazzarini
>>>> >> >> >> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>> >> >> >> > >>>>> Maynooth University
>>>> >> >> >> > >>>>> Ireland
>>>> >> >> >> > >>>>>
>>>> >> >> >> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi 
>>>> >> >> >> > >>>>> wrote:
>>>> >> >> >> > >>>>>
>>>> >> >> >> > >>>>> Yes I think that was what I was thinking of, but I'm
>>>> >> >> >> > >>>>> unsure
>>>> >> >> >> > >>>>> whether it
>>>> >> >> >> > >>>>> is
>>>> >> >> >> > >>>>> supported now or not.
>>>> >> >> >> > >>>>>
>>>> >> >> >> > >>>>>
>>>> >> >> >> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>>>> >> >> >> > >>>>> 
>>>> >> >> >> > >>>>> wrote:
>>>> >> >> >> > >>>>>>
>>>> >> >> >> > >>>>>> Hi all,
>>>> >> >> >> > >>>>>> thanks for the suggestions.
>>>> >> >> >> > >>>>>> If I can read from a csound table directly in python
>>>> >> >> >> > >>>>>> code,
>>>> >> >> >> > >>>>>> that
>>>> >> >> >> > >>>>>> would
>>>> >> >> >> > >>>>>> be the best. Steven, do you mean this document
>>>> >> >> >> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>>>> >> >> >> > >>>>>> There were several things in there that I did not know
>>>> >> >> >> > >>>>>> about,
>>>> >> >> >> > >>>>>> is
>>>> >> >> >> > >>>>>> the
>>>> >> >> >> > >>>>>> csound module as described there currently supported?
>>>> >> >> >> > >>>>>>
>>>> >> >> >> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi
>>>> >> >> >> > >>>>>> :
>>>> >> >> >> > >>>>>>> Have you tried ftables? I.e. Filling the table in
>>>> >> >> >> > >>>>>>> Csound,
>>>> >> >> >> > >>>>>>> then
>>>> >> >> >> > >>>>>>> reading
>>>> >> >> >> > >>>>>>> from
>>>> >> >> >> > >>>>>>> the table in the python code. I seem to remember the
>>>> >> >> >> > >>>>>>> python
>>>> >> >> >> > >>>>>>> opcodes
>>>> >> >> >> > >>>>>>> having
>>>> >> >> >> > >>>>>>> access to ftables and that there was example code for
>>>> >> >> >> > >>>>>>> this.
>>>> >> >> >> > >>>>>>>
>>>> >> >> >> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>>>> >> >> >> > >>>>>>>  wrote:
>>>> >> >> >> > >>>>>>>>
>>>> >> >> >> > >>>>>>>> Not sure, but would --realtime switch on command line
>>>> >> >> >> > >>>>>>>> help?
>>>> >> >> >> > >>>>>>>> I
>>>> >> >> >> > >>>>>>>> don't
>>>> >> >> >> > >>>>>>>> know
>>>> >> >> >> > >>>>>>>> if that puts python to other thread from audio work...
>>>> >> >> >> > >>>>>>>>
>>>> >> >> >> > >>>>>>>>
>>>> >> >> >> > >>>>>>>> Tarmo
>>>> >> >> >> > >>>>>>>>
>>>> >> >> >> > >>>>>>>>
>>>> >> >> >> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind
>>>> >> >> >> > >>>>>>>> Brandtsegg"
>>>> >> >> >> > >>>>>>>> :
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>> Hi,
>>>> >> >> >> > >>>>>>>>> I need to transfer the contents of an array from
>>>> >> >> >> > >>>>>>>>> Csound
>>>> >> >> >> > >>>>>>>>> to
>>>> >> >> >> > >>>>>>>>> Python,
>>>> >> >> >> > >>>>>>>>> as
>>>> >> >> >> > >>>>>>>>> I want to do some peak picking and other analysis
>>>> >> >> >> > >>>>>>>>> that
>>>> >> >> >> > >>>>>>>>> is
>>>> >> >> >> > >>>>>>>>> easier to
>>>> >> >> >> > >>>>>>>>> get done in Python. The problem is that my
>>>> >> >> >> > >>>>>>>>> (admittedly
>>>> >> >> >> > >>>>>>>>> ad
>>>> >> >> >> > >>>>>>>>> hoc)
>>>> >> >> >> > >>>>>>>>> method
>>>> >> >> >> > >>>>>>>>> of transferring the values from Csound to Python
>>>> >> >> >> > >>>>>>>>> incurs
>>>> >> >> >> > >>>>>>>>> significant
>>>> >> >> >> > >>>>>>>>> performance degradation (more details on how I
>>>> >> >> >> > >>>>>>>>> measure
>>>> >> >> >> > >>>>>>>>> this
>>>> >> >> >> > >>>>>>>>> later
>>>> >> >> >> > >>>>>>>>> in
>>>> >> >> >> > >>>>>>>>> this email).
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>> The basic premise is that I need Csound to be the
>>>> >> >> >> > >>>>>>>>> main
>>>> >> >> >> > >>>>>>>>> program
>>>> >> >> >> > >>>>>>>>> (the
>>>> >> >> >> > >>>>>>>>> host), and Python runs via the py opcodes.
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to
>>>> >> >> >> > >>>>>>>>> be
>>>> >> >> >> > >>>>>>>>> done
>>>> >> >> >> > >>>>>>>>> once
>>>> >> >> >> > >>>>>>>>> every 1 second, for 3 of these arrays. One should
>>>> >> >> >> > >>>>>>>>> think
>>>> >> >> >> > >>>>>>>>> the
>>>> >> >> >> > >>>>>>>>> bandwidth
>>>> >> >> >> > >>>>>>>>> requirement are not too taxing on any system, but
>>>> >> >> >> > >>>>>>>>> since
>>>> >> >> >> > >>>>>>>>> I
>>>> >> >> >> > >>>>>>>>> only
>>>> >> >> >> > >>>>>>>>> send
>>>> >> >> >> > >>>>>>>>> single values, there are more than 700 pycalls
>>>> >> >> >> > >>>>>>>>> happening
>>>> >> >> >> > >>>>>>>>> in
>>>> >> >> >> > >>>>>>>>> one
>>>> >> >> >> > >>>>>>>>> k-rate
>>>> >> >> >> > >>>>>>>>> pass.
>>>> >> >> >> > >>>>>>>>> The python function "p.fill_array" does nothing but
>>>> >> >> >> > >>>>>>>>> put
>>>> >> >> >> > >>>>>>>>> the
>>>> >> >> >> > >>>>>>>>> received
>>>> >> >> >> > >>>>>>>>> values one by one into a numpy array.
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>>  kcnt_fill = 0
>>>> >> >> >> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>>>> >> >> >> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill],
>>>> >> >> >> > >>>>>>>>> kcnt_fill,
>>>> >> >> >> > >>>>>>>>> ifftsize/2
>>>> >> >> >> > >>>>>>>>>    kcnt_fill += 1
>>>> >> >> >> > >>>>>>>>>  od
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>> By performance degradation I mean that the operation
>>>> >> >> >> > >>>>>>>>> seems
>>>> >> >> >> > >>>>>>>>> to
>>>> >> >> >> > >>>>>>>>> let
>>>> >> >> >> > >>>>>>>>> the
>>>> >> >> >> > >>>>>>>>> different processes to wait for each other a lot,
>>>> >> >> >> > >>>>>>>>> utlimately
>>>> >> >> >> > >>>>>>>>> leading
>>>> >> >> >> > >>>>>>>>> to dropouts in realtime audio. This does not show up
>>>> >> >> >> > >>>>>>>>> as
>>>> >> >> >> > >>>>>>>>> CPU
>>>> >> >> >> > >>>>>>>>> spikes
>>>> >> >> >> > >>>>>>>>> (running at around 50%), but shows in Reaper's
>>>> >> >> >> > >>>>>>>>> performence
>>>> >> >> >> > >>>>>>>>> meter as
>>>> >> >> >> > >>>>>>>>> "RT longest-block". This meter shows the number of
>>>> >> >> >> > >>>>>>>>> milliseconds
>>>> >> >> >> > >>>>>>>>> used/available per audio processing block. The *used*
>>>> >> >> >> > >>>>>>>>> must
>>>> >> >> >> > >>>>>>>>> generally
>>>> >> >> >> > >>>>>>>>> be less than the *available* time to avoid dropouts.
>>>> >> >> >> > >>>>>>>>> Some
>>>> >> >> >> > >>>>>>>>> spikes
>>>> >> >> >> > >>>>>>>>> are
>>>> >> >> >> > >>>>>>>>> not necessarily bad, but in my case the *used* is
>>>> >> >> >> > >>>>>>>>> generally
>>>> >> >> >> > >>>>>>>>> quite
>>>> >> >> >> > >>>>>>>>> stable and higher than the *available*, unless I
>>>> >> >> >> > >>>>>>>>> comment
>>>> >> >> >> > >>>>>>>>> out
>>>> >> >> >> > >>>>>>>>> the
>>>> >> >> >> > >>>>>>>>> code
>>>> >> >> >> > >>>>>>>>> excerpt given above.
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>> Is there any way I can send an array from Csound to
>>>> >> >> >> > >>>>>>>>> Python
>>>> >> >> >> > >>>>>>>>> in
>>>> >> >> >> > >>>>>>>>> one
>>>> >> >> >> > >>>>>>>>> go?
>>>> >> >> >> > >>>>>>>>> I seem to remember some black magic about letting
>>>> >> >> >> > >>>>>>>>> Python
>>>> >> >> >> > >>>>>>>>> running
>>>> >> >> >> > >>>>>>>>> under
>>>> >> >> >> > >>>>>>>>> Csound get access to the (host) csound instance and
>>>> >> >> >> > >>>>>>>>> thus
>>>> >> >> >> > >>>>>>>>> accessing
>>>> >> >> >> > >>>>>>>>> the
>>>> >> >> >> > >>>>>>>>> Csound API. Would that be the best way to do it, and
>>>> >> >> >> > >>>>>>>>> would
>>>> >> >> >> > >>>>>>>>> it
>>>> >> >> >> > >>>>>>>>> be
>>>> >> >> >> > >>>>>>>>> considered a safe way of doing it?
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>> best
>>>> >> >> >> > >>>>>>>>> Oeyvind
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>> --
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>> Oeyvind Brandtsegg
>>>> >> >> >> > >>>>>>>>> Professor of Music Technology
>>>> >> >> >> > >>>>>>>>> NTNU
>>>> >> >> >> > >>>>>>>>> 7491 Trondheim
>>>> >> >> >> > >>>>>>>>> Norway
>>>> >> >> >> > >>>>>>>>> Cell: +47 92 203 205
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>> http://www.partikkelaudio.com/
>>>> >> >> >> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>> >> >> >> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>>>> >> >> >> > >>>>>>>>> http://soundcloud.com/brandtsegg
>>>> >> >> >> > >>>>>>>>> http://flyndresang.no/
>>>> >> >> >> > >>>>>>>>> http://soundcloud.com/t-emp
>>>> >> >> >> > >>>>>>>>>
>>>> >> >> >> > >>>>>>>>> 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
>>>> >> >> >> > >>>>>>
>>>> >> >> >> > >>>>>>
>>>> >> >> >> > >>>>>>
>>>> >> >> >> > >>>>>> --
>>>> >> >> >> > >>>>>>
>>>> >> >> >> > >>>>>> Oeyvind Brandtsegg
>>>> >> >> >> > >>>>>> Professor of Music Technology
>>>> >> >> >> > >>>>>> NTNU
>>>> >> >> >> > >>>>>> 7491 Trondheim
>>>> >> >> >> > >>>>>> Norway
>>>> >> >> >> > >>>>>> Cell: +47 92 203 205
>>>> >> >> >> > >>>>>>
>>>> >> >> >> > >>>>>> http://www.partikkelaudio.com/
>>>> >> >> >> > >>>>>> http://crossadaptive.hf.ntnu.no
>>>> >> >> >> > >>>>>> http://gdsp.hf.ntnu.no/
>>>> >> >> >> > >>>>>> http://soundcloud.com/brandtsegg
>>>> >> >> >> > >>>>>> http://flyndresang.no/
>>>> >> >> >> > >>>>>> http://soundcloud.com/t-emp
>>>> >> >> >> > >>>>>>
>>>> >> >> >> > >>>>>> 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
>>>> >> >> >> > >>>>
>>>> >> >> >> > >>>>
>>>> >> >> >> > >>>>
>>>> >> >> >> > >>>> --
>>>> >> >> >> > >>>>
>>>> >> >> >> > >>>> Oeyvind Brandtsegg
>>>> >> >> >> > >>>> Professor of Music Technology
>>>> >> >> >> > >>>> NTNU
>>>> >> >> >> > >>>> 7491 Trondheim
>>>> >> >> >> > >>>> Norway
>>>> >> >> >> > >>>> Cell: +47 92 203 205
>>>> >> >> >> > >>>>
>>>> >> >> >> > >>>> http://www.partikkelaudio.com/
>>>> >> >> >> > >>>> http://crossadaptive.hf.ntnu.no
>>>> >> >> >> > >>>> http://gdsp.hf.ntnu.no/
>>>> >> >> >> > >>>> http://soundcloud.com/brandtsegg
>>>> >> >> >> > >>>> http://flyndresang.no/
>>>> >> >> >> > >>>> http://soundcloud.com/t-emp
>>>> >> >> >> > >>>>
>>>> >> >> >> > >>>> 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
>>>> >> >> >> > >>
>>>> >> >> >> > >>
>>>> >> >> >> > >>
>>>> >> >> >> > >> --
>>>> >> >> >> > >>
>>>> >> >> >> > >> Oeyvind Brandtsegg
>>>> >> >> >> > >> Professor of Music Technology
>>>> >> >> >> > >> NTNU
>>>> >> >> >> > >> 7491 Trondheim
>>>> >> >> >> > >> Norway
>>>> >> >> >> > >> Cell: +47 92 203 205
>>>> >> >> >> > >>
>>>> >> >> >> > >> http://www.partikkelaudio.com/
>>>> >> >> >> > >> http://crossadaptive.hf.ntnu.no
>>>> >> >> >> > >> http://gdsp.hf.ntnu.no/
>>>> >> >> >> > >> http://soundcloud.com/brandtsegg
>>>> >> >> >> > >> http://flyndresang.no/
>>>> >> >> >> > >> http://soundcloud.com/t-emp
>>>> >> >> >> > >>
>>>> >> >> >> > >> 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
>>>> >> >> >> >
>>>> >> >> >> >
>>>> >> >> >> >
>>>> >> >> >> > --
>>>> >> >> >> >
>>>> >> >> >> > Oeyvind Brandtsegg
>>>> >> >> >> > Professor of Music Technology
>>>> >> >> >> > NTNU
>>>> >> >> >> > 7491 Trondheim
>>>> >> >> >> > Norway
>>>> >> >> >> > Cell: +47 92 203 205
>>>> >> >> >> >
>>>> >> >> >> > http://www.partikkelaudio.com/
>>>> >> >> >> > http://crossadaptive.hf.ntnu.no
>>>> >> >> >> > http://gdsp.hf.ntnu.no/
>>>> >> >> >> > http://soundcloud.com/brandtsegg
>>>> >> >> >> > http://flyndresang.no/
>>>> >> >> >> > http://soundcloud.com/t-emp
>>>> >> >> >> >
>>>> >> >> >> > 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
>>>> >> >>
>>>> >> >>
>>>> >> >>
>>>> >> >> --
>>>> >> >>
>>>> >> >> Oeyvind Brandtsegg
>>>> >> >> Professor of Music Technology
>>>> >> >> NTNU
>>>> >> >> 7491 Trondheim
>>>> >> >> Norway
>>>> >> >> Cell: +47 92 203 205
>>>> >> >>
>>>> >> >> http://www.partikkelaudio.com/
>>>> >> >> http://crossadaptive.hf.ntnu.no
>>>> >> >> http://gdsp.hf.ntnu.no/
>>>> >> >> http://soundcloud.com/brandtsegg
>>>> >> >> http://flyndresang.no/
>>>> >> >> http://soundcloud.com/t-emp
>>>> >> >>
>>>> >> >> 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
>>>> >>
>>>> >>
>>>> >>
>>>> >> --
>>>> >>
>>>> >> Oeyvind Brandtsegg
>>>> >> Professor of Music Technology
>>>> >> NTNU
>>>> >> 7491 Trondheim
>>>> >> Norway
>>>> >> Cell: +47 92 203 205
>>>> >>
>>>> >> http://www.partikkelaudio.com/
>>>> >> http://crossadaptive.hf.ntnu.no
>>>> >> http://gdsp.hf.ntnu.no/
>>>> >> http://soundcloud.com/brandtsegg
>>>> >> http://flyndresang.no/
>>>> >> http://soundcloud.com/t-emp
>>>> >>
>>>> >> 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
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Oeyvind Brandtsegg
>>>> Professor of Music Technology
>>>> NTNU
>>>> 7491 Trondheim
>>>> Norway
>>>> Cell: +47 92 203 205
>>>>
>>>> http://www.partikkelaudio.com/
>>>> http://crossadaptive.hf.ntnu.no
>>>> http://gdsp.hf.ntnu.no/
>>>> http://soundcloud.com/brandtsegg
>>>> http://flyndresang.no/
>>>> http://soundcloud.com/t-emp
>>>>
>>>> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>
>
>
> --
>
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
>
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-12-01 21:02
FromOeyvind Brandtsegg
SubjectRe: Optimization tip wanted for Csound/Python
... oh, sorry for the noise, I found it.
I edited embeddedCtcsound.csd so that it reads:

pyruni {{
import sys
sys.path.append('c:\\python27\\DLLs')
import ctcsound


instead of
pyruni {{
import ctcsound
import sys

and it works nicely.
I guess this is a Windows only issue,
but I've sometimes encountered the need for a similar
sys.path.append(os.getcwd())
on OSX (when running python in a csd under Cabbage)

Should perhaps the embeddedCtcsound.csd in the ctcsound repo be edited
to somehow include these platform-specific additions?

best
Oeyvind

2016-12-01 12:56 GMT-08:00 Oeyvind Brandtsegg :
> One minor problem remaining though, when I try to run
> embeddedCtcsound.csd, I get errors.
> The error seems to be related to
> import ctcsound
> as run within the csd.
>
> I can run
> import ctcsound
> in a python interpreter, or in IPython or Jupyter.
>
> But when I run it within a csd, like this:
> pyinit
> pyruni {{
> import ctcsound
> }}
> ... I get:
> pyruni: python exception
> Traceback (most recent call last):
>   File "", line 2, in 
>   File "C:\Users\Administrator\AppData\Roaming\Python\Python27\site-packages\ctcsound.py",
> line 24, in 
>     from ctypes import *
>   File "C:\Python27\Lib\ctypes\__init__.py", line 10, in 
>     from _ctypes import Union, Structure, Array
> ImportError: No module named _ctypes
>
> I recognize some similarity to another issue I had with paths being
> different when Python is run through different interfaces (commandline
> python ,or pyinit within a csd),
> but I'm unsure as to what I need to set the path to, .. what to add to
> the path in this case.
>
> 2016-12-01 12:45 GMT-08:00 Oeyvind Brandtsegg :
>> I'm looking at this in Jupyter Notebook now, and it looks and works great.
>> Nice work, Francios!
>>
>> 2016-11-08 9:52 GMT-08:00 Oeyvind Brandtsegg :
>>> Great, thankl you so much for the help.
>>> I'll probably be back with more questions shortly :-)
>>>
>>> 2016-11-07 11:08 GMT-08:00 Francois PINOT :
>>>> I think this is due to small floating point differences in the order of
>>>> 1e-04. The test for equality is not appropriate here. You should consider
>>>> that ctcsound is working on your system.
>>>>
>>>> François
>>>>
>>>> 2016-11-07 19:50 GMT+01:00 Oeyvind Brandtsegg :
>>>>>
>>>>> Yes, I downloaded the full repo as a zip.
>>>>>
>>>>>
>>>>> 2016-11-07 10:27 GMT-08:00 Francois PINOT :
>>>>> > Is the file "bufferInOut.csd" present in the directory you ran
>>>>> > test_ctcsound.py from?
>>>>> >
>>>>> > François
>>>>> >
>>>>> > 2016-11-07 19:20 GMT+01:00 Oeyvind Brandtsegg
>>>>> > :
>>>>> >>
>>>>> >> Ok. It is in my path,
>>>>> >> but now I realize that this was not the culprit,
>>>>> >> ...my bad. I had not copied in csnd.dll from my build dir.
>>>>> >>
>>>>> >> Now I get test_ctcsound.py to this stage:
>>>>> >> (...snip)
>>>>> >> writing 4096 sample blks of 64-bit floats to dac
>>>>> >> SECTION 1:
>>>>> >> F
>>>>> >> ======================================================================
>>>>> >> FAIL: test_inputOutputbuffer (__main__.TestGeneralIO)
>>>>> >> ----------------------------------------------------------------------
>>>>> >> Traceback (most recent call last):
>>>>> >>   File "test_ctcsound.py", line 78, in test_inputOutputbuffer
>>>>> >>     self.assertTrue(np.array_equal(obuf, ibuf/3.0))
>>>>> >> AssertionError: False is not true
>>>>> >>
>>>>> >> ----------------------------------------------------------------------
>>>>> >> Ran 6 tests in 8.216s
>>>>> >>
>>>>> >> FAILED (failures=1)
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> 2016-11-06 3:21 GMT-08:00 Francois PINOT :
>>>>> >> > csound64.dll should be accessible through your PATH. Normally it is
>>>>> >> > located
>>>>> >> > in "C:\Program Files\Csound_x64\bin".
>>>>> >> >
>>>>> >> > You can verify that this path is referenced in your PATH environment
>>>>> >> > variable with this command:
>>>>> >> >
>>>>> >> >   echo %PATH%
>>>>> >> >
>>>>> >> > If this is not the case, you'll have to add this path to your PATH
>>>>> >> > environment variable or to the system PATH environment variable.
>>>>> >> >
>>>>> >> > François
>>>>> >> >
>>>>> >> > 2016-11-05 22:01 GMT+01:00 Oeyvind Brandtsegg
>>>>> >> > :
>>>>> >> >>
>>>>> >> >> Thanks,
>>>>> >> >> this was left cold for a while, but now I'm back on track.
>>>>> >> >>
>>>>> >> >> I get
>>>>> >> >>
>>>>> >> >> >>> import ctcsound
>>>>> >> >> Traceback (most recent call last):
>>>>> >> >>   File "", line 1, in 
>>>>> >> >>   File "ctcsound.py", line 2411, in 
>>>>> >> >>     libcspt = cdll.csnd6
>>>>> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 435, in
>>>>> >> >> __getattr__
>>>>> >> >>     dll = self._dlltype(name)
>>>>> >> >>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>>>>> >> >>     self._handle = _dlopen(self._name, mode)
>>>>> >> >> WindowsError: [Error 126] Den angitte modulen ble ikke funnet
>>>>> >> >>
>>>>> >> >> ... which I assume also relates to line 30 of ctcsound.py
>>>>> >> >> elif sys.platform.startswith('win'):
>>>>> >> >>     libcsound = cdll.csound64
>>>>> >> >>
>>>>> >> >> I understand (guess) that cdll is probably the ctypes dll, but where
>>>>> >> >> can I set it up so that it finds csound64?
>>>>> >> >>
>>>>> >> >> best
>>>>> >> >> Oeyvind
>>>>> >> >>
>>>>> >> >> 2016-10-15 3:04 GMT-07:00 Francois PINOT :
>>>>> >> >> > I just pushed to my github repo an example showing how to use
>>>>> >> >> > ctcsound
>>>>> >> >> > from
>>>>> >> >> > the py- opcodes within a running instance of Csound:
>>>>> >> >> >
>>>>> >> >> >
>>>>> >> >> >
>>>>> >> >> >
>>>>> >> >> >
>>>>> >> >> > https://github.com/fggp/ctcsound/blob/master/cookbook/examples/embeddedCtcsound.csd
>>>>> >> >> >
>>>>> >> >> > Notice that actually Python2 is used by default due the hardcoded
>>>>> >> >> > choice
>>>>> >> >> > of
>>>>> >> >> > Python when building Csound.
>>>>> >> >> >
>>>>> >> >> > François
>>>>> >> >> >
>>>>> >> >> > 2016-10-14 15:23 GMT+02:00 Victor Lazzarini
>>>>> >> >> > :
>>>>> >> >> >>
>>>>> >> >> >> We might need a csoundGetInstance() function or similar in
>>>>> >> >> >> ctcsound
>>>>> >> >> >> so
>>>>> >> >> >> that the
>>>>> >> >> >> opcodes can communicate with the running Csound.
>>>>> >> >> >>
>>>>> >> >> >> http://csound.github.io/docs/manual/pyinit.html
>>>>> >> >> >>
>>>>> >> >> >> > On 14 Oct 2016, at 13:56, Francois PINOT 
>>>>> >> >> >> > wrote:
>>>>> >> >> >> >
>>>>> >> >> >> > pyruni "import ctcsound" in global part?
>>>>> >> >> >> >
>>>>> >> >> >> > François
>>>>> >> >> >> >
>>>>> >> >> >> > 2016-10-14 14:38 GMT+02:00 Oeyvind Brandtsegg
>>>>> >> >> >> > :
>>>>> >> >> >> > Yes, but how to I tell Csound (the py opcodes within Csound) to
>>>>> >> >> >> > use
>>>>> >> >> >> > ctcsound ?
>>>>> >> >> >> >
>>>>> >> >> >> > 2016-10-14 14:26 GMT+02:00 Victor Lazzarini
>>>>> >> >> >> > :
>>>>> >> >> >> > > You can just install numpy.
>>>>> >> >> >> > >
>>>>> >> >> >> > > Victor Lazzarini
>>>>> >> >> >> > > Dean of Arts, Celtic Studies, and Philosophy
>>>>> >> >> >> > > Maynooth University
>>>>> >> >> >> > > Ireland
>>>>> >> >> >> > >
>>>>> >> >> >> > >> On 14 Oct 2016, at 13:19, Oeyvind Brandtsegg
>>>>> >> >> >> > >>  wrote:
>>>>> >> >> >> > >>
>>>>> >> >> >> > >> Ah, now I remember, I tried this earlier and did not
>>>>> >> >> >> > >> complete
>>>>> >> >> >> > >> installing Anaconda, as it seemed like it could interfere
>>>>> >> >> >> > >> with
>>>>> >> >> >> > >> other
>>>>> >> >> >> > >> system variables so I backed out.
>>>>> >> >> >> > >> Is there a way for me to configure the environment without
>>>>> >> >> >> > >> installing
>>>>> >> >> >> > >> Anaconda? I'm in the middle of several productions, so I am
>>>>> >> >> >> > >> hesitant
>>>>> >> >> >> > >> to let an installer make automatic changes to my system.
>>>>> >> >> >> > >>
>>>>> >> >> >> > >> 2016-10-14 8:54 GMT+02:00 Francois PINOT
>>>>> >> >> >> > >> :
>>>>> >> >> >> > >>> Only numpy is mandatory.
>>>>> >> >> >> > >>>
>>>>> >> >> >> > >>> You can use ctcsound with Python 2.x and/or Python 3.x. You
>>>>> >> >> >> > >>> need
>>>>> >> >> >> > >>> an
>>>>> >> >> >> > >>> environment set properly for each version of Python you
>>>>> >> >> >> > >>> will
>>>>> >> >> >> > >>> use.
>>>>> >> >> >> > >>> Anaconda
>>>>> >> >> >> > >>> facilitates this, and it provides a lot of modules for
>>>>> >> >> >> > >>> scientific
>>>>> >> >> >> > >>> computing.
>>>>> >> >> >> > >>> Jupyter is a plus allowing you to use Csound within
>>>>> >> >> >> > >>> notebooks.
>>>>> >> >> >> > >>>
>>>>> >> >> >> > >>> François
>>>>> >> >> >> > >>>
>>>>> >> >> >> > >>> 2016-10-14 8:39 GMT+02:00 Oeyvind Brandtsegg
>>>>> >> >> >> > >>> :
>>>>> >> >> >> > >>>>
>>>>> >> >> >> > >>>> Thanks, Yes, ctcsound looks very nice. So far I've just
>>>>> >> >> >> > >>>> followed
>>>>> >> >> >> > >>>> the
>>>>> >> >> >> > >>>> info on the list with interest, waiting to dive in.
>>>>> >> >> >> > >>>> Is there some instructions on how to migrate somewhere? Do
>>>>> >> >> >> > >>>> I
>>>>> >> >> >> > >>>> need
>>>>> >> >> >> > >>>> to
>>>>> >> >> >> > >>>> install Anaconda and Jupyter, or can I just replace some
>>>>> >> >> >> > >>>> modules
>>>>> >> >> >> > >>>> ?
>>>>> >> >> >> > >>>>
>>>>> >> >> >> > >>>> 2016-10-13 23:49 GMT+02:00 Victor Lazzarini
>>>>> >> >> >> > >>>> :
>>>>> >> >> >> > >>>>> It is possible to read a Csound ftable via the API.
>>>>> >> >> >> > >>>>>
>>>>> >> >> >> > >>>>> I'd also suggest migrating to ctcsound if you
>>>>> >> >> >> > >>>>> are using csnd6. It's excellent.
>>>>> >> >> >> > >>>>>
>>>>> >> >> >> > >>>>> Victor Lazzarini
>>>>> >> >> >> > >>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>> >> >> >> > >>>>> Maynooth University
>>>>> >> >> >> > >>>>> Ireland
>>>>> >> >> >> > >>>>>
>>>>> >> >> >> > >>>>> On 13 Oct 2016, at 22:18, Steven Yi 
>>>>> >> >> >> > >>>>> wrote:
>>>>> >> >> >> > >>>>>
>>>>> >> >> >> > >>>>> Yes I think that was what I was thinking of, but I'm
>>>>> >> >> >> > >>>>> unsure
>>>>> >> >> >> > >>>>> whether it
>>>>> >> >> >> > >>>>> is
>>>>> >> >> >> > >>>>> supported now or not.
>>>>> >> >> >> > >>>>>
>>>>> >> >> >> > >>>>>
>>>>> >> >> >> > >>>>> On Thu, Oct 13, 2016, 5:07 PM Oeyvind Brandtsegg
>>>>> >> >> >> > >>>>> 
>>>>> >> >> >> > >>>>> wrote:
>>>>> >> >> >> > >>>>>>
>>>>> >> >> >> > >>>>>> Hi all,
>>>>> >> >> >> > >>>>>> thanks for the suggestions.
>>>>> >> >> >> > >>>>>> If I can read from a csound table directly in python
>>>>> >> >> >> > >>>>>> code,
>>>>> >> >> >> > >>>>>> that
>>>>> >> >> >> > >>>>>> would
>>>>> >> >> >> > >>>>>> be the best. Steven, do you mean this document
>>>>> >> >> >> > >>>>>> :http://pythonsound.sourceforge.net/pycsound.pdf ?
>>>>> >> >> >> > >>>>>> There were several things in there that I did not know
>>>>> >> >> >> > >>>>>> about,
>>>>> >> >> >> > >>>>>> is
>>>>> >> >> >> > >>>>>> the
>>>>> >> >> >> > >>>>>> csound module as described there currently supported?
>>>>> >> >> >> > >>>>>>
>>>>> >> >> >> > >>>>>> 2016-10-13 21:29 GMT+02:00 Steven Yi
>>>>> >> >> >> > >>>>>> :
>>>>> >> >> >> > >>>>>>> Have you tried ftables? I.e. Filling the table in
>>>>> >> >> >> > >>>>>>> Csound,
>>>>> >> >> >> > >>>>>>> then
>>>>> >> >> >> > >>>>>>> reading
>>>>> >> >> >> > >>>>>>> from
>>>>> >> >> >> > >>>>>>> the table in the python code. I seem to remember the
>>>>> >> >> >> > >>>>>>> python
>>>>> >> >> >> > >>>>>>> opcodes
>>>>> >> >> >> > >>>>>>> having
>>>>> >> >> >> > >>>>>>> access to ftables and that there was example code for
>>>>> >> >> >> > >>>>>>> this.
>>>>> >> >> >> > >>>>>>>
>>>>> >> >> >> > >>>>>>> On Thu, Oct 13, 2016 at 3:04 PM Tarmo Johannes
>>>>> >> >> >> > >>>>>>>  wrote:
>>>>> >> >> >> > >>>>>>>>
>>>>> >> >> >> > >>>>>>>> Not sure, but would --realtime switch on command line
>>>>> >> >> >> > >>>>>>>> help?
>>>>> >> >> >> > >>>>>>>> I
>>>>> >> >> >> > >>>>>>>> don't
>>>>> >> >> >> > >>>>>>>> know
>>>>> >> >> >> > >>>>>>>> if that puts python to other thread from audio work...
>>>>> >> >> >> > >>>>>>>>
>>>>> >> >> >> > >>>>>>>>
>>>>> >> >> >> > >>>>>>>> Tarmo
>>>>> >> >> >> > >>>>>>>>
>>>>> >> >> >> > >>>>>>>>
>>>>> >> >> >> > >>>>>>>> 13.10.2016 14:34 kirjutas kuupäeval "Oeyvind
>>>>> >> >> >> > >>>>>>>> Brandtsegg"
>>>>> >> >> >> > >>>>>>>> :
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>> Hi,
>>>>> >> >> >> > >>>>>>>>> I need to transfer the contents of an array from
>>>>> >> >> >> > >>>>>>>>> Csound
>>>>> >> >> >> > >>>>>>>>> to
>>>>> >> >> >> > >>>>>>>>> Python,
>>>>> >> >> >> > >>>>>>>>> as
>>>>> >> >> >> > >>>>>>>>> I want to do some peak picking and other analysis
>>>>> >> >> >> > >>>>>>>>> that
>>>>> >> >> >> > >>>>>>>>> is
>>>>> >> >> >> > >>>>>>>>> easier to
>>>>> >> >> >> > >>>>>>>>> get done in Python. The problem is that my
>>>>> >> >> >> > >>>>>>>>> (admittedly
>>>>> >> >> >> > >>>>>>>>> ad
>>>>> >> >> >> > >>>>>>>>> hoc)
>>>>> >> >> >> > >>>>>>>>> method
>>>>> >> >> >> > >>>>>>>>> of transferring the values from Csound to Python
>>>>> >> >> >> > >>>>>>>>> incurs
>>>>> >> >> >> > >>>>>>>>> significant
>>>>> >> >> >> > >>>>>>>>> performance degradation (more details on how I
>>>>> >> >> >> > >>>>>>>>> measure
>>>>> >> >> >> > >>>>>>>>> this
>>>>> >> >> >> > >>>>>>>>> later
>>>>> >> >> >> > >>>>>>>>> in
>>>>> >> >> >> > >>>>>>>>> this email).
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>> The basic premise is that I need Csound to be the
>>>>> >> >> >> > >>>>>>>>> main
>>>>> >> >> >> > >>>>>>>>> program
>>>>> >> >> >> > >>>>>>>>> (the
>>>>> >> >> >> > >>>>>>>>> host), and Python runs via the py opcodes.
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>> The array kAuto is of size 256, and transfer needs to
>>>>> >> >> >> > >>>>>>>>> be
>>>>> >> >> >> > >>>>>>>>> done
>>>>> >> >> >> > >>>>>>>>> once
>>>>> >> >> >> > >>>>>>>>> every 1 second, for 3 of these arrays. One should
>>>>> >> >> >> > >>>>>>>>> think
>>>>> >> >> >> > >>>>>>>>> the
>>>>> >> >> >> > >>>>>>>>> bandwidth
>>>>> >> >> >> > >>>>>>>>> requirement are not too taxing on any system, but
>>>>> >> >> >> > >>>>>>>>> since
>>>>> >> >> >> > >>>>>>>>> I
>>>>> >> >> >> > >>>>>>>>> only
>>>>> >> >> >> > >>>>>>>>> send
>>>>> >> >> >> > >>>>>>>>> single values, there are more than 700 pycalls
>>>>> >> >> >> > >>>>>>>>> happening
>>>>> >> >> >> > >>>>>>>>> in
>>>>> >> >> >> > >>>>>>>>> one
>>>>> >> >> >> > >>>>>>>>> k-rate
>>>>> >> >> >> > >>>>>>>>> pass.
>>>>> >> >> >> > >>>>>>>>> The python function "p.fill_array" does nothing but
>>>>> >> >> >> > >>>>>>>>> put
>>>>> >> >> >> > >>>>>>>>> the
>>>>> >> >> >> > >>>>>>>>> received
>>>>> >> >> >> > >>>>>>>>> values one by one into a numpy array.
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>>  kcnt_fill = 0
>>>>> >> >> >> > >>>>>>>>>  while kcnt_fill < ifftsize/2 do
>>>>> >> >> >> > >>>>>>>>>    pycall "p.fill_array", kAuto[kcnt_fill],
>>>>> >> >> >> > >>>>>>>>> kcnt_fill,
>>>>> >> >> >> > >>>>>>>>> ifftsize/2
>>>>> >> >> >> > >>>>>>>>>    kcnt_fill += 1
>>>>> >> >> >> > >>>>>>>>>  od
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>> By performance degradation I mean that the operation
>>>>> >> >> >> > >>>>>>>>> seems
>>>>> >> >> >> > >>>>>>>>> to
>>>>> >> >> >> > >>>>>>>>> let
>>>>> >> >> >> > >>>>>>>>> the
>>>>> >> >> >> > >>>>>>>>> different processes to wait for each other a lot,
>>>>> >> >> >> > >>>>>>>>> utlimately
>>>>> >> >> >> > >>>>>>>>> leading
>>>>> >> >> >> > >>>>>>>>> to dropouts in realtime audio. This does not show up
>>>>> >> >> >> > >>>>>>>>> as
>>>>> >> >> >> > >>>>>>>>> CPU
>>>>> >> >> >> > >>>>>>>>> spikes
>>>>> >> >> >> > >>>>>>>>> (running at around 50%), but shows in Reaper's
>>>>> >> >> >> > >>>>>>>>> performence
>>>>> >> >> >> > >>>>>>>>> meter as
>>>>> >> >> >> > >>>>>>>>> "RT longest-block". This meter shows the number of
>>>>> >> >> >> > >>>>>>>>> milliseconds
>>>>> >> >> >> > >>>>>>>>> used/available per audio processing block. The *used*
>>>>> >> >> >> > >>>>>>>>> must
>>>>> >> >> >> > >>>>>>>>> generally
>>>>> >> >> >> > >>>>>>>>> be less than the *available* time to avoid dropouts.
>>>>> >> >> >> > >>>>>>>>> Some
>>>>> >> >> >> > >>>>>>>>> spikes
>>>>> >> >> >> > >>>>>>>>> are
>>>>> >> >> >> > >>>>>>>>> not necessarily bad, but in my case the *used* is
>>>>> >> >> >> > >>>>>>>>> generally
>>>>> >> >> >> > >>>>>>>>> quite
>>>>> >> >> >> > >>>>>>>>> stable and higher than the *available*, unless I
>>>>> >> >> >> > >>>>>>>>> comment
>>>>> >> >> >> > >>>>>>>>> out
>>>>> >> >> >> > >>>>>>>>> the
>>>>> >> >> >> > >>>>>>>>> code
>>>>> >> >> >> > >>>>>>>>> excerpt given above.
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>> Is there any way I can send an array from Csound to
>>>>> >> >> >> > >>>>>>>>> Python
>>>>> >> >> >> > >>>>>>>>> in
>>>>> >> >> >> > >>>>>>>>> one
>>>>> >> >> >> > >>>>>>>>> go?
>>>>> >> >> >> > >>>>>>>>> I seem to remember some black magic about letting
>>>>> >> >> >> > >>>>>>>>> Python
>>>>> >> >> >> > >>>>>>>>> running
>>>>> >> >> >> > >>>>>>>>> under
>>>>> >> >> >> > >>>>>>>>> Csound get access to the (host) csound instance and
>>>>> >> >> >> > >>>>>>>>> thus
>>>>> >> >> >> > >>>>>>>>> accessing
>>>>> >> >> >> > >>>>>>>>> the
>>>>> >> >> >> > >>>>>>>>> Csound API. Would that be the best way to do it, and
>>>>> >> >> >> > >>>>>>>>> would
>>>>> >> >> >> > >>>>>>>>> it
>>>>> >> >> >> > >>>>>>>>> be
>>>>> >> >> >> > >>>>>>>>> considered a safe way of doing it?
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>> best
>>>>> >> >> >> > >>>>>>>>> Oeyvind
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>> --
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>> Oeyvind Brandtsegg
>>>>> >> >> >> > >>>>>>>>> Professor of Music Technology
>>>>> >> >> >> > >>>>>>>>> NTNU
>>>>> >> >> >> > >>>>>>>>> 7491 Trondheim
>>>>> >> >> >> > >>>>>>>>> Norway
>>>>> >> >> >> > >>>>>>>>> Cell: +47 92 203 205
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>> http://www.partikkelaudio.com/
>>>>> >> >> >> > >>>>>>>>> http://crossadaptive.hf.ntnu.no
>>>>> >> >> >> > >>>>>>>>> http://gdsp.hf.ntnu.no/
>>>>> >> >> >> > >>>>>>>>> http://soundcloud.com/brandtsegg
>>>>> >> >> >> > >>>>>>>>> http://flyndresang.no/
>>>>> >> >> >> > >>>>>>>>> http://soundcloud.com/t-emp
>>>>> >> >> >> > >>>>>>>>>
>>>>> >> >> >> > >>>>>>>>> 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
>>>>> >> >> >> > >>>>>>
>>>>> >> >> >> > >>>>>>
>>>>> >> >> >> > >>>>>>
>>>>> >> >> >> > >>>>>> --
>>>>> >> >> >> > >>>>>>
>>>>> >> >> >> > >>>>>> Oeyvind Brandtsegg
>>>>> >> >> >> > >>>>>> Professor of Music Technology
>>>>> >> >> >> > >>>>>> NTNU
>>>>> >> >> >> > >>>>>> 7491 Trondheim
>>>>> >> >> >> > >>>>>> Norway
>>>>> >> >> >> > >>>>>> Cell: +47 92 203 205
>>>>> >> >> >> > >>>>>>
>>>>> >> >> >> > >>>>>> http://www.partikkelaudio.com/
>>>>> >> >> >> > >>>>>> http://crossadaptive.hf.ntnu.no
>>>>> >> >> >> > >>>>>> http://gdsp.hf.ntnu.no/
>>>>> >> >> >> > >>>>>> http://soundcloud.com/brandtsegg
>>>>> >> >> >> > >>>>>> http://flyndresang.no/
>>>>> >> >> >> > >>>>>> http://soundcloud.com/t-emp
>>>>> >> >> >> > >>>>>>
>>>>> >> >> >> > >>>>>> 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
>>>>> >> >> >> > >>>>
>>>>> >> >> >> > >>>>
>>>>> >> >> >> > >>>>
>>>>> >> >> >> > >>>> --
>>>>> >> >> >> > >>>>
>>>>> >> >> >> > >>>> Oeyvind Brandtsegg
>>>>> >> >> >> > >>>> Professor of Music Technology
>>>>> >> >> >> > >>>> NTNU
>>>>> >> >> >> > >>>> 7491 Trondheim
>>>>> >> >> >> > >>>> Norway
>>>>> >> >> >> > >>>> Cell: +47 92 203 205
>>>>> >> >> >> > >>>>
>>>>> >> >> >> > >>>> http://www.partikkelaudio.com/
>>>>> >> >> >> > >>>> http://crossadaptive.hf.ntnu.no
>>>>> >> >> >> > >>>> http://gdsp.hf.ntnu.no/
>>>>> >> >> >> > >>>> http://soundcloud.com/brandtsegg
>>>>> >> >> >> > >>>> http://flyndresang.no/
>>>>> >> >> >> > >>>> http://soundcloud.com/t-emp
>>>>> >> >> >> > >>>>
>>>>> >> >> >> > >>>> 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
>>>>> >> >> >> > >>
>>>>> >> >> >> > >>
>>>>> >> >> >> > >>
>>>>> >> >> >> > >> --
>>>>> >> >> >> > >>
>>>>> >> >> >> > >> Oeyvind Brandtsegg
>>>>> >> >> >> > >> Professor of Music Technology
>>>>> >> >> >> > >> NTNU
>>>>> >> >> >> > >> 7491 Trondheim
>>>>> >> >> >> > >> Norway
>>>>> >> >> >> > >> Cell: +47 92 203 205
>>>>> >> >> >> > >>
>>>>> >> >> >> > >> http://www.partikkelaudio.com/
>>>>> >> >> >> > >> http://crossadaptive.hf.ntnu.no
>>>>> >> >> >> > >> http://gdsp.hf.ntnu.no/
>>>>> >> >> >> > >> http://soundcloud.com/brandtsegg
>>>>> >> >> >> > >> http://flyndresang.no/
>>>>> >> >> >> > >> http://soundcloud.com/t-emp
>>>>> >> >> >> > >>
>>>>> >> >> >> > >> 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
>>>>> >> >> >> >
>>>>> >> >> >> >
>>>>> >> >> >> >
>>>>> >> >> >> > --
>>>>> >> >> >> >
>>>>> >> >> >> > Oeyvind Brandtsegg
>>>>> >> >> >> > Professor of Music Technology
>>>>> >> >> >> > NTNU
>>>>> >> >> >> > 7491 Trondheim
>>>>> >> >> >> > Norway
>>>>> >> >> >> > Cell: +47 92 203 205
>>>>> >> >> >> >
>>>>> >> >> >> > http://www.partikkelaudio.com/
>>>>> >> >> >> > http://crossadaptive.hf.ntnu.no
>>>>> >> >> >> > http://gdsp.hf.ntnu.no/
>>>>> >> >> >> > http://soundcloud.com/brandtsegg
>>>>> >> >> >> > http://flyndresang.no/
>>>>> >> >> >> > http://soundcloud.com/t-emp
>>>>> >> >> >> >
>>>>> >> >> >> > 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
>>>>> >> >>
>>>>> >> >>
>>>>> >> >>
>>>>> >> >> --
>>>>> >> >>
>>>>> >> >> Oeyvind Brandtsegg
>>>>> >> >> Professor of Music Technology
>>>>> >> >> NTNU
>>>>> >> >> 7491 Trondheim
>>>>> >> >> Norway
>>>>> >> >> Cell: +47 92 203 205
>>>>> >> >>
>>>>> >> >> http://www.partikkelaudio.com/
>>>>> >> >> http://crossadaptive.hf.ntnu.no
>>>>> >> >> http://gdsp.hf.ntnu.no/
>>>>> >> >> http://soundcloud.com/brandtsegg
>>>>> >> >> http://flyndresang.no/
>>>>> >> >> http://soundcloud.com/t-emp
>>>>> >> >>
>>>>> >> >> 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
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> --
>>>>> >>
>>>>> >> Oeyvind Brandtsegg
>>>>> >> Professor of Music Technology
>>>>> >> NTNU
>>>>> >> 7491 Trondheim
>>>>> >> Norway
>>>>> >> Cell: +47 92 203 205
>>>>> >>
>>>>> >> http://www.partikkelaudio.com/
>>>>> >> http://crossadaptive.hf.ntnu.no
>>>>> >> http://gdsp.hf.ntnu.no/
>>>>> >> http://soundcloud.com/brandtsegg
>>>>> >> http://flyndresang.no/
>>>>> >> http://soundcloud.com/t-emp
>>>>> >>
>>>>> >> 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
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Oeyvind Brandtsegg
>>>>> Professor of Music Technology
>>>>> NTNU
>>>>> 7491 Trondheim
>>>>> Norway
>>>>> Cell: +47 92 203 205
>>>>>
>>>>> http://www.partikkelaudio.com/
>>>>> http://crossadaptive.hf.ntnu.no
>>>>> http://gdsp.hf.ntnu.no/
>>>>> http://soundcloud.com/brandtsegg
>>>>> http://flyndresang.no/
>>>>> http://soundcloud.com/t-emp
>>>>>
>>>>> 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
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>
>
>
> --
>
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
>
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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