- HTML 55.5%
- C 29.9%
- JavaScript 13.6%
- Shell 0.5%
- CSS 0.5%
| .forgejo/workflows | ||
| bakery | ||
| examples | ||
| scripts | ||
| snapshots | ||
| .gitattributes | ||
| .gitignore | ||
| .npmignore | ||
| dough.c | ||
| dough.js | ||
| FontWithASyntaxHighlighter-Regular.woff2 | ||
| index.html | ||
| LICENSE | ||
| links.md | ||
| memory.png | ||
| mini-repl.js | ||
| package.json | ||
| README.md | ||
| reference.html | ||
| server.mjs | ||
| style.css | ||
dough
good for baking. wip synth engine that runs natively and in the browser.
see the superdough puzzle for details.
Demo
dough is deployed at dough.strudel.cc.
contributing
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
design goals
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
Development Setup
To be able to build and test the native version, we're going to install:
- portaudio for cross platform audio
- liblo for osc messaging
- pkg-config to simplify building
- node.js to run the osc bridge
To build and test the browser version, you need:
MacOS Setup
- make sure you have https://brew.sh/ installed
- install libraries:
brew install pkg-config liblo portaudio libsndfile libsamplerate
Linux Setup
sudo apt install liblo-dev portaudio19-dev libsndfile1-dev libsamplerate0-dev lld
# .. should work similarly with other package managers
Get the Source Code
git clone https://codeberg.org/uzu/dough.git && cd dough
Native Version
here's how you compile and run the native version:
./scripts/build-native.sh
testing with strudel
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:
# run strudel osc bridge:
npx --yes @strudel/osc --port 7771
now you can run a pattern with .osc()!
WASM version
the demo is not deployed yet, so you need to run it locally:
- run the dev server* via
node server.mjs - open localhost:8888
- press play
compiling the wasm version
here's how to compile to WebAssembly using clang:
./scripts/build-wasm.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.
git lfs
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.
snapshot testing
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:
./scripts/write-snapshots.sh
at any later time, you can test the current behavior of dough against the previously "correct" state via:
./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.
inspiration
dough is inspired by
