hotfix: prebake flag to skip fetch

This commit is contained in:
Felix Roos 2022-08-07 00:14:27 +02:00
parent 21b2184750
commit 8244ba7754
2 changed files with 7 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import { Pattern, toMidi } from '@strudel.cycles/core'; import { Pattern, toMidi } from '@strudel.cycles/core';
import { samples } from '@strudel.cycles/webaudio'; import { samples } from '@strudel.cycles/webaudio';
export function prebake() { export function prebake(isMock = false) {
samples( samples(
{ {
piano: { piano: {
@ -41,9 +41,11 @@ export function prebake() {
// License: CC-by http://creativecommons.org/licenses/by/3.0/ Author: Alexander Holm // License: CC-by http://creativecommons.org/licenses/by/3.0/ Author: Alexander Holm
'./piano/', './piano/',
); );
fetch('EmuSP12.json') if (!isMock) {
.then(res => res.json()) fetch('EmuSP12.json')
.then(json => samples(json, './EmuSP12/')); .then((res) => res.json())
.then((json) => samples(json, './EmuSP12/'));
}
} }
const maxPan = toMidi('C8'); const maxPan = toMidi('C8');

View File

@ -123,7 +123,7 @@ const uiHelpersMocked = {
backgroundImage: id, backgroundImage: id,
}; };
prebake(); prebake(true);
// TODO: refactor to evalScope // TODO: refactor to evalScope
extend( extend(