Csound Csound-dev Csound-tekno Search About

Jupyter notebook

Date2016-05-29 06:30
FromFrancois PINOT
SubjectJupyter notebook
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/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-05-29 11:14
FromRory Walsh
SubjectRe: Jupyter notebook
Hi Francois, this looks great. We are missing an entry on the http://csound.github.io/create.html page about scientific computing with Python and Csound. Would you mind preparing a short paragraph and some links for us to include? Whenever you have a free moment. It would be great to have as much info as we can there. 

On 29 May 2016 at 06:30, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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-05-29 12:15
FromT Lopez
SubjectRe: Jupyter notebook

I am glad you mentioned this, I was a bit confused when I clicked on that link!!

On 29 May 2016 12:14, "Rory Walsh" <rorywalsh@ear.ie> wrote:
Hi Francois, this looks great. We are missing an entry on the http://csound.github.io/create.html page about scientific computing with Python and Csound. Would you mind preparing a short paragraph and some links for us to include? Whenever you have a free moment. It would be great to have as much info as we can there. 

On 29 May 2016 at 06:30, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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-05-29 12:21
FromRory Walsh
SubjectRe: Jupyter notebook
We thought that leaving it in there might prompt someone to contribute something! 

On 29 May 2016 at 12:15, T Lopez <wstlopez@gmail.com> wrote:

I am glad you mentioned this, I was a bit confused when I clicked on that link!!

On 29 May 2016 12:14, "Rory Walsh" <rorywalsh@ear.ie> wrote:
Hi Francois, this looks great. We are missing an entry on the http://csound.github.io/create.html page about scientific computing with Python and Csound. Would you mind preparing a short paragraph and some links for us to include? Whenever you have a free moment. It would be great to have as much info as we can there. 

On 29 May 2016 at 06:30, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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-05-29 15:49
FromAndres Cabrera
SubjectRe: Jupyter notebook
Hi Francois,

This is excellent work, and what I wanted icsound to be.

Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?

I'm thinking the time is near to retire icsound...

Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.

Cheers,
Andrés

On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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-05-30 11:01
FromFrancois PINOT
SubjectRe: Jupyter notebook
Hi Andrés,

ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:

- ctcsound uses ctypes instead of SWIG
- ctcsound works with Python 2 and Python 3 as well
- ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).

ctcsound.py is installed with Csound since version 6.07.


csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:

 - csoundmagics.py, the ipython extension
 - csound.js, a CodeMirror mode providing syntax highligting for Csound code
 - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.

csoundmagics uses ctcsound where icsound used csnd6.

Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.

Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.

When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.

Regards

François

2016-05-29 16:49 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
Hi Francois,

This is excellent work, and what I wanted icsound to be.

Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?

I'm thinking the time is near to retire icsound...

Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.

Cheers,
Andrés

On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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-05-30 11:23
FromVictor Lazzarini
SubjectRe: Jupyter notebook
Great! 
I am also thinking here whether it is possible to make ctcsound as Python package that can be installed with pip or easy_install.
Wouldn’t that be useful?

best regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 30 May 2016, at 11:01, Francois PINOT  wrote:
> 
> Hi Andrés,
> 
> ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:
> 
> - ctcsound uses ctypes instead of SWIG 
> - ctcsound works with Python 2 and Python 3 as well
> - ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).
> 
> ctcsound.py is installed with Csound since version 6.07.
> 
> 
> csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:
> 
>  - csoundmagics.py, the ipython extension
>  - csound.js, a CodeMirror mode providing syntax highligting for Csound code
>  - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.
> 
> csoundmagics uses ctcsound where icsound used csnd6.
> 
> Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.
> 
> Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.
> 
> When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.
> 
> Regards
> 
> François
> 
> 2016-05-29 16:49 GMT+02:00 Andres Cabrera :
> Hi Francois,
> 
> This is excellent work, and what I wanted icsound to be.
> 
> Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?
> 
> I'm thinking the time is near to retire icsound...
> 
> Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.
> 
> Cheers,
> Andrés
> 
> On Sat, May 28, 2016 at 10:30 PM, Francois PINOT  wrote:
> I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).
> 
> I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.
> 
> The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.
> 
> As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js
> 
> Regards
> 
> Francois
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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-05-30 12:15
FromRory Walsh
SubjectRe: Jupyter notebook
I think it certainly would be cool, but only if it ships with a version of Csound. If users have to pre-install Csound to use it, then I think a few well prepared instructions are just as useful. Or? 

On 30 May 2016 at 11:23, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Great!
I am also thinking here whether it is possible to make ctcsound as Python package that can be installed with pip or easy_install.
Wouldn’t that be useful?

best regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 30 May 2016, at 11:01, Francois PINOT <fggpinot@gmail.com> wrote:
>
> Hi Andrés,
>
> ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:
>
> - ctcsound uses ctypes instead of SWIG
> - ctcsound works with Python 2 and Python 3 as well
> - ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).
>
> ctcsound.py is installed with Csound since version 6.07.
>
>
> csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:
>
>  - csoundmagics.py, the ipython extension
>  - csound.js, a CodeMirror mode providing syntax highligting for Csound code
>  - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.
>
> csoundmagics uses ctcsound where icsound used csnd6.
>
> Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.
>
> Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.
>
> When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.
>
> Regards
>
> François
>
> 2016-05-29 16:49 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
> Hi Francois,
>
> This is excellent work, and what I wanted icsound to be.
>
> Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?
>
> I'm thinking the time is near to retire icsound...
>
> Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.
>
> Cheers,
> Andrés
>
> On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
> I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).
>
> I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.
>
> The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.
>
> As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js
>
> Regards
>
> Francois
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/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-05-30 14:00
FromFrancois PINOT
SubjectRe: Jupyter notebook
Python packages installed with pip or easy_install generally resolve all their dependencies during the installation process. From this point of view, Csound would be a dependency of ctcsound...

ctcsound is actually distributed with Csound and, as such, it is a part of Csound like csnd6. In fact, ctcsound should become the module to use in place of csnd6.


csoundmagics could become a new version of icsound for Jupyter.

François

2016-05-30 13:15 GMT+02:00 Rory Walsh <rorywalsh@ear.ie>:
I think it certainly would be cool, but only if it ships with a version of Csound. If users have to pre-install Csound to use it, then I think a few well prepared instructions are just as useful. Or? 

On 30 May 2016 at 11:23, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Great!
I am also thinking here whether it is possible to make ctcsound as Python package that can be installed with pip or easy_install.
Wouldn’t that be useful?

best regards
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 30 May 2016, at 11:01, Francois PINOT <fggpinot@gmail.com> wrote:
>
> Hi Andrés,
>
> ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:
>
> - ctcsound uses ctypes instead of SWIG
> - ctcsound works with Python 2 and Python 3 as well
> - ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).
>
> ctcsound.py is installed with Csound since version 6.07.
>
>
> csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:
>
>  - csoundmagics.py, the ipython extension
>  - csound.js, a CodeMirror mode providing syntax highligting for Csound code
>  - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.
>
> csoundmagics uses ctcsound where icsound used csnd6.
>
> Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.
>
> Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.
>
> When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.
>
> Regards
>
> François
>
> 2016-05-29 16:49 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
> Hi Francois,
>
> This is excellent work, and what I wanted icsound to be.
>
> Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?
>
> I'm thinking the time is near to retire icsound...
>
> Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.
>
> Cheers,
> Andrés
>
> On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
> I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).
>
> I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.
>
> The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.
>
> As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js
>
> Regards
>
> Francois
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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-05-30 15:36
FromAndres Cabrera
SubjectRe: Jupyter notebook
That sounds great. I agree that ctcsound should replace csnd6. My only question about that would be is numpy a hard dependency of ctcsound?

Cheers,
Andrés

On Mon, May 30, 2016 at 3:01 AM, Francois PINOT <fggpinot@gmail.com> wrote:
Hi Andrés,

ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:

- ctcsound uses ctypes instead of SWIG
- ctcsound works with Python 2 and Python 3 as well
- ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).

ctcsound.py is installed with Csound since version 6.07.


csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:

 - csoundmagics.py, the ipython extension
 - csound.js, a CodeMirror mode providing syntax highligting for Csound code
 - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.

csoundmagics uses ctcsound where icsound used csnd6.

Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.

Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.

When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.

Regards

François

2016-05-29 16:49 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
Hi Francois,

This is excellent work, and what I wanted icsound to be.

Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?

I'm thinking the time is near to retire icsound...

Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.

Cheers,
Andrés

On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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-05-30 16:29
FromFrancois PINOT
SubjectRe: Jupyter notebook
Actually yes. The question is about having a python array type corresponding to Csound MYFLT arrays (in the sense of C arrays). In csnd6, this is done with helper classes, e.g. CsoundMYFLTArray. Numpy arrays are very efficient and the numpy API exposes means to have a pointer for the data part of the numpy array pointing to the memory block of the Csound C array. So numpy provides all the machinery to yield efficiently the C pointers that are exposed by the Csound C API.

numpy is installed very easily (e.g. pip install numpy) and if you work with Jupyter notebooks, it's already there.

François

2016-05-30 16:36 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
That sounds great. I agree that ctcsound should replace csnd6. My only question about that would be is numpy a hard dependency of ctcsound?

Cheers,
Andrés

On Mon, May 30, 2016 at 3:01 AM, Francois PINOT <fggpinot@gmail.com> wrote:
Hi Andrés,

ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:

- ctcsound uses ctypes instead of SWIG
- ctcsound works with Python 2 and Python 3 as well
- ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).

ctcsound.py is installed with Csound since version 6.07.


csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:

 - csoundmagics.py, the ipython extension
 - csound.js, a CodeMirror mode providing syntax highligting for Csound code
 - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.

csoundmagics uses ctcsound where icsound used csnd6.

Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.

Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.

When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.

Regards

François

2016-05-29 16:49 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
Hi Francois,

This is excellent work, and what I wanted icsound to be.

Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?

I'm thinking the time is near to retire icsound...

Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.

Cheers,
Andrés

On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/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-05-30 23:01
FromRichard
SubjectRe: Jupyter notebook

I get 'no module named  ctcsound' in my note book, but also in python.

Python defaults now to version 3.5.1, after I installed Anaconda (I already have 2.7)
I guess something is wrong with the path(s)? This is on OS X.

Richard


On 30/05/16 17:29, Francois PINOT wrote:
Actually yes. The question is about having a python array type corresponding to Csound MYFLT arrays (in the sense of C arrays). In csnd6, this is done with helper classes, e.g. CsoundMYFLTArray. Numpy arrays are very efficient and the numpy API exposes means to have a pointer for the data part of the numpy array pointing to the memory block of the Csound C array. So numpy provides all the machinery to yield efficiently the C pointers that are exposed by the Csound C API.

numpy is installed very easily (e.g. pip install numpy) and if you work with Jupyter notebooks, it's already there.

François

2016-05-30 16:36 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
That sounds great. I agree that ctcsound should replace csnd6. My only question about that would be is numpy a hard dependency of ctcsound?

Cheers,
Andrés

On Mon, May 30, 2016 at 3:01 AM, Francois PINOT <fggpinot@gmail.com> wrote:
Hi Andrés,

ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:

- ctcsound uses ctypes instead of SWIG
- ctcsound works with Python 2 and Python 3 as well
- ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).

ctcsound.py is installed with Csound since version 6.07.


csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:

 - csoundmagics.py, the ipython extension
 - csound.js, a CodeMirror mode providing syntax highligting for Csound code
 - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.

csoundmagics uses ctcsound where icsound used csnd6.

Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.

Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.

When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.

Regards

François

2016-05-29 16:49 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
Hi Francois,

This is excellent work, and what I wanted icsound to be.

Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?

I'm thinking the time is near to retire icsound...

Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.

Cheers,
Andrés

On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/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-05-30 23:36
FromFrancois PINOT
SubjectRe: Jupyter notebook

Can you import it from a Python 2 session?

François

Le 31 mai 2016 12:02 AM, "Richard" <zappfinger@gmail.com> a écrit :

I get 'no module named  ctcsound' in my note book, but also in python.

Python defaults now to version 3.5.1, after I installed Anaconda (I already have 2.7)
I guess something is wrong with the path(s)? This is on OS X.

Richard


On 30/05/16 17:29, Francois PINOT wrote:
Actually yes. The question is about having a python array type corresponding to Csound MYFLT arrays (in the sense of C arrays). In csnd6, this is done with helper classes, e.g. CsoundMYFLTArray. Numpy arrays are very efficient and the numpy API exposes means to have a pointer for the data part of the numpy array pointing to the memory block of the Csound C array. So numpy provides all the machinery to yield efficiently the C pointers that are exposed by the Csound C API.

numpy is installed very easily (e.g. pip install numpy) and if you work with Jupyter notebooks, it's already there.

François

2016-05-30 16:36 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
That sounds great. I agree that ctcsound should replace csnd6. My only question about that would be is numpy a hard dependency of ctcsound?

Cheers,
Andrés

On Mon, May 30, 2016 at 3:01 AM, Francois PINOT <fggpinot@gmail.com> wrote:
Hi Andrés,

ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:

- ctcsound uses ctypes instead of SWIG
- ctcsound works with Python 2 and Python 3 as well
- ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).

ctcsound.py is installed with Csound since version 6.07.


csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:

 - csoundmagics.py, the ipython extension
 - csound.js, a CodeMirror mode providing syntax highligting for Csound code
 - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.

csoundmagics uses ctcsound where icsound used csnd6.

Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.

Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.

When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.

Regards

François

2016-05-29 16:49 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
Hi Francois,

This is excellent work, and what I wanted icsound to be.

Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?

I'm thinking the time is near to retire icsound...

Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.

Cheers,
Andrés

On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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-05-31 08:17
FromRichard
SubjectRe: Jupyter notebook

Yes that works. I was not sure if I installed csound 6.07 before installing Anaconda, so I re-installed csound, hoping it would install for the new default Python. Unfortunately, it does not work still.


Richard


On 31/05/16 00:36, Francois PINOT wrote:

Can you import it from a Python 2 session?

François

Le 31 mai 2016 12:02 AM, "Richard" <zappfinger@gmail.com> a écrit :

I get 'no module named  ctcsound' in my note book, but also in python.

Python defaults now to version 3.5.1, after I installed Anaconda (I already have 2.7)
I guess something is wrong with the path(s)? This is on OS X.

Richard


On 30/05/16 17:29, Francois PINOT wrote:
Actually yes. The question is about having a python array type corresponding to Csound MYFLT arrays (in the sense of C arrays). In csnd6, this is done with helper classes, e.g. CsoundMYFLTArray. Numpy arrays are very efficient and the numpy API exposes means to have a pointer for the data part of the numpy array pointing to the memory block of the Csound C array. So numpy provides all the machinery to yield efficiently the C pointers that are exposed by the Csound C API.

numpy is installed very easily (e.g. pip install numpy) and if you work with Jupyter notebooks, it's already there.

François

2016-05-30 16:36 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
That sounds great. I agree that ctcsound should replace csnd6. My only question about that would be is numpy a hard dependency of ctcsound?

Cheers,
Andrés

On Mon, May 30, 2016 at 3:01 AM, Francois PINOT <fggpinot@gmail.com> wrote:
Hi Andrés,

ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:

- ctcsound uses ctypes instead of SWIG
- ctcsound works with Python 2 and Python 3 as well
- ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).

ctcsound.py is installed with Csound since version 6.07.


csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:

 - csoundmagics.py, the ipython extension
 - csound.js, a CodeMirror mode providing syntax highligting for Csound code
 - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.

csoundmagics uses ctcsound where icsound used csnd6.

Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.

Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.

When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.

Regards

François

2016-05-29 16:49 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
Hi Francois,

This is excellent work, and what I wanted icsound to be.

Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?

I'm thinking the time is near to retire icsound...

Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.

Cheers,
Andrés

On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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-05-31 08:54
FromFrancois PINOT
SubjectRe: Jupyter notebook
Csound 6.07 installs csnd6.py and ctcsound.py in the same dir for Python 2.

Type the following commands from a Python 3 console:

import sys
sys.path

Copy ctcsound.py in one of the paths returned by sys.path (usually site-packages is used). You'll then have a copy of ctcsound.py in Python 2 PYTHONPATH and in PYTHON 3 PYTHONPATH.

François

2016-05-31 9:17 GMT+02:00 Richard <zappfinger@gmail.com>:

Yes that works. I was not sure if I installed csound 6.07 before installing Anaconda, so I re-installed csound, hoping it would install for the new default Python. Unfortunately, it does not work still.


Richard


On 31/05/16 00:36, Francois PINOT wrote:

Can you import it from a Python 2 session?

François

Le 31 mai 2016 12:02 AM, "Richard" <zappfinger@gmail.com> a écrit :

I get 'no module named  ctcsound' in my note book, but also in python.

Python defaults now to version 3.5.1, after I installed Anaconda (I already have 2.7)
I guess something is wrong with the path(s)? This is on OS X.

Richard


On 30/05/16 17:29, Francois PINOT wrote:
Actually yes. The question is about having a python array type corresponding to Csound MYFLT arrays (in the sense of C arrays). In csnd6, this is done with helper classes, e.g. CsoundMYFLTArray. Numpy arrays are very efficient and the numpy API exposes means to have a pointer for the data part of the numpy array pointing to the memory block of the Csound C array. So numpy provides all the machinery to yield efficiently the C pointers that are exposed by the Csound C API.

numpy is installed very easily (e.g. pip install numpy) and if you work with Jupyter notebooks, it's already there.

François

2016-05-30 16:36 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
That sounds great. I agree that ctcsound should replace csnd6. My only question about that would be is numpy a hard dependency of ctcsound?

Cheers,
Andrés

On Mon, May 30, 2016 at 3:01 AM, Francois PINOT <fggpinot@gmail.com> wrote:
Hi Andrés,

ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:

- ctcsound uses ctypes instead of SWIG
- ctcsound works with Python 2 and Python 3 as well
- ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).

ctcsound.py is installed with Csound since version 6.07.


csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:

 - csoundmagics.py, the ipython extension
 - csound.js, a CodeMirror mode providing syntax highligting for Csound code
 - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.

csoundmagics uses ctcsound where icsound used csnd6.

Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.

Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.

When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.

Regards

François

2016-05-29 16:49 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
Hi Francois,

This is excellent work, and what I wanted icsound to be.

Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?

I'm thinking the time is near to retire icsound...

Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.

Cheers,
Andrés

On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/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-05-31 09:21
FromRichard
SubjectRe: Jupyter notebook

Thanks, that solves it!

Richard


On 31/05/16 09:54, Francois PINOT wrote:
Csound 6.07 installs csnd6.py and ctcsound.py in the same dir for Python 2.

Type the following commands from a Python 3 console:

import sys
sys.path

Copy ctcsound.py in one of the paths returned by sys.path (usually site-packages is used). You'll then have a copy of ctcsound.py in Python 2 PYTHONPATH and in PYTHON 3 PYTHONPATH.

François

2016-05-31 9:17 GMT+02:00 Richard <zappfinger@gmail.com>:

Yes that works. I was not sure if I installed csound 6.07 before installing Anaconda, so I re-installed csound, hoping it would install for the new default Python. Unfortunately, it does not work still.


Richard


On 31/05/16 00:36, Francois PINOT wrote:

Can you import it from a Python 2 session?

François

Le 31 mai 2016 12:02 AM, "Richard" <zappfinger@gmail.com> a écrit :

I get 'no module named  ctcsound' in my note book, but also in python.

Python defaults now to version 3.5.1, after I installed Anaconda (I already have 2.7)
I guess something is wrong with the path(s)? This is on OS X.

Richard


On 30/05/16 17:29, Francois PINOT wrote:
Actually yes. The question is about having a python array type corresponding to Csound MYFLT arrays (in the sense of C arrays). In csnd6, this is done with helper classes, e.g. CsoundMYFLTArray. Numpy arrays are very efficient and the numpy API exposes means to have a pointer for the data part of the numpy array pointing to the memory block of the Csound C array. So numpy provides all the machinery to yield efficiently the C pointers that are exposed by the Csound C API.

numpy is installed very easily (e.g. pip install numpy) and if you work with Jupyter notebooks, it's already there.

François

2016-05-30 16:36 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
That sounds great. I agree that ctcsound should replace csnd6. My only question about that would be is numpy a hard dependency of ctcsound?

Cheers,
Andrés

On Mon, May 30, 2016 at 3:01 AM, Francois PINOT <fggpinot@gmail.com> wrote:
Hi Andrés,

ctcsound is a module with the same functionality than csnd6: a wrapper to the Csound API for the Python language. The differences are:

- ctcsound uses ctypes instead of SWIG
- ctcsound works with Python 2 and Python 3 as well
- ctcsound uses numpy arrays pointing directly in Csound data (for in/out buffers, ftables, and channels).

ctcsound.py is installed with Csound since version 6.07.


csoundsmagics (https://github.com/fggp/ctcsound/tree/master/cookbook/csoundmagics) is an IPython extension defining magics and functions for Csound in the Jupyter notebook. csoundmagics is made of three files:

 - csoundmagics.py, the ipython extension
 - csound.js, a CodeMirror mode providing syntax highligting for Csound code
 - installCsoundmagics.py, a script to copy csoundmagics.py and csound.js in the right place in the jupyter tree.

csoundmagics uses ctcsound where icsound used csnd6.

Once installed, csoundmagics can be activated in the classical way in a notebook with this command: %load_ext csoundmagics.

Actually csoundmagics offers rather simple functionalities: basic edition of csd's, sco, and orc, and running them. Most of the features of icsound can be added to csoundmagics. I'll investigate this and let you know how it goes.

When csoundmagics will be mature enough, we can add an entry in http://csound.github.io/create.html as Rory has suggested.

Regards

François

2016-05-29 16:49 GMT+02:00 Andres Cabrera <mantaraya36@gmail.com>:
Hi Francois,

This is excellent work, and what I wanted icsound to be.

Can you consider adding the few things that icsound can do that ctcsound can't? For instance the ability to start an engine listening for network events and for creating engines that connect to remote servers (all with the same api). Also, I'm not sure if I am understanding the instructions correctly, but it seems you need an additional download to enable the magics. I am doing it with python code in icsound, but perhaps you need to do it that way for the syntax highlighter?

I'm thinking the time is near to retire icsound...

Also perhaps a next step is to write some python classes that then can do code generation, so you can write your signal processing chain in python, that compiles down to csound code.

Cheers,
Andrés

On Sat, May 28, 2016 at 10:30 PM, Francois PINOT <fggpinot@gmail.com> wrote:
I recently developed a new Python wrapper module for the Csound API: ctcsound. This module works with Python 2 and Python 3 as well, and it is now distributed with Csound (since version 6.07).

I'm actually writing a cookbook with recipes about ctcsound and Csound. This cookbook is developed using the Jupyter notebook framework (http://jupyter.org/, formerly IPython project): https://github.com/fggp/ctcsound/tree/master/cookbook.

The fifth and the sixth recipes show how to extend Jupyter with magic commands for editing and running csd's, orchestra, and scores in a notebook code cell. Syntax highlighting is also added for Csound through a mode for CodeMirror (https://codemirror.net/) which is the editor used by Jupyter in the notebook cells.

As a side effect, people interested in using this CodeMirror mode for their own projects can download it from the cookbook: https://github.com/fggp/ctcsound/blob/master/cookbook/csoundmagics/csound.js

Regards

Francois
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?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

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