Hi guys
Thought I'd let you know I've rewritten
ChucKJS to 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
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
README), 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