webKeyFinder is a browser application for musical key detection. webKeyFinder works with an audio stream or audio files.
Using an AudioWorkletProcessor, incoming audio stream is recorded in pulse-code modulation format. Once roughly one second of audio is recorded, the chuck is sent to a web worker running the key finder WebAssembly module. Message passing and analysis repeats until key detection is ended.
To prepare for analysis, audio files are first decoded into pulse-code modulation format. Once decoding is done, one second chunks are sent to the web worker running the key finder WebAssembly module. Message passing and analysis repeats until whole audio file is exhausted.
In contrast to live analysis, key detection workload for audio files can be processed in parallel. Once decoding is completed on the main thread, each audio file in the queue works with a dedicated web worker.
- installation instructions using emsdk
- make sure emsdk is available on your path
source ./<emsdk-directory>/emsdk.env.sh
sudo apt-get update
sudo apt-get install curl
git clone [email protected]:dogayuksel/webKeyFinder.git
cd webKeyFinder
Following command will fetch FFTW3 and libKeyFinder and build them using emscripten. Afterwards, will build the project itself using the dependencies.
make
You can run the project only by bundling the web modules and using the existing pre-compiled wasm modules.
make build-web
make serve
If you want to install dependencies from scratch again, you can clean them with the following command.
make clean_deps
- Just kill the server and run `make` again. This should rebuild the changed parts. Then you can run `make serve` to see your changes.
- If you have troubles with make recognizing the changes, you can run `make clean` to delete built files and repeat the previous step.
This project is possible thanks to the emscripten library which allowed me to compile, libKeyFinder (originally written by Ibrahim Sha’ath) and its dependency FFTW for the browser.