mirror of
https://codeberg.org/uzu/strudel
synced 2026-09-05 06:57:35 -04:00
add scope
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<input
|
||||
type="text"
|
||||
id="text"
|
||||
value="cat(880, 440, 220, 440).div(2).slow(2)"
|
||||
style="width: 100%; font-size: 2em; outline: none; margin-bottom: 10px"
|
||||
value="sequence(888, [432, 666], 444, 666).div(slowcat(3,2).slow(2)).off(1/8,mul(2)).off(1/4,mul(3))"
|
||||
style="width: 100%; outline: none; margin-bottom: 10px"
|
||||
spellcheck="false"
|
||||
/>
|
||||
<button id="start">start</button>
|
||||
@@ -66,6 +66,7 @@
|
||||
const strudel = await import('https://cdn.skypack.dev/@strudel.cycles/core@0.0.2');
|
||||
const { cat, State, TimeSpan } = strudel;
|
||||
let pattern;
|
||||
Object.assign(window, strudel); // add strudel to eval scope
|
||||
const input = document.getElementById('text');
|
||||
const evaluate = () => {
|
||||
pattern = eval(input.value);
|
||||
|
||||
Reference in New Issue
Block a user