build
This commit is contained in:
parent
1dda16c010
commit
76760fc85f
5 changed files with 26 additions and 7 deletions
3
docs/dist/evaluate.js
vendored
3
docs/dist/evaluate.js
vendored
|
|
@ -3,6 +3,7 @@ import "./tone.js";
|
|||
import "./midi.js";
|
||||
import "./voicings.js";
|
||||
import "./tonal.js";
|
||||
import gist from "./gist.js";
|
||||
import shapeshifter from "./shapeshifter.js";
|
||||
import {minify} from "./parse.js";
|
||||
import * as Tone from "../_snowpack/pkg/tone.js";
|
||||
|
|
@ -19,7 +20,7 @@ function hackLiteral(literal, names, func) {
|
|||
}
|
||||
hackLiteral(String, ["mini", "m"], bootstrapped.mini);
|
||||
hackLiteral(String, ["pure", "p"], bootstrapped.pure);
|
||||
Object.assign(globalThis, bootstrapped, Tone, toneHelpers);
|
||||
Object.assign(globalThis, bootstrapped, Tone, toneHelpers, {gist});
|
||||
export const evaluate = async (code) => {
|
||||
const shapeshifted = shapeshifter(code);
|
||||
let evaluated = await eval(shapeshifted);
|
||||
|
|
|
|||
6
docs/dist/gist.js
vendored
Normal file
6
docs/dist/gist.js
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// this is a shortcut to eval code from a gist
|
||||
// why? to be able to shorten strudel code + e.g. be able to change instruments after links have been generated
|
||||
export default (route) =>
|
||||
fetch(`https://gist.githubusercontent.com/${route}?cachebust=${Date.now()}`)
|
||||
.then((res) => res.text())
|
||||
.then((code) => eval(code));
|
||||
Loading…
Add table
Add a link
Reference in a new issue