move repl web component to new repl package

+ use it in /vanilla + /vanilla/mini
This commit is contained in:
Felix Roos 2023-12-15 10:12:47 +01:00
parent d4afbc63e2
commit f0c3d38ea7
12 changed files with 204 additions and 164 deletions

34
packages/repl/prebake.mjs Normal file
View file

@ -0,0 +1,34 @@
import { controls, evalScope } from '@strudel.cycles/core';
import { registerSoundfonts } from '@strudel.cycles/soundfonts';
import { registerSynthSounds, registerZZFXSounds, samples } from '@strudel.cycles/webaudio';
export async function prebake() {
const modulesLoading = evalScope(
import('@strudel.cycles/core'),
import('@strudel.cycles/mini'),
import('@strudel.cycles/tonal'),
import('@strudel.cycles/webaudio'),
import('@strudel/codemirror'),
import('@strudel/hydra'),
import('@strudel.cycles/soundfonts'),
import('@strudel.cycles/midi'),
// import('@strudel.cycles/xen'),
// import('@strudel.cycles/serial'),
// import('@strudel.cycles/csound'),
// import('@strudel.cycles/osc'),
controls, // sadly, this cannot be exported from core directly (yet)
);
// load samples
const ds = 'https://raw.githubusercontent.com/felixroos/dough-samples/main/';
await Promise.all([
modulesLoading,
registerSynthSounds(),
registerZZFXSounds(),
registerSoundfonts(),
samples(`${ds}/tidal-drum-machines.json`),
samples(`${ds}/piano.json`),
samples(`${ds}/Dirt-Samples.json`),
samples(`${ds}/EmuSP12.json`),
samples(`${ds}/vcsl.json`),
]);
}