[chuck-dev] Fwd: Porting ChucK to JavaScript with Emscripten

Arve Knudsen arve.knudsen at gmail.com
Wed Sep 17 15:21:13 EDT 2014


Well, what do you know, the Emscripten port of ChucK now produces sound! :)

To hear for yourself, make emscripten and open emscripten/chuck.html in a
Web Audio enabled browser, e.g. Chrome. It should produce a short sine tone.

Best,
Arve

On Thu, Sep 11, 2014 at 6:28 PM, Arve Knudsen <arve.knudsen at gmail.com>
wrote:

> I suggest we coordinate work on Emscriptenising ChucK through the GitHub
> issues of my ChucK fork (https://github.com/aknuds1/chuck). I'm currently
> concentrating on replacing RtAudio with a shim, which I think at least
> would be the best approach, and I've got a pretty good handle on how to do
> it. There seems to be little documentation on how to write these shims, so
> I'm going to use Emscripten's bundled shims as reference, after receiving
> some useful advice on their mailing list.
>
> Arve
>
> On Thu, Sep 11, 2014 at 11:56 AM, Arve Knudsen <arve.knudsen at gmail.com>
> wrote:
>
>> Hi Phill!
>>
>> First of all, you might want to check out the fruits of my existing
>> efforts, if you haven't already: ChucKJS (
>> https://github.com/aknuds1/chuckjs) and ChucK Demos (
>> http://chuckdemos.com, this is based on ChucKJS).
>>
>> Second, I have a fork of ChucK which I linked to in my original email:
>> https://github.com/aknuds1/chuck/tree/emscripten. The work goes on in
>> the emscripten branch. To build this, you must have sourced the Emscripten
>> SDK (the whole thing is a bit ramshackle for now, sorry about that) and
>> type "make emscripten".
>>
>> Sure you're welcome to help out! Can you write C++? The project is C++
>> driven, since the idea is to transform ChucK sources (in C++) to JavaScript
>> automatically. Right now, I mainly need to write Emscripten shims
>> (emulations) of ChucK dependencies such as the audio driver (I'm currently
>> thinking we should emulate ASIO).
>>
>> Otherwise, we will probably need some JavaScript ("unit") tests down the
>> line to verify that e.g. the shims do what they're supposed to.
>>
>> Best,
>> Arve
>>
>> On Sep 11, 2014 11:43 AM, "Phill" <phillip.hermans at gmail.com> wrote:
>>
>>> Howdy,
>>>
>>> I am a huge fan of ChucK and am just not getting seriously involved with
>>> JS.
>>>
>>> Mainly I'd like to say that have chuck available in JS is a great idea,
>>> as far as how to implement I defer to your judgment.
>>>
>>> Basically I want to give you kudos and also offer any help I may be able
>>> to give as a code monkey in this regard.
>>>
>>> Have you started a new GitHub for this version?
>>>
>>> thanks,
>>> pmh
>>> https://github.com/cheesymoo
>>> ---------- Forwarded message ----------
>>> From: Arve Knudsen <arve.knudsen at gmail.com>
>>> Date: Wed, Sep 10, 2014 at 9:10 PM
>>> Subject: [chuck-dev] Porting ChucK to JavaScript with Emscripten
>>> To: ChucK Developer Mailing List <chuck-dev at lists.cs.princeton.edu>
>>>
>>>
>>> Hi guys
>>>
>>> I've re-directed my focus from manually porting ChucK to JavaScript
>>> (i.e., ChucKJS) to an automatic port with the help of the Emscripten tool (
>>> http://emscripten.org/):
>>> https://github.com/aknuds1/chuck/tree/emscripten. I don't know yet how
>>> this'll pan out, but I'm thinking it should be more future proof than
>>> having to maintain an independent JavaScript version of ChucK. Also, it
>>> ought to be much more performant, since Emscripten generates asm.js rather
>>> than vanilla JavaScript.
>>>
>>> The status of the port is that I am currently able to generate a
>>> JavaScript library, chuck.js, which can be invoked, but I need to write
>>> shims for dependencies such as the audio driver to actually do anything
>>> useful.
>>>
>>> Arve
>>>
>>> _______________________________________________
>>> chuck-dev mailing list
>>> chuck-dev at lists.cs.princeton.edu
>>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
>>>
>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-dev/attachments/20140917/d50ccb45/attachment.html>


More information about the chuck-dev mailing list