Projede Kullanım
Respect the license
Here is a lay summary, but check the license for legal definitions and responsibilities.
- You can distribute modified versions if you keep track of the changes and the date you made them.
- You must license derivative work under the same license.
- Source code must be distributed along with web publication.
Projede Kullanım
Inside an iframe
You can embed any pattern of your choice via an iframe and the URL of the pattern of your choice:
The URL can be obtained by pressing share in the REPL.
Note that these share links depend on a database, which is not guaranteed to live forever.
To make sure your code is not lost, you can also use the long url:
<iframe
width="600"
height="300"
></iframe>
Projede Kullanım
<!--
setcps(1)
n("<0 1 2 3 4>*8").scale('G4 minor')
.s("gm_lead_6_voice")
.clip(sine.range(.2,.8).slow(8))
.jux(rev)
.room(2)
.sometimes(add(note("12")))
.lpf(perlin.range(200,20000).slow(4))
-->
The HTML comments are needed to make sure the browser won’t interpret it as HTML.
Projede Kullanım
<!--
setcps(1)
n("<0 1 2 3 4>*8").scale('G4 minor')
.s("gm_lead_6_voice")
.clip(sine.range(.2,.8).slow(8))
.jux(rev)
.room(2)
.sometimes(add(note("12")))
.lpf(perlin.range(200,20000).slow(4))
-->
Yes the naming is a bit confusing..
<!--
...
-->
With your own UI
The above approach assumes you want to use the builtin codemirror editor.
<!doctype html>
<button id="play">play</button>
<button id="stop">stop</button>
<script>
initStrudel();
document.getElementById('play').addEventListener('click', () => note('<c a f e>(3,8)').jux(rev).play());
document.getElementById('stop').addEventListener('click', () => hush());
</script>
Via npm
There are actually many more packages you can use to have fine grained control over what you use and what not. To use these packages, you have to use a bundler that supports es modules, like vite.
To find out more about the purpose of each package, see Packages