Final Project: C++ to Web Audio Via WASM (Distortion)

This project is a proof of concept for porting audio processing software made in C++ to Web Audio. Web Audio utilizes processing nodes written in JavaScript. Using a compiling tool called "Emscripten" is is possible to compile C/C++ into Web Assmembly (WASM), and then from WASM into JavaScript. To test this process, I took a distortion effect I made a few years ago, compiled it into WASM, and wrapped it into a Web Audio AudioProcessorNode in JavaScript. I also made a simple mono sine MIDI synth in JavaScript to provide audio input for the effect.

To use this effect, plug in a MIDI keyboard of your choice, and press "Start". Use "Bypass" to turn the effect on and off, or to change the amount of Distortion, or the cutoff frequency, just enter a new value, and press "Set". Enjoy!

Thanks to Hongchan Choi, the Web Audio and Web MIDI APIs, and Kripken from Emscripten