Hi guys I've begun work on a JavaScript (well, CoffeeScript) implementation of ChucK, ChucKJS https://github.com/aknuds1/chuckjs, for which I'm seeking feedback from ChucK developers in particular. Web Audio APIhttps://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html is used to produce sound. Very little of the language is implemented so far, I've just today finished end-to-end support (including a VM) for playing back a sine tone for a certain interval of time as in the following program: SinOsc sin => dac; 2::second => now; Even though this may seem minor, I'm pretty happy that this is at all possible just from within the browser :) As explained in the project's README, there is a self-contained example (examples/example1.html) which demonstrates the aforementioned sine wave playback capability. What do you guys think, are anyone else interested in being able to run ChucK programs in the browser? Anyone interested in helping out on ChucKJShttps://github.com/aknuds1/chuckjs (like ChucK it's GPL licensed)? My motivation for writing ChucKJS is to develop an online development environment for ChucK where one can execute the programs directly in the browser, I figure this will lower the threshold and make the language more fun to work with. Merry Christmas, Arve
Hi guys
Thought I'd let you know I've rewritten
ChucKJShttps://github.com/aknuds1/chuckjsto work in a sample
accurate way. To make this work, I had to forego Web
Audio API's built-in nodes, e.g. oscillators, and write everything from
scratch. So far I've only implemented a sine oscillator, but that's all I
need for my current examples anyway :) To be able to generate sound sample
by sample, I've used the
ScriptProcessorNodehttps://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode
interface,
which allows you to register a callback in which you can write to its
output buffers.
This approach, with generating every sample in JavaScript, is probably
horrible for performance, but it's the only option I can see for
re-implementing ChucK properly. Hopefully, the performance is good enough
for demonstration purposes.
So far, I've got three examples for you to try, examples/example1.html,
examples/example2.html and examples/basic/demo0.html. Make sure you build
ChucKJS first (as described in the
READMEhttps://github.com/aknuds1/chuckjs#build),
as the examples are generated. I'm planning on porting more of ChucK's own
examples as time permits. Also playing with the idea of making a dedicated
site for the project (via GitHub Pages), where the examples are displayed.
Would love some feedback on the current state of affairs!
Best,
Arve
On Fri, Dec 27, 2013 at 2:36 AM, Arve Knudsen
Hi guys
I've begun work on a JavaScript (well, CoffeeScript) implementation of ChucK, ChucKJS https://github.com/aknuds1/chuckjs, for which I'm seeking feedback from ChucK developers in particular. Web Audio APIhttps://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html is used to produce sound. Very little of the language is implemented so far, I've just today finished end-to-end support (including a VM) for playing back a sine tone for a certain interval of time as in the following program:
SinOsc sin => dac; 2::second => now;
Even though this may seem minor, I'm pretty happy that this is at all possible just from within the browser :) As explained in the project's README, there is a self-contained example (examples/example1.html) which demonstrates the aforementioned sine wave playback capability.
What do you guys think, are anyone else interested in being able to run ChucK programs in the browser? Anyone interested in helping out on ChucKJShttps://github.com/aknuds1/chuckjs (like ChucK it's GPL licensed)?
My motivation for writing ChucKJS is to develop an online development environment for ChucK where one can execute the programs directly in the browser, I figure this will lower the threshold and make the language more fun to work with.
Merry Christmas, Arve
participants (1)
-
Arve Knudsen