build
This commit is contained in:
parent
1d1d29a163
commit
cbd1bde7e6
12 changed files with 379 additions and 30 deletions
8
docs/dist/evaluate.js
vendored
8
docs/dist/evaluate.js
vendored
|
|
@ -5,12 +5,15 @@ import "./voicings.js";
|
|||
import "./tonal.js";
|
||||
import "./xen.js";
|
||||
import "./tune.js";
|
||||
import "./tonal.js";
|
||||
import "./tune.js";
|
||||
import "./pianoroll.js";
|
||||
import * as drawHelpers from "./draw.js";
|
||||
import gist from "./gist.js";
|
||||
import shapeshifter from "./shapeshifter.js";
|
||||
import {minify} from "./parse.js";
|
||||
import * as Tone from "../_snowpack/pkg/tone.js";
|
||||
import * as toneHelpers from "./tone.js";
|
||||
import * as voicingHelpers from "./voicings.js";
|
||||
const bootstrapped = {...strudel, ...strudel.Pattern.prototype.bootstrap()};
|
||||
function hackLiteral(literal, names, func) {
|
||||
names.forEach((name) => {
|
||||
|
|
@ -23,9 +26,10 @@ function hackLiteral(literal, names, func) {
|
|||
}
|
||||
hackLiteral(String, ["mini", "m"], bootstrapped.mini);
|
||||
hackLiteral(String, ["pure", "p"], bootstrapped.pure);
|
||||
Object.assign(globalThis, bootstrapped, Tone, toneHelpers, {gist});
|
||||
Object.assign(globalThis, bootstrapped, Tone, toneHelpers, voicingHelpers, drawHelpers, {gist});
|
||||
export const evaluate = async (code) => {
|
||||
const shapeshifted = shapeshifter(code);
|
||||
drawHelpers.cleanup();
|
||||
let evaluated = await eval(shapeshifted);
|
||||
if (typeof evaluated === "function") {
|
||||
evaluated = evaluated();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue