mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 04:28:30 +00:00
update versions in example html files
This commit is contained in:
parent
e6b47d2cf2
commit
a45f1fba45
@ -16,34 +16,40 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="output"></div>
|
<div id="output"></div>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import { controls, repl, evalScope } from 'https://cdn.skypack.dev/@strudel.cycles/core@0.6.8';
|
import { controls, repl, evalScope } from 'https://cdn.skypack.dev/@strudel/core@0.11.0';
|
||||||
import { mini } from 'https://cdn.skypack.dev/@strudel.cycles/mini@0.6.0';
|
import { mini } from 'https://cdn.skypack.dev/@strudel/mini@0.11.0';
|
||||||
import { transpiler } from 'https://cdn.skypack.dev/@strudel.cycles/transpiler@0.6.0';
|
import { transpiler } from 'https://cdn.skypack.dev/@strudel/transpiler@0.11.0';
|
||||||
import {
|
import {
|
||||||
getAudioContext,
|
getAudioContext,
|
||||||
webaudioOutput,
|
webaudioOutput,
|
||||||
initAudioOnFirstClick,
|
initAudioOnFirstClick,
|
||||||
} from 'https://cdn.skypack.dev/@strudel.cycles/webaudio@0.6.0';
|
registerSynthSounds,
|
||||||
|
} from 'https://cdn.skypack.dev/@strudel/webaudio@0.11.0';
|
||||||
|
|
||||||
initAudioOnFirstClick();
|
|
||||||
const ctx = getAudioContext();
|
const ctx = getAudioContext();
|
||||||
const input = document.getElementById('text');
|
const input = document.getElementById('text');
|
||||||
input.innerHTML = getTune();
|
input.innerHTML = getTune();
|
||||||
|
|
||||||
evalScope(
|
const loadModules = evalScope(
|
||||||
controls,
|
controls,
|
||||||
import('https://cdn.skypack.dev/@strudel.cycles/core@0.6.8'),
|
import('https://cdn.skypack.dev/@strudel/core@0.11.0'),
|
||||||
import('https://cdn.skypack.dev/@strudel.cycles/mini@0.6.0'),
|
import('https://cdn.skypack.dev/@strudel/mini@0.11.0'),
|
||||||
import('https://cdn.skypack.dev/@strudel.cycles/tonal@0.6.0'),
|
import('https://cdn.skypack.dev/@strudel/tonal@0.11.0'),
|
||||||
import('https://cdn.skypack.dev/@strudel.cycles/webaudio@0.6.0'),
|
import('https://cdn.skypack.dev/@strudel/webaudio@0.11.0'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const initAudio = Promise.all([initAudioOnFirstClick(), registerSynthSounds()]);
|
||||||
|
|
||||||
const { evaluate } = repl({
|
const { evaluate } = repl({
|
||||||
defaultOutput: webaudioOutput,
|
defaultOutput: webaudioOutput,
|
||||||
getTime: () => ctx.currentTime,
|
getTime: () => ctx.currentTime,
|
||||||
transpiler,
|
transpiler,
|
||||||
});
|
});
|
||||||
document.getElementById('start').addEventListener('click', () => evaluate(input.value));
|
document.getElementById('start').addEventListener('click', async () => {
|
||||||
|
await loadModules;
|
||||||
|
await initAudio;
|
||||||
|
evaluate(input.value);
|
||||||
|
});
|
||||||
|
|
||||||
function getTune() {
|
function getTune() {
|
||||||
return `await samples('github:tidalcycles/Dirt-Samples/master')
|
return `await samples('github:tidalcycles/Dirt-Samples/master')
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<script src="https://unpkg.com/@strudel.cycles/embed@latest"></script>
|
<script src="https://unpkg.com/@strudel/embed@0.11.0"></script>
|
||||||
<!-- <script src="./embed.js"></script> -->
|
<!-- <script src="./embed.js"></script> -->
|
||||||
<strudel-repl>
|
<strudel-repl>
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user