diff --git a/examples/headless-repl/README.md b/examples/headless-repl/README.md new file mode 100644 index 00000000..a8ad651d --- /dev/null +++ b/examples/headless-repl/README.md @@ -0,0 +1,13 @@ +# headless-repl demo + +This demo shows how to use strudel in "headless mode". +Buttons A / B / C will switch between different patterns. +It showcases the usage of the `@strudel/web` package, using [vite](https://vitejs.dev/) as the dev server. + +## Running + +```sh +pnpm i && cd examples/headless-repl +pnpm dev +# open http://localhost:5173/ +``` diff --git a/examples/superdough/README.md b/examples/superdough/README.md new file mode 100644 index 00000000..fc51b603 --- /dev/null +++ b/examples/superdough/README.md @@ -0,0 +1,13 @@ +# superdough demo + +This demo shows how to use strudel in "headless mode". +Buttons A / B / C will switch between different patterns. +It showcases the usage of the `@strudel/web` package, using [vite](https://vitejs.dev/) as the dev server. + +## Running + +```sh +pnpm i && cd examples/headless-repl +pnpm dev +# open http://localhost:5173/ +``` diff --git a/examples/superdough/index.html b/examples/superdough/index.html index 806cb2f1..7a0bb88d 100644 --- a/examples/superdough/index.html +++ b/examples/superdough/index.html @@ -7,6 +7,32 @@ - + diff --git a/examples/superdough/main.js b/examples/superdough/main.js deleted file mode 100644 index 7b74fb40..00000000 --- a/examples/superdough/main.js +++ /dev/null @@ -1,25 +0,0 @@ -import { superdough, samples, initAudioOnFirstClick, registerSynthSounds } from 'superdough'; - -const init = Promise.all([ - initAudioOnFirstClick(), - samples('github:tidalcycles/Dirt-Samples/master'), - registerSynthSounds(), -]); - -const loop = (t = 0) => { - // superdough(value, time, duration) - superdough({ s: 'bd', delay: 0.5 }, t); - superdough({ note: 'g1', s: 'sawtooth', cutoff: 600, resonance: 8 }, t, 0.125); - superdough({ note: 'g2', s: 'sawtooth', cutoff: 600, resonance: 8 }, t + 0.25, 0.125); - superdough({ s: 'hh' }, t + 0.25); - superdough({ s: 'sd', room: 0.5 }, t + 0.5); - superdough({ s: 'hh' }, t + 0.75); -}; - -document.getElementById('play').addEventListener('click', async () => { - await init; - let t = 0.1; - while (t < 16) { - loop(t++); - } -});