mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-10 21:28:31 +00:00
29 lines
1.0 KiB
HTML
29 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/svg+xml" href="https://strudel.cc/favicon.ico" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>@strudel/web REPL Example</title>
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<button id="a">A</button>
|
|
<button id="b">B</button>
|
|
<button id="c">C</button>
|
|
<button id="stop">stop</button>
|
|
<script type="module">
|
|
import { initStrudel } from '@strudel/web';
|
|
initStrudel({
|
|
prebake: () => samples('github:tidalcycles/Dirt-Samples/master'),
|
|
});
|
|
|
|
const click = (id, action) => document.getElementById(id).addEventListener('click', action);
|
|
click('a', () => evaluate(`s('bd,jvbass(3,8)').jux(rev)`));
|
|
click('b', () => s('bd*2,hh(3,4),jvbass(5,8,1)').jux(rev).play());
|
|
click('c', () => s('bd*2,hh(3,4),jvbass:[0 4](5,8,1)').jux(rev).stack(s('~ sd')).play());
|
|
click('stop', () => hush());
|
|
</script>
|
|
</body>
|
|
</html>
|