Authors: Steven Yi, Victor Lazzarini, Edward Costello
These are the sources for WebAudio Csound, based on Web Assembly (WASM) and the Web Audio API. It supports the AudioWorklet interface if present, falling back to using ScriptProcessorNode otherwise. Csound is availble through the use of the CsoundObj API, or as an audio processor Node.
- Emscripten SDK/toolchain: install
the Emscripten tools using these
instructions thoroughly. Make sure all steps are followed to ensure a correct installation of the toolchain. - [JSDoc]](https://usejsdoc.org): if you are build a release package and/or documentation, you will need to install JSDoc.
- First you will need to build libsndfile. Use the
download_and_build_libsndfile.sh
script. In the emscripten folder, runsh ./download_and_build_libsndfile.sh
. This will create a deps folder, download libsndfile 1.0.25, unarchive the tarball, and then compile libsndfile with Emscripten. - Run the build.sh script using
sh ./build.sh
. This will create a build folder (./dist), run cmake from there with the Csound source, then compile Csound with Emscripten, producing the WASM binaries and their JS interfaces.
At this point, the two .js files in the ./dist folder are all that are necessary to run Csound in a Web browser that supports WebAudio.
This step builds a release package with the distribution files and documentation.
- Run
sh build.sh
- Run
sh update_example_libs_from_dist.sh
- Update CS_VERSION in build.sh if necessary
- Run
sh release.sh
The original port of CsoundObj.js using ScriptProcessorNode to WASM support was contributed by Henri Manson.