Csound Csound-dev Csound-tekno Search About

[Cs-dev] Csound on the Web and in Browsers

Date2013-11-01 15:53
FromMichael Gogins
Subject[Cs-dev] Csound on the Web and in Browsers
AttachmentsNone  None  
A bit of research shows that NPRuntime (used to be NPAPI) can be used to produce C++ DLLs that are callable from Web browsers and even scriptable. Also that Node.js has a facility node-ffi for calling C/C++ code from server-side JavaScript.

Questions for you all (especially Steven Yi):

Are there better solutions for these uses, i.e. running Csound in a Web browser, and running Csound in a Web server? If so what are they?

Regards,
Mike

===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com

Date2013-11-01 16:05
FromSteven Yi
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
I've been working with Ed Costello in getting Csound to compile with
Emscripten[1], which compiles to Javascript.  We're both working on it
off and on as time allows.  We got Csound to compile and Ed wrote a
test program that has sound output, using Web Audio API and using
Csound to generate sounds.

I think this is a more promising solution than plugins, as the browser
makers are moving away from NPAPI. (Chrome is going to drop next year,
I think Firefox will too)

Some notes:

1. I'm running the emscripten generated libcsound64.js myself in node.js.
2. Currently there is an issue we're trying to sort out where the
static init modules stuff is failing in the emscripten generated code,
and it looks like it has to do with some issues related to function
pointers
3. We had to modify Csound such that it would allow compiling even if
you did not have pthreads.  We did this with some changes to CMake and
some modifications of source files to #ifdef around if pthreads was
available or not.
4. The basic test Ed wrote allowed creating sounds, so I think that at
least as a proof of concept it works.  Still plenty of further
research to do.
5. This system just generates Javascript, and therefore no plugins are
necessary for a user to install.
6. No measurements on performance, but emscripten has a demo where
they compiled the unreal game engine and have it working.
7. We're going to look at exposing the Csound C++ API. Emscripten has
a tool call embind which acts a lot like Swig.  I think the idea
scenario has us writing javascript code much like we would for python
in terms of using the csound API.

That's the latest with that research, Ed and I will report once we get
a bit further. If others are interested, we had done the csound
changes in a private repo shared between us, but we could also create
a feature branch in CS6 and apply our changes there.

Thanks!
steven


[1] - http://www.emscripten.org

On Fri, Nov 1, 2013 at 11:53 AM, Michael Gogins
 wrote:
> A bit of research shows that NPRuntime (used to be NPAPI) can be used to
> produce C++ DLLs that are callable from Web browsers and even scriptable.
> Also that Node.js has a facility node-ffi for calling C/C++ code from
> server-side JavaScript.
>
> Questions for you all (especially Steven Yi):
>
> Are there better solutions for these uses, i.e. running Csound in a Web
> browser, and running Csound in a Web server? If so what are they?
>
> Regards,
> Mike
>
> ===========================
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-11-01 16:16
FromRichard Dobson
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
This is very exciting. For school education purposes (kids learning what 
"iteration" means, what a "while loop" is and so on), I would be more 
than happy to see a "simplified" or reduced version of Csound (in terms 
of both language and opcodes etc) if that can expedite these developments.

Richard Dobson

On 01/11/2013 16:05, Steven Yi wrote:
> I've been working with Ed Costello in getting Csound to compile with
> Emscripten[1], which compiles to Javascript.  We're both working on it
> off and on as time allows.  We got Csound to compile and Ed wrote a
> test program that has sound output, using Web Audio API and using
> Csound to generate sounds.
>
> I think this is a more promising solution than plugins, as the browser
> makers are moving away from NPAPI. (Chrome is going to drop next year,
> I think Firefox will too)
>
> Some notes:
>
> 1. I'm running the emscripten generated libcsound64.js myself in node.js.
> 2. Currently there is an issue we're trying to sort out where the
> static init modules stuff is failing in the emscripten generated code,
> and it looks like it has to do with some issues related to function
> pointers
> 3. We had to modify Csound such that it would allow compiling even if
> you did not have pthreads.  We did this with some changes to CMake and
> some modifications of source files to #ifdef around if pthreads was
> available or not.
> 4. The basic test Ed wrote allowed creating sounds, so I think that at
> least as a proof of concept it works.  Still plenty of further
> research to do.
> 5. This system just generates Javascript, and therefore no plugins are
> necessary for a user to install.
> 6. No measurements on performance, but emscripten has a demo where
> they compiled the unreal game engine and have it working.
> 7. We're going to look at exposing the Csound C++ API. Emscripten has
> a tool call embind which acts a lot like Swig.  I think the idea
> scenario has us writing javascript code much like we would for python
> in terms of using the csound API.
>
> That's the latest with that research, Ed and I will report once we get
> a bit further. If others are interested, we had done the csound
> changes in a private repo shared between us, but we could also create
> a feature branch in CS6 and apply our changes there.
>
> Thanks!
> steven
>


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-11-01 17:45
FromMichael Gogins
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
AttachmentsNone  None  
I agree, this is well worth pursuing. And I hadn't forgotten your earlier mention of Emscripten to me! 

But I have people asking me for things like this that will work now.

Best,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Nov 1, 2013 at 12:16 PM, Richard Dobson <richarddobson@blueyonder.co.uk> wrote:
This is very exciting. For school education purposes (kids learning what
"iteration" means, what a "while loop" is and so on), I would be more
than happy to see a "simplified" or reduced version of Csound (in terms
of both language and opcodes etc) if that can expedite these developments.

Richard Dobson

On 01/11/2013 16:05, Steven Yi wrote:
> I've been working with Ed Costello in getting Csound to compile with
> Emscripten[1], which compiles to Javascript.  We're both working on it
> off and on as time allows.  We got Csound to compile and Ed wrote a
> test program that has sound output, using Web Audio API and using
> Csound to generate sounds.
>
> I think this is a more promising solution than plugins, as the browser
> makers are moving away from NPAPI. (Chrome is going to drop next year,
> I think Firefox will too)
>
> Some notes:
>
> 1. I'm running the emscripten generated libcsound64.js myself in node.js.
> 2. Currently there is an issue we're trying to sort out where the
> static init modules stuff is failing in the emscripten generated code,
> and it looks like it has to do with some issues related to function
> pointers
> 3. We had to modify Csound such that it would allow compiling even if
> you did not have pthreads.  We did this with some changes to CMake and
> some modifications of source files to #ifdef around if pthreads was
> available or not.
> 4. The basic test Ed wrote allowed creating sounds, so I think that at
> least as a proof of concept it works.  Still plenty of further
> research to do.
> 5. This system just generates Javascript, and therefore no plugins are
> necessary for a user to install.
> 6. No measurements on performance, but emscripten has a demo where
> they compiled the unreal game engine and have it working.
> 7. We're going to look at exposing the Csound C++ API. Emscripten has
> a tool call embind which acts a lot like Swig.  I think the idea
> scenario has us writing javascript code much like we would for python
> in terms of using the csound API.
>
> That's the latest with that research, Ed and I will report once we get
> a bit further. If others are interested, we had done the csound
> changes in a private repo shared between us, but we could also create
> a feature branch in CS6 and apply our changes there.
>
> Thanks!
> steven
>


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2013-11-01 17:51
FromSteven Yi
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
AttachmentsNone  None  
I think with Emscripten, it has a facility to compile libs and allow library loading to work. I would out that I a nice to have category. Otherwise, we should be able to have all of lib csound in the release. So the same Csd that runs in android and iOS will run on JavaScript. As an end goal for first release, I think it would be nice to have a simple HTML interface that allows editing Orc and sco, and might even allow live coding. That should be reasonably easy to do if/when the other work goes through and we can do csound API calls easily from JS. Lots of possibilities and options to create educational sites!

On Friday, November 1, 2013, Richard Dobson wrote:
This is very exciting. For school education purposes (kids learning what
"iteration" means, what a "while loop" is and so on), I would be more
than happy to see a "simplified" or reduced version of Csound (in terms
of both language and opcodes etc) if that can expedite these developments.

Richard Dobson

On 01/11/2013 16:05, Steven Yi wrote:
> I've been working with Ed Costello in getting Csound to compile with
> Emscripten[1], which compiles to Javascript.  We're both working on it
> off and on as time allows.  We got Csound to compile and Ed wrote a
> test program that has sound output, using Web Audio API and using
> Csound to generate sounds.
>
> I think this is a more promising solution than plugins, as the browser
> makers are moving away from NPAPI. (Chrome is going to drop next year,
> I think Firefox will too)
>
> Some notes:
>
> 1. I'm running the emscripten generated libcsound64.js myself in node.js.
> 2. Currently there is an issue we're trying to sort out where the
> static init modules stuff is failing in the emscripten generated code,
> and it looks like it has to do with some issues related to function
> pointers
> 3. We had to modify Csound such that it would allow compiling even if
> you did not have pthreads.  We did this with some changes to CMake and
> some modifications of source files to #ifdef around if pthreads was
> available or not.
> 4. The basic test Ed wrote allowed creating sounds, so I think that at
> least as a proof of concept it works.  Still plenty of further
> research to do.
> 5. This system just generates Javascript, and therefore no plugins are
> necessary for a user to install.
> 6. No measurements on performance, but emscripten has a demo where
> they compiled the unreal game engine and have it working.
> 7. We're going to look at exposing the Csound C++ API. Emscripten has
> a tool call embind which acts a lot like Swig.  I think the idea
> scenario has us writing javascript code much like we would for python
> in terms of using the csound API.
>
> That's the latest with that research, Ed and I will report once we get
> a bit further. If others are interested, we had done the csound
> changes in a private repo shared between us, but we could also create
> a feature branch in CS6 and apply our changes there.
>
> Thanks!
> steven
>


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Date2013-11-01 17:55
FromSteven Yi
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
AttachmentsNone  None  
For things that work now, for browser I don't think we have anything currently. For server, it would depend on server technology used, and I imagine any can at the least do like netcsound and do renders to disk running csound in a process, and Use use the API otherwise.your mention of node-ffi makes me wonder if we should do a JavaScript version of hue he API examples too. ;)

As for timeline on Emscripten, it could be as early as next week that we have something to start testing generally with. But it all depends on how long it takes to figure out the static init issue, and the libcsnd6 wrapping.

On Friday, November 1, 2013, Michael Gogins wrote:
I agree, this is well worth pursuing. And I hadn't forgotten your earlier mention of Emscripten to me! 

But I have people asking me for things like this that will work now.

Best,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Nov 1, 2013 at 12:16 PM, Richard Dobson <richarddobson@blueyonder.co.uk> wrote:
This is very exciting. For school education purposes (kids learning what
"iteration" means, what a "while loop" is and so on), I would be more
than happy to see a "simplified" or reduced version of Csound (in terms
of both language and opcodes etc) if that can expedite these developments.

Richard Dobson

On 01/11/2013 16:05, Steven Yi wrote:
> I've been working with Ed Costello in getting Csound to compile with
> Emscripten[1], which compiles to Javascript.  We're both working on it
> off and on as time allows.  We got Csound to compile and Ed wrote a
> test program that has sound output, using Web Audio API and using
> Csound to generate sounds.
>
> I think this is a more promising solution than plugins, as the browser
> makers are moving away from NPAPI. (Chrome is going to drop next year,
> I think Firefox will too)
>
> Some notes:
>
> 1. I'm running the emscripten generated libcsound64.js myself in node.js.
> 2. Currently there is an issue we're trying to sort out where the
> static init modules stuff is failing in the emscripten generated code,
> and it looks like it has to do with some issues related to function
> pointers
> 3. We had to modify Csound such that it would allow compiling even if
> you did not have pthreads.  We did this with some changes to CMake and
> some modifications of source files to #ifdef around if pthreads was
> available or not.
> 4. The basic test Ed wrote allowed creating sounds, so I think that at
> least as a proof of concept it works.  Still plenty of further
> research to do.
> 5. This system just generates Javascript, and therefore no plugins are
> necessary for a user to install.
> 6. No measurements on performance, but emscripten has a demo where
> they compiled the unreal game engine and have it working.
> 7. We're going to look at exposing the Csound C++ API. Emscripten has
> a tool call embind which acts a lot like Swig.  I think the idea
> scenario has us writing javascript code much like we would for python
> in terms of using the csound API.
>
> That's the latest with that research, Ed and I will report once we get
> a bit further. If others are interested, we had done the csound
> changes in a private repo shared between us, but we could also create
> a feature branch in CS6 and apply our changes there.
>
> Thanks!
> steven
>


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2013-11-01 19:30
FromMichael Gogins
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
AttachmentsNone  None  
An important question. Suppose you compile Csound to JavaScript using CLang/Emscripten. Suppose you load this .js file into a browser. Can other JavaScript in the browser then call the Csound API, e.g. to load a csd and perform it? What about file access?

If the API calls are possible in JavaScript, then it would make sense to do algorithmic composition in JavaScript.

Obviously anything the browser can do, server-side JavaScript can do also.

Best,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Nov 1, 2013 at 1:51 PM, Steven Yi <stevenyi@gmail.com> wrote:
I think with Emscripten, it has a facility to compile libs and allow library loading to work. I would out that I a nice to have category. Otherwise, we should be able to have all of lib csound in the release. So the same Csd that runs in android and iOS will run on JavaScript. As an end goal for first release, I think it would be nice to have a simple HTML interface that allows editing Orc and sco, and might even allow live coding. That should be reasonably easy to do if/when the other work goes through and we can do csound API calls easily from JS. Lots of possibilities and options to create educational sites!


On Friday, November 1, 2013, Richard Dobson wrote:
This is very exciting. For school education purposes (kids learning what
"iteration" means, what a "while loop" is and so on), I would be more
than happy to see a "simplified" or reduced version of Csound (in terms
of both language and opcodes etc) if that can expedite these developments.

Richard Dobson

On 01/11/2013 16:05, Steven Yi wrote:
> I've been working with Ed Costello in getting Csound to compile with
> Emscripten[1], which compiles to Javascript.  We're both working on it
> off and on as time allows.  We got Csound to compile and Ed wrote a
> test program that has sound output, using Web Audio API and using
> Csound to generate sounds.
>
> I think this is a more promising solution than plugins, as the browser
> makers are moving away from NPAPI. (Chrome is going to drop next year,
> I think Firefox will too)
>
> Some notes:
>
> 1. I'm running the emscripten generated libcsound64.js myself in node.js.
> 2. Currently there is an issue we're trying to sort out where the
> static init modules stuff is failing in the emscripten generated code,
> and it looks like it has to do with some issues related to function
> pointers
> 3. We had to modify Csound such that it would allow compiling even if
> you did not have pthreads.  We did this with some changes to CMake and
> some modifications of source files to #ifdef around if pthreads was
> available or not.
> 4. The basic test Ed wrote allowed creating sounds, so I think that at
> least as a proof of concept it works.  Still plenty of further
> research to do.
> 5. This system just generates Javascript, and therefore no plugins are
> necessary for a user to install.
> 6. No measurements on performance, but emscripten has a demo where
> they compiled the unreal game engine and have it working.
> 7. We're going to look at exposing the Csound C++ API. Emscripten has
> a tool call embind which acts a lot like Swig.  I think the idea
> scenario has us writing javascript code much like we would for python
> in terms of using the csound API.
>
> That's the latest with that research, Ed and I will report once we get
> a bit further. If others are interested, we had done the csound
> changes in a private repo shared between us, but we could also create
> a feature branch in CS6 and apply our changes there.
>
> Thanks!
> steven
>


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



Date2013-11-01 19:37
FromSteven Yi
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
I think that's the goal, that you can call Csound via javascript as if
it was a Swig wrapped language, i.e.:




and yes, having algorithmic score generation should be supported.  As
for resources, Ed has looked at that a little bit and might be able to
comment, as I have not really looked at that part.

On Fri, Nov 1, 2013 at 3:30 PM, Michael Gogins  wrote:
> An important question. Suppose you compile Csound to JavaScript using
> CLang/Emscripten. Suppose you load this .js file into a browser. Can other
> JavaScript in the browser then call the Csound API, e.g. to load a csd and
> perform it? What about file access?
>
> If the API calls are possible in JavaScript, then it would make sense to do
> algorithmic composition in JavaScript.
>
> Obviously anything the browser can do, server-side JavaScript can do also.
>
> Best,
> Mike
>
>
> ===========================
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Fri, Nov 1, 2013 at 1:51 PM, Steven Yi  wrote:
>>
>> I think with Emscripten, it has a facility to compile libs and allow
>> library loading to work. I would out that I a nice to have category.
>> Otherwise, we should be able to have all of lib csound in the release. So
>> the same Csd that runs in android and iOS will run on JavaScript. As an end
>> goal for first release, I think it would be nice to have a simple HTML
>> interface that allows editing Orc and sco, and might even allow live coding.
>> That should be reasonably easy to do if/when the other work goes through and
>> we can do csound API calls easily from JS. Lots of possibilities and options
>> to create educational sites!
>>
>>
>> On Friday, November 1, 2013, Richard Dobson wrote:
>>>
>>> This is very exciting. For school education purposes (kids learning what
>>> "iteration" means, what a "while loop" is and so on), I would be more
>>> than happy to see a "simplified" or reduced version of Csound (in terms
>>> of both language and opcodes etc) if that can expedite these
>>> developments.
>>>
>>> Richard Dobson
>>>
>>> On 01/11/2013 16:05, Steven Yi wrote:
>>> > I've been working with Ed Costello in getting Csound to compile with
>>> > Emscripten[1], which compiles to Javascript.  We're both working on it
>>> > off and on as time allows.  We got Csound to compile and Ed wrote a
>>> > test program that has sound output, using Web Audio API and using
>>> > Csound to generate sounds.
>>> >
>>> > I think this is a more promising solution than plugins, as the browser
>>> > makers are moving away from NPAPI. (Chrome is going to drop next year,
>>> > I think Firefox will too)
>>> >
>>> > Some notes:
>>> >
>>> > 1. I'm running the emscripten generated libcsound64.js myself in
>>> > node.js.
>>> > 2. Currently there is an issue we're trying to sort out where the
>>> > static init modules stuff is failing in the emscripten generated code,
>>> > and it looks like it has to do with some issues related to function
>>> > pointers
>>> > 3. We had to modify Csound such that it would allow compiling even if
>>> > you did not have pthreads.  We did this with some changes to CMake and
>>> > some modifications of source files to #ifdef around if pthreads was
>>> > available or not.
>>> > 4. The basic test Ed wrote allowed creating sounds, so I think that at
>>> > least as a proof of concept it works.  Still plenty of further
>>> > research to do.
>>> > 5. This system just generates Javascript, and therefore no plugins are
>>> > necessary for a user to install.
>>> > 6. No measurements on performance, but emscripten has a demo where
>>> > they compiled the unreal game engine and have it working.
>>> > 7. We're going to look at exposing the Csound C++ API. Emscripten has
>>> > a tool call embind which acts a lot like Swig.  I think the idea
>>> > scenario has us writing javascript code much like we would for python
>>> > in terms of using the csound API.
>>> >
>>> > That's the latest with that research, Ed and I will report once we get
>>> > a bit further. If others are interested, we had done the csound
>>> > changes in a private repo shared between us, but we could also create
>>> > a feature branch in CS6 and apply our changes there.
>>> >
>>> > Thanks!
>>> > steven
>>> >
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Android is increasing in popularity, but the open development platform
>>> that
>>> developers love is also attractive to malware creators. Download this
>>> white
>>> paper to learn more about secure code signing practices that can help
>>> keep
>>> Android apps secure.
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Android is increasing in popularity, but the open development platform
>> that
>> developers love is also attractive to malware creators. Download this
>> white
>> paper to learn more about secure code signing practices that can help keep
>> Android apps secure.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
>
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-11-02 15:23
FromEdward Costello
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
AttachmentsNone  None  None  None  

Date2013-11-02 16:29
FromMichael Gogins
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
AttachmentsNone  None  
Thanks for the information. I am very interested in this project for many reasons. 

Can you get files from your computer's local filesystem into this Emscripten virtual filesystem? Or do you have to download them from the Internet?

Regards,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Nov 2, 2013 at 11:23 AM, Edward Costello <edwardcostello@gmail.com> wrote:
In so far as file access, Emscripten uses a virtual file system that is accessible to programs using the standard C library. There are a number of Emscripten javascript functions you can use to upload a file from the browser, make folders etc. I have a working example of opening a csd with the browser which is then compiled and run using Csound.js. I’m sure it is also possible to upload audio files as well although I have tested that yet.

-- 
Edward Costello


On Friday 1 November 2013 at 20:30, Michael Gogins wrote:

An important question. Suppose you compile Csound to JavaScript using CLang/Emscripten. Suppose you load this .js file into a browser. Can other JavaScript in the browser then call the Csound API, e.g. to load a csd and perform it? What about file access?

If the API calls are possible in JavaScript, then it would make sense to do algorithmic composition in JavaScript.

Obviously anything the browser can do, server-side JavaScript can do also.

Best,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Nov 1, 2013 at 1:51 PM, Steven Yi <stevenyi@gmail.com> wrote:
I think with Emscripten, it has a facility to compile libs and allow library loading to work. I would out that I a nice to have category. Otherwise, we should be able to have all of lib csound in the release. So the same Csd that runs in android and iOS will run on JavaScript. As an end goal for first release, I think it would be nice to have a simple HTML interface that allows editing Orc and sco, and might even allow live coding. That should be reasonably easy to do if/when the other work goes through and we can do csound API calls easily from JS. Lots of possibilities and options to create educational sites!


On Friday, November 1, 2013, Richard Dobson wrote:
This is very exciting. For school education purposes (kids learning what
"iteration" means, what a "while loop" is and so on), I would be more
than happy to see a "simplified" or reduced version of Csound (in terms
of both language and opcodes etc) if that can expedite these developments.

Richard Dobson

On 01/11/2013 16:05, Steven Yi wrote:
> I've been working with Ed Costello in getting Csound to compile with
> Emscripten[1], which compiles to Javascript.  We're both working on it
> off and on as time allows.  We got Csound to compile and Ed wrote a
> test program that has sound output, using Web Audio API and using
> Csound to generate sounds.
>
> I think this is a more promising solution than plugins, as the browser
> makers are moving away from NPAPI. (Chrome is going to drop next year,
> I think Firefox will too)
>
> Some notes:
>
> 1. I'm running the emscripten generated libcsound64.js myself in node.js.
> 2. Currently there is an issue we're trying to sort out where the
> static init modules stuff is failing in the emscripten generated code,
> and it looks like it has to do with some issues related to function
> pointers
> 3. We had to modify Csound such that it would allow compiling even if
> you did not have pthreads.  We did this with some changes to CMake and
> some modifications of source files to #ifdef around if pthreads was
> available or not.
> 4. The basic test Ed wrote allowed creating sounds, so I think that at
> least as a proof of concept it works.  Still plenty of further
> research to do.
> 5. This system just generates Javascript, and therefore no plugins are
> necessary for a user to install.
> 6. No measurements on performance, but emscripten has a demo where
> they compiled the unreal game engine and have it working.
> 7. We're going to look at exposing the Csound C++ API. Emscripten has
> a tool call embind which acts a lot like Swig.  I think the idea
> scenario has us writing javascript code much like we would for python
> in terms of using the csound API.
>
> That's the latest with that research, Ed and I will report once we get
> a bit further. If others are interested, we had done the csound
> changes in a private repo shared between us, but we could also create
> a feature branch in CS6 and apply our changes there.
>
> Thanks!
> steven
>


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
_______________________________________________
Csound-devel mailing list


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



Date2013-11-02 16:59
FromEdward Costello
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
AttachmentsNone  None  None  None  

Date2013-11-02 17:01
FromDave Seidel
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
AttachmentsNone  None  
It might be worth looking at what Fargo (http://fargo.io) and its smaller sibling at littleoutliner.com do. They are both 100% HTML5+JavaScript. The latter uses the HTML5 localStorage facility, and the former uses DropBox as a file store.

- Dave


On Sat, Nov 2, 2013 at 12:29 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
Thanks for the information. I am very interested in this project for many reasons. 

Can you get files from your computer's local filesystem into this Emscripten virtual filesystem? Or do you have to download them from the Internet?

Regards,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Nov 2, 2013 at 11:23 AM, Edward Costello <edwardcostello@gmail.com> wrote:
In so far as file access, Emscripten uses a virtual file system that is accessible to programs using the standard C library. There are a number of Emscripten javascript functions you can use to upload a file from the browser, make folders etc. I have a working example of opening a csd with the browser which is then compiled and run using Csound.js. I’m sure it is also possible to upload audio files as well although I have tested that yet.

-- 
Edward Costello


On Friday 1 November 2013 at 20:30, Michael Gogins wrote:

An important question. Suppose you compile Csound to JavaScript using CLang/Emscripten. Suppose you load this .js file into a browser. Can other JavaScript in the browser then call the Csound API, e.g. to load a csd and perform it? What about file access?

If the API calls are possible in JavaScript, then it would make sense to do algorithmic composition in JavaScript.

Obviously anything the browser can do, server-side JavaScript can do also.

Best,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Nov 1, 2013 at 1:51 PM, Steven Yi <stevenyi@gmail.com> wrote:
I think with Emscripten, it has a facility to compile libs and allow library loading to work. I would out that I a nice to have category. Otherwise, we should be able to have all of lib csound in the release. So the same Csd that runs in android and iOS will run on JavaScript. As an end goal for first release, I think it would be nice to have a simple HTML interface that allows editing Orc and sco, and might even allow live coding. That should be reasonably easy to do if/when the other work goes through and we can do csound API calls easily from JS. Lots of possibilities and options to create educational sites!


On Friday, November 1, 2013, Richard Dobson wrote:
This is very exciting. For school education purposes (kids learning what
"iteration" means, what a "while loop" is and so on), I would be more
than happy to see a "simplified" or reduced version of Csound (in terms
of both language and opcodes etc) if that can expedite these developments.

Richard Dobson

On 01/11/2013 16:05, Steven Yi wrote:
> I've been working with Ed Costello in getting Csound to compile with
> Emscripten[1], which compiles to Javascript.  We're both working on it
> off and on as time allows.  We got Csound to compile and Ed wrote a
> test program that has sound output, using Web Audio API and using
> Csound to generate sounds.
>
> I think this is a more promising solution than plugins, as the browser
> makers are moving away from NPAPI. (Chrome is going to drop next year,
> I think Firefox will too)
>
> Some notes:
>
> 1. I'm running the emscripten generated libcsound64.js myself in node.js.
> 2. Currently there is an issue we're trying to sort out where the
> static init modules stuff is failing in the emscripten generated code,
> and it looks like it has to do with some issues related to function
> pointers
> 3. We had to modify Csound such that it would allow compiling even if
> you did not have pthreads.  We did this with some changes to CMake and
> some modifications of source files to #ifdef around if pthreads was
> available or not.
> 4. The basic test Ed wrote allowed creating sounds, so I think that at
> least as a proof of concept it works.  Still plenty of further
> research to do.
> 5. This system just generates Javascript, and therefore no plugins are
> necessary for a user to install.
> 6. No measurements on performance, but emscripten has a demo where
> they compiled the unreal game engine and have it working.
> 7. We're going to look at exposing the Csound C++ API. Emscripten has
> a tool call embind which acts a lot like Swig.  I think the idea
> scenario has us writing javascript code much like we would for python
> in terms of using the csound API.
>
> That's the latest with that research, Ed and I will report once we get
> a bit further. If others are interested, we had done the csound
> changes in a private repo shared between us, but we could also create
> a feature branch in CS6 and apply our changes there.
>
> Thanks!
> steven
>


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
_______________________________________________
Csound-devel mailing list


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



Date2013-11-02 17:04
FromVictor Lazzarini
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
How did you solve the libsndfile dependency?
On 2 Nov 2013, at 16:59, Edward Costello wrote:

> Yes, the example I have opens a csd file on the computers local file system.
> 
> -- 
> Edward Costello
> 
> On Saturday 2 November 2013 at 17:29, Michael Gogins wrote:
> 
>> Thanks for the information. I am very interested in this project for many reasons. 
>> 
>> Can you get files from your computer's local filesystem into this Emscripten virtual filesystem? Or do you have to download them from the Internet?
>> 
>> Regards,
>> Mike
>> 
>> 
>> ===========================
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>> 
>> 
>> On Sat, Nov 2, 2013 at 11:23 AM, Edward Costello  wrote:
>>> In so far as file access, Emscripten uses a virtual file system that is accessible to programs using the standard C library. There are a number of Emscripten javascript functions you can use to upload a file from the browser, make folders etc. I have a working example of opening a csd with the browser which is then compiled and run using Csound.js. I’m sure it is also possible to upload audio files as well although I have tested that yet.
>>> 
>>> -- 
>>> Edward Costello
>>> 
>>> 
>>> On Friday 1 November 2013 at 20:30, Michael Gogins wrote:
>>> 
>>>> An important question. Suppose you compile Csound to JavaScript using CLang/Emscripten. Suppose you load this .js file into a browser. Can other JavaScript in the browser then call the Csound API, e.g. to load a csd and perform it? What about file access?
>>>> 
>>>> If the API calls are possible in JavaScript, then it would make sense to do algorithmic composition in JavaScript.
>>>> 
>>>> Obviously anything the browser can do, server-side JavaScript can do also.
>>>> 
>>>> Best,
>>>> Mike
>>>> 
>>>> 
>>>> ===========================
>>>> Michael Gogins
>>>> Irreducible Productions
>>>> http://michaelgogins.tumblr.com
>>>> Michael dot Gogins at gmail dot com
>>>> 
>>>> 
>>>> On Fri, Nov 1, 2013 at 1:51 PM, Steven Yi  wrote:
>>>>> I think with Emscripten, it has a facility to compile libs and allow library loading to work. I would out that I a nice to have category. Otherwise, we should be able to have all of lib csound in the release. So the same Csd that runs in android and iOS will run on JavaScript. As an end goal for first release, I think it would be nice to have a simple HTML interface that allows editing Orc and sco, and might even allow live coding. That should be reasonably easy to do if/when the other work goes through and we can do csound API calls easily from JS. Lots of possibilities and options to create educational sites!
>>>>> 
>>>>> 
>>>>> On Friday, November 1, 2013, Richard Dobson wrote:
>>>>>> This is very exciting. For school education purposes (kids learning what
>>>>>> "iteration" means, what a "while loop" is and so on), I would be more
>>>>>> than happy to see a "simplified" or reduced version of Csound (in terms
>>>>>> of both language and opcodes etc) if that can expedite these developments.
>>>>>> 
>>>>>> Richard Dobson
>>>>>> 
>>>>>> On 01/11/2013 16:05, Steven Yi wrote:
>>>>>> > I've been working with Ed Costello in getting Csound to compile with
>>>>>> > Emscripten[1], which compiles to Javascript.  We're both working on it
>>>>>> > off and on as time allows.  We got Csound to compile and Ed wrote a
>>>>>> > test program that has sound output, using Web Audio API and using
>>>>>> > Csound to generate sounds.
>>>>>> >
>>>>>> > I think this is a more promising solution than plugins, as the browser
>>>>>> > makers are moving away from NPAPI. (Chrome is going to drop next year,
>>>>>> > I think Firefox will too)
>>>>>> >
>>>>>> > Some notes:
>>>>>> >
>>>>>> > 1. I'm running the emscripten generated libcsound64.js myself in node.js.
>>>>>> > 2. Currently there is an issue we're trying to sort out where the
>>>>>> > static init modules stuff is failing in the emscripten generated code,
>>>>>> > and it looks like it has to do with some issues related to function
>>>>>> > pointers
>>>>>> > 3. We had to modify Csound such that it would allow compiling even if
>>>>>> > you did not have pthreads.  We did this with some changes to CMake and
>>>>>> > some modifications of source files to #ifdef around if pthreads was
>>>>>> > available or not.
>>>>>> > 4. The basic test Ed wrote allowed creating sounds, so I think that at
>>>>>> > least as a proof of concept it works.  Still plenty of further
>>>>>> > research to do.
>>>>>> > 5. This system just generates Javascript, and therefore no plugins are
>>>>>> > necessary for a user to install.
>>>>>> > 6. No measurements on performance, but emscripten has a demo where
>>>>>> > they compiled the unreal game engine and have it working.
>>>>>> > 7. We're going to look at exposing the Csound C++ API. Emscripten has
>>>>>> > a tool call embind which acts a lot like Swig.  I think the idea
>>>>>> > scenario has us writing javascript code much like we would for python
>>>>>> > in terms of using the csound API.
>>>>>> >
>>>>>> > That's the latest with that research, Ed and I will report once we get
>>>>>> > a bit further. If others are interested, we had done the csound
>>>>>> > changes in a private repo shared between us, but we could also create
>>>>>> > a feature branch in CS6 and apply our changes there.
>>>>>> >
>>>>>> > Thanks!
>>>>>> > steven
>>>>>> >
>>>>>> 
>>>>>> 
>>>>>> ------------------------------------------------------------------------------
>>>>>> Android is increasing in popularity, but the open development platform that
>>>>>> developers love is also attractive to malware creators. Download this white
>>>>>> paper to learn more about secure code signing practices that can help keep
>>>>>> Android apps secure.
>>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> Android is increasing in popularity, but the open development platform that
>>>>> developers love is also attractive to malware creators. Download this white
>>>>> paper to learn more about secure code signing practices that can help keep
>>>>> Android apps secure.
>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> 
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Android is increasing in popularity, but the open development platform that
>>>> developers love is also attractive to malware creators. Download this white
>>>> paper to learn more about secure code signing practices that can help keep
>>>> Android apps secure.
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> 
>>> 
>>> ------------------------------------------------------------------------------
>>> Android is increasing in popularity, but the open development platform that
>>> developers love is also attractive to malware creators. Download this white
>>> paper to learn more about secure code signing practices that can help keep
>>> Android apps secure.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> 
>> 
>> ------------------------------------------------------------------------------
>> Android is increasing in popularity, but the open development platform that
>> developers love is also attractive to malware creators. Download this white
>> paper to learn more about secure code signing practices that can help keep
>> Android apps secure.
>> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-11-02 17:21
FromEdward Costello
SubjectRe: [Cs-dev] Csound on the Web and in Browsers
AttachmentsNone  None  None  None