diff --git a/repl/src/prebake.mjs b/repl/src/prebake.mjs index f9e24e79..a6cc733c 100644 --- a/repl/src/prebake.mjs +++ b/repl/src/prebake.mjs @@ -1,7 +1,7 @@ import { Pattern, toMidi } from '@strudel.cycles/core'; import { samples } from '@strudel.cycles/webaudio'; -export async function prebake(isMock = false) { +export async function prebake({ isMock = false, baseDir = '.' } = {}) { samples( { piano: { @@ -39,12 +39,12 @@ export async function prebake(isMock = false) { }, // https://archive.org/details/SalamanderGrandPianoV3 // License: CC-by http://creativecommons.org/licenses/by/3.0/ Author: Alexander Holm - './piano/', + `${baseDir}/piano/`, ); if (!isMock) { await fetch('EmuSP12.json') .then((res) => res.json()) - .then((json) => samples(json, './EmuSP12/')); + .then((json) => samples(json, `${baseDir}/EmuSP12/`)); } } @@ -54,7 +54,7 @@ const panwidth = (pan, width) => pan * width + (1 - width) / 2; Pattern.prototype.piano = function () { return this.clip(1) .s('piano') - .release(.1) + .release(0.1) .fmap((value) => { const midi = typeof value.note === 'string' ? toMidi(value.note) : value.note; // pan by pitch diff --git a/repl/src/runtime.mjs b/repl/src/runtime.mjs index ee42ee22..abc84d6a 100644 --- a/repl/src/runtime.mjs +++ b/repl/src/runtime.mjs @@ -123,7 +123,7 @@ const uiHelpersMocked = { backgroundImage: id, }; -prebake(true); +prebake({ isMock: true }); // TODO: refactor to evalScope evalScope(