wip synth engine that runs natively and in the browser
npm install dough-synthgood for baking. wip synth engine that runs natively and in the browser.
see the superdough puzzle for details.
dough is deployed at dough.strudel.cc.
in this repository, we practise jam oriented programming. this means:
- anybody is welcome to make changes
- to become a collaborator, create an issue and ask to get added
- we aim to be hierarchy free, assuming good faith in everyone
- either create a PR, or push directly to main, both is fine
- we try to follow the design goals, which are open to change
these are the initial design goals for dough:
- runs natively and in the browser
- a single .c file
- keep it simple stupid
- runs fast
- similar to superdough
To be able to build and test the native version, we're going to install:
1. portaudio for cross platform audio
2. liblo for osc messaging
3. pkg-config to simplify building
4. node.js to run the osc bridge
To build and test the browser version, you need:
1. emscripten to compile c to wasm
2. node.js to run the dev server
1. make sure you have https://brew.sh/ installed
2. install libraries:
``sh`
brew install pkg-config liblo portaudio libsndfile libsamplerate emscripten
`sh`
sudo apt install liblo-dev portaudio19-dev libsndfile1-dev libsamplerate0-dev emscripten.. should work similarly with other package managers
`sh`
git clone https://codeberg.org/uzu/dough.git && cd dough
here's how you compile and run the native version:
`sh`
./scripts/build-native.sh
so far, i'm doing my testing with strudel. to make sure strudel can talk to dough, you need to run the osc bridge in a separate terminal:
`sh`run strudel osc bridge:
npx --yes @strudel/osc --port 7771
now you can run a pattern with .osc()!
the demo is not deployed yet, so you need to run it locally:
1. run the dev server\* via node server.mjs
2. open localhost:8888
3. press play
here's how to compile to WebAssembly using emcc:
`sh`
./scripts/build-wasm-emcc.sh
or the clang build might be easier:
`sh`
./scripts/build-wasm-clang.sh
after compiling, refresh the page to get the new version of dough.wasm.
MacOS: the system clang might not work, so you'd need to brew install llvm then echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc.
this repo uses git lfs.
you may have to install the git-lfs plugin and initialize it in the repo by
running git lfs install. if the files you see in snapshots/* are smaller
than 1kB then git-lfs is not working.
the reference contained in dough.js is tested with snapshots. if you're in a "correct" state, meaning dough does what you expect it to do, run:
`sh`
./scripts/write-snapshots.sh
at any later time, you can test the current behavior of dough against the previously "correct" state via:
`js``
./scripts/test-snapshots.sh
this is also part of test.yml to make sure things don't break.
note that .pcm files are stored with git lfs, which is why write-snapshots will track them automatically.
dough is inspired by