Csound Csound-dev Csound-tekno Search About

[Cs-dev] HTML5 Interfaces

Date2015-02-23 21:56
FromMichael Gogins
Subject[Cs-dev] HTML5 Interfaces
What is the status of the various JavaScript interfaces to Csound? We
have Emscripten, PNaCl, Android, and iOS. What I am talking about is
the JavaScript interface to Csound itself, e.g. on Android it is
CsoundObj and maybe some other classes. What about the other
platforms? Are they similar or identical or does this refactoring
still need to be done?

Regards,
Mike

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

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2015-02-26 13:55
FromSteven Yi
SubjectRe: [Cs-dev] HTML5 Interfaces
Hi Michael,

Having worked on adding Emscripten to the Csound Notebook just
recently, I can say that no, the interfaces are different at this time
between Emscripten and PNaCl. These too differ from what is in the
Android JavaScript-wrapped CsoundObj.

Some quick notes:

Emscripten - Does have a CsoundObj, but names of methods and what
methods are available are not the same as what is in Android and iOS

PNaCl - Does not have a CsoundObj class, but that could be added
easily I think.

It would be a very good thing to have these all get closer to each
other in terms of method names/functions.

steven

On Mon, Feb 23, 2015 at 4:56 PM, Michael Gogins
 wrote:
> What is the status of the various JavaScript interfaces to Csound? We
> have Emscripten, PNaCl, Android, and iOS. What I am talking about is
> the JavaScript interface to Csound itself, e.g. on Android it is
> CsoundObj and maybe some other classes. What about the other
> platforms? Are they similar or identical or does this refactoring
> still need to be done?
>
> Regards,
> Mike
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2015-02-26 14:16
FromMichael Gogins
SubjectRe: [Cs-dev] HTML5 Interfaces
Thanks for your information, this is good to know. As I work on the
stuff described below, I will refine an interface with an eye towards
being able to use it on all of our platforms.

I also have looked at the Csound performance thread class and have
some ideas about making that more efficient and simpler. One thing
that is obvious is that it should be a header file only class so that
it can be used without worrying about C++ ABI problems on different
platforms/compilers.

Currently, I am working on getting the CsHtml5 element working on the
desktop (it already works on Android). I am pursuing two tracks.

The first track is to get it working in CsoundQt. I am almost there, I
think. Currently, the HTML for a csd automatically shows up in in a
pane on the left side of CsoundQt when you select that csd. The
widgets are alive and JavaScript on the page executes. But currently,
there is no csound object in the HTML context. I am working on that
now, and should have it in a few days. I am using the Qt SDK 5.4
QWebEngineWidgets and QWebChannel code. Frankly the Qt SDK code is an
awkward hack that needs a WebSocket and introspection to perform, but
nevertheless it should make it easy to expose a QObject based C++
class to JavaScript. I don't know how well it will perform yet.

The second track is to use Google's own Chromium Embedded Framework. I
am not so far along with that. Currently I am trying to get their
simple example rebuilt using Qt so that we can have a cross-platform
version of this. This will also require low-level exposure of C++ as
JavaScript using V8's facilities. But it should result in a cleaner
and more performant implementation.

One big advantage of CEF is that it already has WebGL and WebAudio
running on Windows, which the QWebEngine system unfortunately does
not. But I have looked at the issues for Qt and this does seem to be
something Qt are trying to get going. As I have said before, it is
really the WebGL stuff that is driving this for me. This is a very
attractive target, getting 3D animation with all bells and whistles
going right in Csound.

A third approach that I have spent a little time on is using
Node-Webkit.js (now NW.js), but unfortunately, currently the node-ffi
code that we would need to expose Csound to JavaScript does not
compile. This is a known issue that I am tracking and appears to be
fixed and awaiting integration into the released code base of Node.js.
This approach might be best in the long run because it would mean that
there is no need for any glue code in the Csound repository aside from
possibly a binding.js file that should be pretty easy to write. The
binding.js code would call right into Csound's C API in the csound64
shared library. But I still do not know that, if this was fixed for
Node.js, it would also work for NW.js.

Regards,
Mike

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


On Thu, Feb 26, 2015 at 8:55 AM, Steven Yi  wrote:
> Hi Michael,
>
> Having worked on adding Emscripten to the Csound Notebook just
> recently, I can say that no, the interfaces are different at this time
> between Emscripten and PNaCl. These too differ from what is in the
> Android JavaScript-wrapped CsoundObj.
>
> Some quick notes:
>
> Emscripten - Does have a CsoundObj, but names of methods and what
> methods are available are not the same as what is in Android and iOS
>
> PNaCl - Does not have a CsoundObj class, but that could be added
> easily I think.
>
> It would be a very good thing to have these all get closer to each
> other in terms of method names/functions.
>
> steven
>
> On Mon, Feb 23, 2015 at 4:56 PM, Michael Gogins
>  wrote:
>> What is the status of the various JavaScript interfaces to Csound? We
>> have Emscripten, PNaCl, Android, and iOS. What I am talking about is
>> the JavaScript interface to Csound itself, e.g. on Android it is
>> CsoundObj and maybe some other classes. What about the other
>> platforms? Are they similar or identical or does this refactoring
>> still need to be done?
>>
>> Regards,
>> Mike
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net