diff --git a/package-lock.json b/package-lock.json index 1b4698618..986af55de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8504,6 +8504,31 @@ "node": ">=8" } }, + "node_modules/peggy": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/peggy/-/peggy-2.0.1.tgz", + "integrity": "sha512-mBqfmdUAOVn7RILpXTbcRBhLfTR4Go0SresSnivGDdRylBOyVFJncFiVyCNNpPWq8HmgeRleXHs/Go4o8kQVXA==", + "dev": true, + "dependencies": { + "commander": "^9.3.0", + "source-map-generator": "0.8.0" + }, + "bin": { + "peggy": "bin/peggy.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/peggy/node_modules/commander": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.3.0.tgz", + "integrity": "sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -9901,6 +9926,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/source-map-generator": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/source-map-generator/-/source-map-generator-0.8.0.tgz", + "integrity": "sha512-psgxdGMwl5MZM9S3FWee4EgsEaIjahYV5AzGnwUvPhWeITz/j6rKpysQHlQ4USdxvINlb8lKfWGIXwfkrgtqkA==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -11339,7 +11373,7 @@ }, "packages/core": { "name": "@strudel.cycles/core", - "version": "0.1.0", + "version": "0.1.2", "license": "AGPL-3.0-or-later", "dependencies": { "bjork": "^0.0.1", @@ -11351,15 +11385,15 @@ }, "packages/embed": { "name": "@strudel.cycles/embed", - "version": "0.1.0", + "version": "0.1.1", "license": "AGPL-3.0-or-later" }, "packages/eval": { "name": "@strudel.cycles/eval", - "version": "0.1.1", + "version": "0.1.3", "license": "AGPL-3.0-or-later", "dependencies": { - "@strudel.cycles/core": "^0.1.0", + "@strudel.cycles/core": "^0.1.2", "estraverse": "^5.3.0", "shift-ast": "^6.1.0", "shift-codegen": "^7.0.3", @@ -11383,27 +11417,30 @@ }, "packages/midi": { "name": "@strudel.cycles/midi", - "version": "0.1.1", + "version": "0.1.3", "license": "AGPL-3.0-or-later", "dependencies": { - "@strudel.cycles/tone": "^0.1.1", + "@strudel.cycles/tone": "^0.1.3", "tone": "^14.7.77", "webmidi": "^2.5.2" } }, "packages/mini": { "name": "@strudel.cycles/mini", - "version": "0.1.1", + "version": "0.1.3", "license": "AGPL-3.0-or-later", "dependencies": { - "@strudel.cycles/core": "^0.1.0", - "@strudel.cycles/eval": "^0.1.1", - "@strudel.cycles/tone": "^0.1.1" + "@strudel.cycles/core": "^0.1.2", + "@strudel.cycles/eval": "^0.1.3", + "@strudel.cycles/tone": "^0.1.3" + }, + "devDependencies": { + "peggy": "^2.0.1" } }, "packages/osc": { "name": "@strudel.cycles/osc", - "version": "0.1.0", + "version": "0.1.1", "license": "AGPL-3.0-or-later", "dependencies": { "osc-js": "^2.3.2" @@ -11411,14 +11448,14 @@ }, "packages/react": { "name": "@strudel.cycles/react", - "version": "0.1.2", + "version": "0.1.4", "license": "AGPL-3.0-or-later", "peer": true, "dependencies": { "@codemirror/lang-javascript": "^0.19.0", - "@strudel.cycles/core": "*", - "@strudel.cycles/eval": "^0.1.1", - "@strudel.cycles/tone": "^0.1.1", + "@strudel.cycles/core": "^0.1.2", + "@strudel.cycles/eval": "^0.1.3", + "@strudel.cycles/tone": "^0.1.3", "react-codemirror6": "^1.1.0", "react-hook-inview": "^4.5.0" }, @@ -11487,16 +11524,16 @@ }, "packages/serial": { "name": "@strudel.cycles/serial", - "version": "0.1.0", + "version": "0.1.3", "license": "AGPL-3.0-or-later" }, "packages/soundfonts": { "name": "@strudel.cycles/soundfonts", - "version": "0.1.0", + "version": "0.1.1", "license": "AGPL-3.0-or-later", "dependencies": { "@strudel.cycles/core": "*", - "@strudel.cycles/webaudio": "*" + "@strudel.cycles/webaudio": "^0.1.4" }, "devDependencies": { "node-fetch": "^3.2.6" @@ -11522,10 +11559,10 @@ }, "packages/tonal": { "name": "@strudel.cycles/tonal", - "version": "0.1.1", + "version": "0.1.3", "license": "AGPL-3.0-or-later", "dependencies": { - "@strudel.cycles/core": "^0.1.0", + "@strudel.cycles/core": "^0.1.2", "@tonaljs/tonal": "^4.6.5", "webmidi": "^3.0.15" } @@ -11547,10 +11584,10 @@ }, "packages/tone": { "name": "@strudel.cycles/tone", - "version": "0.1.1", + "version": "0.1.3", "license": "AGPL-3.0-or-later", "dependencies": { - "@strudel.cycles/core": "^0.1.0", + "@strudel.cycles/core": "^0.1.2", "@tonejs/piano": "^0.2.1", "chord-voicings": "^0.0.1", "tone": "^14.7.77" @@ -11558,27 +11595,27 @@ }, "packages/webaudio": { "name": "@strudel.cycles/webaudio", - "version": "0.1.1", + "version": "0.1.4", "license": "AGPL-3.0-or-later", "dependencies": { - "@strudel.cycles/core": "^0.1.0" + "@strudel.cycles/core": "^0.1.2" } }, "packages/webdirt": { "name": "@strudel.cycles/webdirt", - "version": "0.1.0", + "version": "0.1.2", "license": "AGPL-3.0-or-later", "dependencies": { - "@strudel.cycles/core": "^0.1.0", + "@strudel.cycles/core": "^0.1.2", "WebDirt": "github:dktr0/WebDirt" } }, "packages/xen": { "name": "@strudel.cycles/xen", - "version": "0.1.1", + "version": "0.1.3", "license": "AGPL-3.0-or-later", "dependencies": { - "@strudel.cycles/core": "^0.1.0" + "@strudel.cycles/core": "^0.1.2" } } }, @@ -13393,7 +13430,7 @@ "@strudel.cycles/eval": { "version": "file:packages/eval", "requires": { - "@strudel.cycles/core": "^0.1.0", + "@strudel.cycles/core": "^0.1.2", "estraverse": "^5.3.0", "shift-ast": "^6.1.0", "shift-codegen": "^7.0.3", @@ -13405,7 +13442,7 @@ "@strudel.cycles/midi": { "version": "file:packages/midi", "requires": { - "@strudel.cycles/tone": "^0.1.1", + "@strudel.cycles/tone": "^0.1.3", "tone": "^14.7.77", "webmidi": "^2.5.2" } @@ -13413,9 +13450,10 @@ "@strudel.cycles/mini": { "version": "file:packages/mini", "requires": { - "@strudel.cycles/core": "^0.1.0", - "@strudel.cycles/eval": "^0.1.1", - "@strudel.cycles/tone": "^0.1.1" + "@strudel.cycles/core": "^0.1.2", + "@strudel.cycles/eval": "^0.1.3", + "@strudel.cycles/tone": "^0.1.3", + "peggy": "^2.0.1" } }, "@strudel.cycles/osc": { @@ -13428,9 +13466,9 @@ "version": "file:packages/react", "requires": { "@codemirror/lang-javascript": "^0.19.0", - "@strudel.cycles/core": "*", - "@strudel.cycles/eval": "^0.1.1", - "@strudel.cycles/tone": "^0.1.1", + "@strudel.cycles/core": "^0.1.2", + "@strudel.cycles/eval": "^0.1.3", + "@strudel.cycles/tone": "^0.1.3", "@types/react": "^17.0.2", "@types/react-dom": "^17.0.2", "@vitejs/plugin-react": "^1.3.0", @@ -13494,7 +13532,7 @@ "version": "file:packages/soundfonts", "requires": { "@strudel.cycles/core": "*", - "@strudel.cycles/webaudio": "*", + "@strudel.cycles/webaudio": "^0.1.4", "node-fetch": "^3.2.6" }, "dependencies": { @@ -13514,7 +13552,7 @@ "@strudel.cycles/tonal": { "version": "file:packages/tonal", "requires": { - "@strudel.cycles/core": "^0.1.0", + "@strudel.cycles/core": "^0.1.2", "@tonaljs/tonal": "^4.6.5", "webmidi": "^3.0.15" }, @@ -13534,7 +13572,7 @@ "@strudel.cycles/tone": { "version": "file:packages/tone", "requires": { - "@strudel.cycles/core": "^0.1.0", + "@strudel.cycles/core": "^0.1.2", "@tonejs/piano": "^0.2.1", "chord-voicings": "^0.0.1", "tone": "^14.7.77" @@ -13543,20 +13581,20 @@ "@strudel.cycles/webaudio": { "version": "file:packages/webaudio", "requires": { - "@strudel.cycles/core": "^0.1.0" + "@strudel.cycles/core": "^0.1.2" } }, "@strudel.cycles/webdirt": { "version": "file:packages/webdirt", "requires": { - "@strudel.cycles/core": "^0.1.0", + "@strudel.cycles/core": "^0.1.2", "WebDirt": "github:dktr0/WebDirt" } }, "@strudel.cycles/xen": { "version": "file:packages/xen", "requires": { - "@strudel.cycles/core": "^0.1.0" + "@strudel.cycles/core": "^0.1.2" } }, "@tonaljs/abc-notation": { @@ -18292,6 +18330,24 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, + "peggy": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/peggy/-/peggy-2.0.1.tgz", + "integrity": "sha512-mBqfmdUAOVn7RILpXTbcRBhLfTR4Go0SresSnivGDdRylBOyVFJncFiVyCNNpPWq8HmgeRleXHs/Go4o8kQVXA==", + "dev": true, + "requires": { + "commander": "^9.3.0", + "source-map-generator": "0.8.0" + }, + "dependencies": { + "commander": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.3.0.tgz", + "integrity": "sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==", + "dev": true + } + } + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -18544,9 +18600,9 @@ "version": "file:packages/react", "requires": { "@codemirror/lang-javascript": "^0.19.0", - "@strudel.cycles/core": "*", - "@strudel.cycles/eval": "^0.1.1", - "@strudel.cycles/tone": "^0.1.1", + "@strudel.cycles/core": "^0.1.2", + "@strudel.cycles/eval": "^0.1.3", + "@strudel.cycles/tone": "^0.1.3", "@types/react": "^17.0.2", "@types/react-dom": "^17.0.2", "@vitejs/plugin-react": "^1.3.0", @@ -19410,6 +19466,12 @@ "is-plain-obj": "^2.0.0" } }, + "source-map-generator": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/source-map-generator/-/source-map-generator-0.8.0.tgz", + "integrity": "sha512-psgxdGMwl5MZM9S3FWee4EgsEaIjahYV5AzGnwUvPhWeITz/j6rKpysQHlQ4USdxvINlb8lKfWGIXwfkrgtqkA==", + "dev": true + }, "source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index dd265d45f..b9d8a2577 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -744,6 +744,7 @@ const generic_params = [ ['f', 'uid', ''], ['f', 'val', ''], ['f', 'cps', ''], + ['f', 'clip', ''], ]; // TODO: slice / splice https://www.youtube.com/watch?v=hKhPdO0RKDQ&list=PL2lW1zNIIwj3bDkh-Y3LUGDuRcoUigoDs&index=13 diff --git a/packages/core/index.mjs b/packages/core/index.mjs index e64d3215b..83c82abe5 100644 --- a/packages/core/index.mjs +++ b/packages/core/index.mjs @@ -16,4 +16,18 @@ export * from './timespan.mjs'; export * from './util.mjs'; export * from './speak.mjs'; export { default as gist } from './gist.js'; -// export * from './value.mjs'; +// below won't work with runtime.mjs (json import fails) +/* import * as p from './package.json'; +export const version = p.version; */ +console.log( + '%c // 🌀 @strudel.cycles/core loaded 🌀', // keep "//" for runnable snapshot source.. + 'background-color: black;color:white;padding:4px;border-radius:15px', +); +if (globalThis._strudelLoaded) { + console.warn( + `@strudel.cycles/core was loaded more than once... +This might happen when you have multiple versions of strudel installed. +Please check with "npm ls @strudel.cycles/core".`, + ); +} +globalThis._strudelLoaded = true; diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index 29558f468..f5c7cd512 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -15,6 +15,7 @@ import drawLine from './drawLine.mjs'; /** @class Class representing a pattern. */ export class Pattern { + _Pattern = true; // this property is used to detect if a pattern that fails instanceof Pattern is an instance of another Pattern /** * Create a pattern. As an end user, you will most likely not create a Pattern directly. * @@ -1212,7 +1213,15 @@ export function pure(value) { export function isPattern(thing) { // thing?.constructor?.name !== 'Pattern' // <- this will fail when code is mangled - return thing instanceof Pattern; + const is = thing instanceof Pattern || thing._Pattern; + if (!thing instanceof Pattern) { + console.warn( + `Found Pattern that fails "instanceof Pattern" check. + This may happen if you are using multiple versions of @strudel.cycles/core. + Please check by running "npm ls @strudel.cycles/core".`, + ); + } + return is; } export function reify(thing) { @@ -1389,7 +1398,7 @@ export function pr(args) { } export const add = curry((a, pat) => pat.add(a)); -export const chop = curry((a, pat) => pat.chop(a)) +export const chop = curry((a, pat) => pat.chop(a)); export const chunk = curry((a, pat) => pat.chunk(a)); export const chunkBack = curry((a, pat) => pat.chunkBack(a)); export const div = curry((a, pat) => pat.div(a)); diff --git a/packages/core/util.mjs b/packages/core/util.mjs index 7dd1a4577..500cc0e0b 100644 --- a/packages/core/util.mjs +++ b/packages/core/util.mjs @@ -10,7 +10,7 @@ export const tokenizeNote = (note) => { if (typeof note !== 'string') { return []; } - const [pc, acc = '', oct] = note.match(/^([a-gA-G])([#b]*)([0-9])?$/)?.slice(1) || []; + const [pc, acc = '', oct] = note.match(/^([a-gA-G])([#bs]*)([0-9])?$/)?.slice(1) || []; if (!pc) { return []; } @@ -24,7 +24,7 @@ export const toMidi = (note) => { throw new Error('not a note: "' + note + '"'); } const chroma = { c: 0, d: 2, e: 4, f: 5, g: 7, a: 9, b: 11 }[pc.toLowerCase()]; - const offset = acc?.split('').reduce((o, char) => o + { '#': 1, b: -1 }[char], 0) || 0; + const offset = acc?.split('').reduce((o, char) => o + { '#': 1, b: -1, s: 1 }[char], 0) || 0; return (Number(oct) + 1) * 12 + chroma + offset; }; export const fromMidi = (n) => { diff --git a/packages/mini/krill-parser.js b/packages/mini/krill-parser.js index d93258b29..f93c26c59 100644 --- a/packages/mini/krill-parser.js +++ b/packages/mini/krill-parser.js @@ -1,10 +1,4 @@ -/* -krill-parser.js - -Copyright (C) 2022 Strudel contributors - see -This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -*/ - -// Generated by Peggy 1.2.0. +// Generated by Peggy 2.0.1. // // https://peggyjs.org/ @@ -16,6 +10,7 @@ function peg$subclass(child, parent) { function peg$SyntaxError(message, expected, found, location) { var self = Error.call(this, message); + // istanbul ignore next Check is a necessary evil to support older environments if (Object.setPrototypeOf) { Object.setPrototypeOf(self, peg$SyntaxError.prototype); } @@ -51,14 +46,15 @@ peg$SyntaxError.prototype.format = function(sources) { var loc = this.location.source + ":" + s.line + ":" + s.column; if (src) { var e = this.location.end; - var filler = peg$padEnd("", s.line.toString().length); + var filler = peg$padEnd("", s.line.toString().length, ' '); var line = src[s.line - 1]; var last = s.line === e.line ? e.column : line.length + 1; + var hatLen = (last - s.column) || 1; str += "\n --> " + loc + "\n" + filler + " |\n" + s.line + " | " + line + "\n" - + filler + " | " + peg$padEnd("", s.column - 1) - + peg$padEnd("", last - s.column, "^"); + + filler + " | " + peg$padEnd("", s.column - 1, ' ') + + peg$padEnd("", hatLen, "^"); } else { str += "\n at " + loc; } @@ -79,7 +75,7 @@ peg$SyntaxError.buildMessage = function(expected, found) { : classEscape(part); }); - return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]"; }, any: function() { @@ -185,31 +181,32 @@ function peg$parse(input, options) { var peg$c7 = "#"; var peg$c8 = "^"; var peg$c9 = "_"; - var peg$c10 = "["; - var peg$c11 = "]"; - var peg$c12 = "<"; - var peg$c13 = ">"; - var peg$c14 = "@"; - var peg$c15 = "!"; - var peg$c16 = "("; - var peg$c17 = ")"; - var peg$c18 = "/"; - var peg$c19 = "*"; - var peg$c20 = "%"; - var peg$c21 = "struct"; - var peg$c22 = "target"; - var peg$c23 = "euclid"; - var peg$c24 = "slow"; - var peg$c25 = "rotL"; - var peg$c26 = "rotR"; - var peg$c27 = "fast"; - var peg$c28 = "scale"; - var peg$c29 = "//"; - var peg$c30 = "cat"; - var peg$c31 = "$"; - var peg$c32 = "setcps"; - var peg$c33 = "setbpm"; - var peg$c34 = "hush"; + var peg$c10 = ":"; + var peg$c11 = "["; + var peg$c12 = "]"; + var peg$c13 = "<"; + var peg$c14 = ">"; + var peg$c15 = "@"; + var peg$c16 = "!"; + var peg$c17 = "("; + var peg$c18 = ")"; + var peg$c19 = "/"; + var peg$c20 = "*"; + var peg$c21 = "%"; + var peg$c22 = "struct"; + var peg$c23 = "target"; + var peg$c24 = "euclid"; + var peg$c25 = "slow"; + var peg$c26 = "rotL"; + var peg$c27 = "rotR"; + var peg$c28 = "fast"; + var peg$c29 = "scale"; + var peg$c30 = "//"; + var peg$c31 = "cat"; + var peg$c32 = "$"; + var peg$c33 = "setcps"; + var peg$c34 = "setbpm"; + var peg$c35 = "hush"; var peg$r0 = /^[1-9]/; var peg$r1 = /^[eE]/; @@ -235,32 +232,33 @@ function peg$parse(input, options) { var peg$e14 = peg$literalExpectation("#", false); var peg$e15 = peg$literalExpectation("^", false); var peg$e16 = peg$literalExpectation("_", false); - var peg$e17 = peg$literalExpectation("[", false); - var peg$e18 = peg$literalExpectation("]", false); - var peg$e19 = peg$literalExpectation("<", false); - var peg$e20 = peg$literalExpectation(">", false); - var peg$e21 = peg$literalExpectation("@", false); - var peg$e22 = peg$literalExpectation("!", false); - var peg$e23 = peg$literalExpectation("(", false); - var peg$e24 = peg$literalExpectation(")", false); - var peg$e25 = peg$literalExpectation("/", false); - var peg$e26 = peg$literalExpectation("*", false); - var peg$e27 = peg$literalExpectation("%", false); - var peg$e28 = peg$literalExpectation("struct", false); - var peg$e29 = peg$literalExpectation("target", false); - var peg$e30 = peg$literalExpectation("euclid", false); - var peg$e31 = peg$literalExpectation("slow", false); - var peg$e32 = peg$literalExpectation("rotL", false); - var peg$e33 = peg$literalExpectation("rotR", false); - var peg$e34 = peg$literalExpectation("fast", false); - var peg$e35 = peg$literalExpectation("scale", false); - var peg$e36 = peg$literalExpectation("//", false); - var peg$e37 = peg$classExpectation(["\n"], true, false); - var peg$e38 = peg$literalExpectation("cat", false); - var peg$e39 = peg$literalExpectation("$", false); - var peg$e40 = peg$literalExpectation("setcps", false); - var peg$e41 = peg$literalExpectation("setbpm", false); - var peg$e42 = peg$literalExpectation("hush", false); + var peg$e17 = peg$literalExpectation(":", false); + var peg$e18 = peg$literalExpectation("[", false); + var peg$e19 = peg$literalExpectation("]", false); + var peg$e20 = peg$literalExpectation("<", false); + var peg$e21 = peg$literalExpectation(">", false); + var peg$e22 = peg$literalExpectation("@", false); + var peg$e23 = peg$literalExpectation("!", false); + var peg$e24 = peg$literalExpectation("(", false); + var peg$e25 = peg$literalExpectation(")", false); + var peg$e26 = peg$literalExpectation("/", false); + var peg$e27 = peg$literalExpectation("*", false); + var peg$e28 = peg$literalExpectation("%", false); + var peg$e29 = peg$literalExpectation("struct", false); + var peg$e30 = peg$literalExpectation("target", false); + var peg$e31 = peg$literalExpectation("euclid", false); + var peg$e32 = peg$literalExpectation("slow", false); + var peg$e33 = peg$literalExpectation("rotL", false); + var peg$e34 = peg$literalExpectation("rotR", false); + var peg$e35 = peg$literalExpectation("fast", false); + var peg$e36 = peg$literalExpectation("scale", false); + var peg$e37 = peg$literalExpectation("//", false); + var peg$e38 = peg$classExpectation(["\n"], true, false); + var peg$e39 = peg$literalExpectation("cat", false); + var peg$e40 = peg$literalExpectation("$", false); + var peg$e41 = peg$literalExpectation("setcps", false); + var peg$e42 = peg$literalExpectation("setbpm", false); + var peg$e43 = peg$literalExpectation("hush", false); var peg$f0 = function() { return parseFloat(text()); }; var peg$f1 = function(chars) { return chars.join("") }; @@ -294,7 +292,6 @@ function peg$parse(input, options) { var peg$f29 = function(v) { return new CommandStub("setcps", { value: v})}; var peg$f30 = function(v) { return new CommandStub("setcps", { value: (v/120/2)})}; var peg$f31 = function() { return new CommandStub("hush")}; - var peg$currPos = 0; var peg$savedPos = 0; var peg$posDetailsCache = [{ line: 1, column: 1 }]; @@ -810,6 +807,15 @@ function peg$parse(input, options) { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$e16); } } + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s0 = peg$c10; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e17); } + } + } } } } @@ -852,11 +858,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 91) { - s2 = peg$c10; + s2 = peg$c11; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e17); } + if (peg$silentFails === 0) { peg$fail(peg$e18); } } if (s2 !== peg$FAILED) { s3 = peg$parsews(); @@ -864,11 +870,11 @@ function peg$parse(input, options) { if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 93) { - s6 = peg$c11; + s6 = peg$c12; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e18); } + if (peg$silentFails === 0) { peg$fail(peg$e19); } } if (s6 !== peg$FAILED) { s7 = peg$parsews(); @@ -896,11 +902,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 60) { - s2 = peg$c12; + s2 = peg$c13; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e19); } + if (peg$silentFails === 0) { peg$fail(peg$e20); } } if (s2 !== peg$FAILED) { s3 = peg$parsews(); @@ -908,11 +914,11 @@ function peg$parse(input, options) { if (s4 !== peg$FAILED) { s5 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 62) { - s6 = peg$c13; + s6 = peg$c14; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e20); } + if (peg$silentFails === 0) { peg$fail(peg$e21); } } if (s6 !== peg$FAILED) { s7 = peg$parsews(); @@ -976,11 +982,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 64) { - s1 = peg$c14; + s1 = peg$c15; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e21); } + if (peg$silentFails === 0) { peg$fail(peg$e22); } } if (s1 !== peg$FAILED) { s2 = peg$parsenumber(); @@ -1004,11 +1010,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 33) { - s1 = peg$c15; + s1 = peg$c16; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e22); } + if (peg$silentFails === 0) { peg$fail(peg$e23); } } if (s1 !== peg$FAILED) { s2 = peg$parsenumber(); @@ -1032,11 +1038,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c16; + s1 = peg$c17; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e23); } + if (peg$silentFails === 0) { peg$fail(peg$e24); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1060,11 +1066,11 @@ function peg$parse(input, options) { } s12 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 41) { - s13 = peg$c17; + s13 = peg$c18; peg$currPos++; } else { s13 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e24); } + if (peg$silentFails === 0) { peg$fail(peg$e25); } } if (s13 !== peg$FAILED) { peg$savedPos = s0; @@ -1098,11 +1104,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 47) { - s1 = peg$c18; + s1 = peg$c19; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e25); } + if (peg$silentFails === 0) { peg$fail(peg$e26); } } if (s1 !== peg$FAILED) { s2 = peg$parsenumber(); @@ -1126,11 +1132,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 42) { - s1 = peg$c19; + s1 = peg$c20; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e26); } + if (peg$silentFails === 0) { peg$fail(peg$e27); } } if (s1 !== peg$FAILED) { s2 = peg$parsenumber(); @@ -1154,11 +1160,11 @@ function peg$parse(input, options) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 37) { - s1 = peg$c20; + s1 = peg$c21; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e27); } + if (peg$silentFails === 0) { peg$fail(peg$e28); } } if (s1 !== peg$FAILED) { s2 = peg$parsenumber(); @@ -1332,12 +1338,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c21) { - s1 = peg$c21; + if (input.substr(peg$currPos, 6) === peg$c22) { + s1 = peg$c22; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e28); } + if (peg$silentFails === 0) { peg$fail(peg$e29); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1361,12 +1367,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c22) { - s1 = peg$c22; + if (input.substr(peg$currPos, 6) === peg$c23) { + s1 = peg$c23; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e29); } + if (peg$silentFails === 0) { peg$fail(peg$e30); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1402,12 +1408,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c23) { - s1 = peg$c23; + if (input.substr(peg$currPos, 6) === peg$c24) { + s1 = peg$c24; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e30); } + if (peg$silentFails === 0) { peg$fail(peg$e31); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1443,12 +1449,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c24) { - s1 = peg$c24; + if (input.substr(peg$currPos, 4) === peg$c25) { + s1 = peg$c25; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e31); } + if (peg$silentFails === 0) { peg$fail(peg$e32); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1472,12 +1478,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c25) { - s1 = peg$c25; + if (input.substr(peg$currPos, 4) === peg$c26) { + s1 = peg$c26; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e32); } + if (peg$silentFails === 0) { peg$fail(peg$e33); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1501,12 +1507,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c26) { - s1 = peg$c26; + if (input.substr(peg$currPos, 4) === peg$c27) { + s1 = peg$c27; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e33); } + if (peg$silentFails === 0) { peg$fail(peg$e34); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1530,12 +1536,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c27) { - s1 = peg$c27; + if (input.substr(peg$currPos, 4) === peg$c28) { + s1 = peg$c28; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e34); } + if (peg$silentFails === 0) { peg$fail(peg$e35); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1559,12 +1565,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c28) { - s1 = peg$c28; + if (input.substr(peg$currPos, 5) === peg$c29) { + s1 = peg$c29; peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e35); } + if (peg$silentFails === 0) { peg$fail(peg$e36); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1609,12 +1615,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c29) { - s1 = peg$c29; + if (input.substr(peg$currPos, 2) === peg$c30) { + s1 = peg$c30; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } + if (peg$silentFails === 0) { peg$fail(peg$e37); } } if (s1 !== peg$FAILED) { s2 = []; @@ -1623,7 +1629,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } + if (peg$silentFails === 0) { peg$fail(peg$e38); } } while (s3 !== peg$FAILED) { s2.push(s3); @@ -1632,7 +1638,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } + if (peg$silentFails === 0) { peg$fail(peg$e38); } } } s1 = [s1, s2]; @@ -1649,21 +1655,21 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; - if (input.substr(peg$currPos, 3) === peg$c30) { - s1 = peg$c30; + if (input.substr(peg$currPos, 3) === peg$c31) { + s1 = peg$c31; peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } + if (peg$silentFails === 0) { peg$fail(peg$e39); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 91) { - s3 = peg$c10; + s3 = peg$c11; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e17); } + if (peg$silentFails === 0) { peg$fail(peg$e18); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); @@ -1705,11 +1711,11 @@ function peg$parse(input, options) { } s7 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 93) { - s8 = peg$c11; + s8 = peg$c12; peg$currPos++; } else { s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e18); } + if (peg$silentFails === 0) { peg$fail(peg$e19); } } if (s8 !== peg$FAILED) { peg$savedPos = s0; @@ -1770,11 +1776,11 @@ function peg$parse(input, options) { if (s1 !== peg$FAILED) { s2 = peg$parsews(); if (input.charCodeAt(peg$currPos) === 36) { - s3 = peg$c31; + s3 = peg$c32; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e39); } + if (peg$silentFails === 0) { peg$fail(peg$e40); } } if (s3 !== peg$FAILED) { s4 = peg$parsews(); @@ -1852,12 +1858,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c32) { - s1 = peg$c32; + if (input.substr(peg$currPos, 6) === peg$c33) { + s1 = peg$c33; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e40); } + if (peg$silentFails === 0) { peg$fail(peg$e41); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1881,12 +1887,12 @@ function peg$parse(input, options) { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c33) { - s1 = peg$c33; + if (input.substr(peg$currPos, 6) === peg$c34) { + s1 = peg$c34; peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e41); } + if (peg$silentFails === 0) { peg$fail(peg$e42); } } if (s1 !== peg$FAILED) { s2 = peg$parsews(); @@ -1910,12 +1916,12 @@ function peg$parse(input, options) { var s0, s1; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c34) { - s1 = peg$c34; + if (input.substr(peg$currPos, 4) === peg$c35) { + s1 = peg$c35; peg$currPos += 4; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e42); } + if (peg$silentFails === 0) { peg$fail(peg$e43); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; @@ -1938,35 +1944,34 @@ function peg$parse(input, options) { } - var PatternStub = function(source, alignment) - { - this.type_ = "pattern"; - this.arguments_ = { alignment : alignment}; - this.source_ = source; - } + var PatternStub = function(source, alignment) + { + this.type_ = "pattern"; + this.arguments_ = { alignment : alignment}; + this.source_ = source; + } - var OperatorStub = function(name, args, source) - { - this.type_ = name; - this.arguments_ = args; - this.source_ = source; - } + var OperatorStub = function(name, args, source) + { + this.type_ = name; + this.arguments_ = args; + this.source_ = source; + } - var ElementStub = function(source, options) - { - this.type_ = "element"; - this.source_ = source; - this.options_ = options; - this.location_ = location(); - } - - var CommandStub = function(name, options) - { - this.type_ = "command"; - this.name_ = name; - this.options_ = options; - } + var ElementStub = function(source, options) + { + this.type_ = "element"; + this.source_ = source; + this.options_ = options; + this.location_ = location(); + } + var CommandStub = function(name, options) + { + this.type_ = "command"; + this.name_ = name; + this.options_ = options; + } peg$result = peg$startRuleFunction(); @@ -1990,5 +1995,6 @@ function peg$parse(input, options) { export { peg$SyntaxError as SyntaxError, + peg$parse as parse }; diff --git a/packages/mini/krill.pegjs b/packages/mini/krill.pegjs index 914855e6f..5451cf012 100644 --- a/packages/mini/krill.pegjs +++ b/packages/mini/krill.pegjs @@ -87,7 +87,7 @@ quote = '"' / "'" // ------------------ steps and cycles --------------------------- // single step definition (e.g bd) -step_char = [0-9a-zA-Z~] / "-" / "#" / "." / "^" / "_" +step_char = [0-9a-zA-Z~] / "-" / "#" / "." / "^" / "_" / ":" step = ws chars:step_char+ ws { return chars.join("") } // define a sub cycle e.g. [1 2, 3 [4]] diff --git a/packages/mini/package-lock.json b/packages/mini/package-lock.json new file mode 100644 index 000000000..7595d719d --- /dev/null +++ b/packages/mini/package-lock.json @@ -0,0 +1,1031 @@ +{ + "name": "@strudel.cycles/mini", + "version": "0.1.3", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "@strudel.cycles/mini", + "version": "0.1.3", + "license": "AGPL-3.0-or-later", + "dependencies": { + "@strudel.cycles/core": "^0.1.2", + "@strudel.cycles/eval": "^0.1.3", + "@strudel.cycles/tone": "^0.1.3" + }, + "devDependencies": { + "peggy": "^2.0.1" + } + }, + "node_modules/@babel/runtime": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.3.tgz", + "integrity": "sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug==", + "dependencies": { + "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@strudel.cycles/core": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@strudel.cycles/core/-/core-0.1.2.tgz", + "integrity": "sha512-PdN8NO7lTySuEuPce/fPo6Npl0zAnw7VuvJcmn5qbkKlkgf/cJ+h2+BRvmsvwzv9rOSoc+y1Ioek/00JDlfG9w==", + "dependencies": { + "bjork": "^0.0.1", + "fraction.js": "^4.2.0" + } + }, + "node_modules/@strudel.cycles/eval": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@strudel.cycles/eval/-/eval-0.1.3.tgz", + "integrity": "sha512-FPtmJcWMXHnF9qQVC5zptdWt7wm6DumPDWbPEWLuC75JnLE/kNdEp1/C2PvO3uk1l6eGCSEb+UhH6uUOQ7X8eg==", + "dependencies": { + "@strudel.cycles/core": "^0.1.2", + "estraverse": "^5.3.0", + "shift-ast": "^6.1.0", + "shift-codegen": "^7.0.3", + "shift-parser": "^7.0.3", + "shift-spec": "^2018.0.2", + "shift-traverser": "^1.0.0" + } + }, + "node_modules/@strudel.cycles/tone": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@strudel.cycles/tone/-/tone-0.1.3.tgz", + "integrity": "sha512-4CLENhjizYghnyubYC5m7++d8U1qeCSrK9C71zRnC5kwhRZ72nzdpY45fVZZqA9DTk5E5BQ7NsfC1LoNXlQW8Q==", + "dependencies": { + "@strudel.cycles/core": "^0.1.2", + "@tonejs/piano": "^0.2.1", + "chord-voicings": "^0.0.1", + "tone": "^14.7.77" + } + }, + "node_modules/@tonaljs/abc-notation": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/abc-notation/-/abc-notation-4.6.5.tgz", + "integrity": "sha512-1S0Jnx0NfDLgyhkQOMEHqOacELL6RUdPcWWUP+nAnsOsb9owvB9RKYLSzp5odd16FVUR7U8c/JLc2yxIRvSeJw==", + "dependencies": { + "@tonaljs/core": "^4.6.5" + } + }, + "node_modules/@tonaljs/array": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/array/-/array-4.6.5.tgz", + "integrity": "sha512-7A3DbBQ+qIQ134FqE518b4tJ8V2a15Sn303JjHzgnqZqKrNh/s3wqwkL60F7LKcd09tcp+vIKQP/MYt4xMcRAA==", + "dependencies": { + "@tonaljs/core": "^4.6.5" + } + }, + "node_modules/@tonaljs/chord": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/chord/-/chord-4.6.5.tgz", + "integrity": "sha512-Pjdel4aDVv4kcx9PW6Qozt5BB9nAt13AOExfzKztpgPmlBSy0SKHse7Jp1cA4MGAuLHU8dzVssTFYpCskEFw3w==", + "dependencies": { + "@tonaljs/chord-detect": "^4.6.5", + "@tonaljs/chord-type": "^4.6.5", + "@tonaljs/collection": "^4.6.2", + "@tonaljs/core": "^4.6.5", + "@tonaljs/pcset": "^4.6.5", + "@tonaljs/scale-type": "^4.6.5" + } + }, + "node_modules/@tonaljs/chord-detect": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/chord-detect/-/chord-detect-4.6.5.tgz", + "integrity": "sha512-4xu53UP4kNTfdTNpAAVijhXcQ+ypJqmeMnsST08ZXSjoYfJUhmf5rWDWfz36KOTtNdCA6AbYgdtTYV/Xw0nd/w==", + "dependencies": { + "@tonaljs/chord-type": "^4.6.5", + "@tonaljs/core": "^4.6.5", + "@tonaljs/pcset": "^4.6.5" + } + }, + "node_modules/@tonaljs/chord-type": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/chord-type/-/chord-type-4.6.5.tgz", + "integrity": "sha512-Ol4DDopqpZCF9odosO2i8I+plud3Ul7VWJGNvL+PPCf4Qnwuz87q3aJQDLNoRUz4VyW0u66mq3LyVh6A8kb6Ug==", + "dependencies": { + "@tonaljs/core": "^4.6.5", + "@tonaljs/pcset": "^4.6.5" + } + }, + "node_modules/@tonaljs/collection": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@tonaljs/collection/-/collection-4.6.2.tgz", + "integrity": "sha512-bfPCotLJNB/tG1NrdbsQPLDKZB5jlMs7uPQ6RYKiNkaena3345ZKkbCGl5pj6YTXeDm/oblXiSbFAn7SlLRZdQ==" + }, + "node_modules/@tonaljs/core": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/core/-/core-4.6.5.tgz", + "integrity": "sha512-t7Vx0+L3j/ubQj2AhI1H45D/K745np4DwJjJjXNi5FlGD+TL2wyw50dCwkHKGHsrLDqup1qqP6yN7LBpC6UwNg==" + }, + "node_modules/@tonaljs/duration-value": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@tonaljs/duration-value/-/duration-value-4.6.2.tgz", + "integrity": "sha512-zrXT0L/qsDQ6251Mlqz54vcUbYUB9xb6uJhlxUzc6VauXOt8UOfrdTULubRTXTaBwWt1h8J5n9pXTQmNGzNI9A==" + }, + "node_modules/@tonaljs/interval": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/interval/-/interval-4.6.5.tgz", + "integrity": "sha512-7EDWhqZ7Nnh9oD4ahRYJHLc799ACGxYL4hDHwMKD16B2MgXqPvDeDvwQ31qUuO0ruGz8tMb3FDlgg0Hplowcbw==", + "dependencies": { + "@tonaljs/core": "^4.6.5" + } + }, + "node_modules/@tonaljs/key": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/key/-/key-4.6.5.tgz", + "integrity": "sha512-ZdZWb5IStx6CLRmdEjawR66CqNpoW3EVUua2nVZBMdgnNebWxt4nvgH/ZNvGlCQGFZkUZzRhCfTwqsS6e3OmSA==", + "dependencies": { + "@tonaljs/core": "^4.6.5", + "@tonaljs/note": "^4.6.5", + "@tonaljs/roman-numeral": "^4.6.5" + } + }, + "node_modules/@tonaljs/midi": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/midi/-/midi-4.6.5.tgz", + "integrity": "sha512-fJEZtNvV3M6yW1w+Tep60Rbv5PvuKszQcQzaJS1Loq5mHOKAzdmRfuJSpEpZBiaKEZ1WAMh1QKXYyOd+imyGQg==", + "dependencies": { + "@tonaljs/core": "^4.6.5" + } + }, + "node_modules/@tonaljs/mode": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/mode/-/mode-4.6.5.tgz", + "integrity": "sha512-54iaON1rJ6q8fV5iuei8RGDxYhKBGGxZz3rjAxGSqdTUwBRVOdPqtzOkofThf9gRGYOMhzPp1BMbxbV+UCAPsA==", + "dependencies": { + "@tonaljs/collection": "^4.6.2", + "@tonaljs/core": "^4.6.5", + "@tonaljs/interval": "^4.6.5", + "@tonaljs/pcset": "^4.6.5", + "@tonaljs/scale-type": "^4.6.5" + } + }, + "node_modules/@tonaljs/note": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/note/-/note-4.6.5.tgz", + "integrity": "sha512-Y0/eTzcReXzfcSLLG4k/dLLayqbvh/XYIkybG/QMDyR0BREuJq0Sw+NavbzhTtO0dadIQb/qfe0GFq4k2xS+NQ==", + "dependencies": { + "@tonaljs/core": "^4.6.5", + "@tonaljs/midi": "^4.6.5" + } + }, + "node_modules/@tonaljs/pcset": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/pcset/-/pcset-4.6.5.tgz", + "integrity": "sha512-oWAKflP3cREnUfScqsBzg2LLKNevxSnpDtrq8CPtwOAsrAa8PjQG07NQfhqIiFMjPUdgkDiER3qVA1n8dDwAJA==", + "dependencies": { + "@tonaljs/collection": "^4.6.2", + "@tonaljs/core": "^4.6.5" + } + }, + "node_modules/@tonaljs/progression": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/progression/-/progression-4.6.5.tgz", + "integrity": "sha512-ijYEgMFQG4izHYUw5cRtBRNBuoYzmpGvb/tRiykhJNI6XIjekZEMiMsOMfb1u5q+EGvnVNXRmrluMRDIz2rmRw==", + "dependencies": { + "@tonaljs/chord": "^4.6.5", + "@tonaljs/core": "^4.6.5", + "@tonaljs/roman-numeral": "^4.6.5" + } + }, + "node_modules/@tonaljs/range": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/range/-/range-4.6.5.tgz", + "integrity": "sha512-99cOvVJ3l4X0UJuTSa6qE87JriREnnWIsi3xo1/n7RoqFxnfi8YPh4SfJJyysvHcT18X4EfcTNde9ancMBVu6A==", + "dependencies": { + "@tonaljs/collection": "^4.6.2", + "@tonaljs/midi": "^4.6.5" + } + }, + "node_modules/@tonaljs/roman-numeral": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/roman-numeral/-/roman-numeral-4.6.5.tgz", + "integrity": "sha512-bWYQNZWKmYDDcmbQQNwcWAHfTWanpzmvI0wplrMnGd4x0op5etwUEv+Yzjg0B1ef+E+zcU02Sl0WwRJhaDK3hg==", + "dependencies": { + "@tonaljs/core": "^4.6.5" + } + }, + "node_modules/@tonaljs/scale": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/scale/-/scale-4.6.5.tgz", + "integrity": "sha512-isYDamelOBtcd5bEnJ8QV0Js7jKRwZ0FlFVE/+bUN3wsyo9u6KLL5gMyfH9RKdx74m8lE13JXYTXgKqe+AOa4A==", + "dependencies": { + "@tonaljs/chord-type": "^4.6.5", + "@tonaljs/collection": "^4.6.2", + "@tonaljs/core": "^4.6.5", + "@tonaljs/note": "^4.6.5", + "@tonaljs/pcset": "^4.6.5", + "@tonaljs/scale-type": "^4.6.5" + } + }, + "node_modules/@tonaljs/scale-type": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/scale-type/-/scale-type-4.6.5.tgz", + "integrity": "sha512-rwcDOYf2UifjLJhmuQ8f8bJSeOCMDQJ1lB7lzlqdFxes03OeQhdOEfrT0nPtW8BhBEvq4GMM2NA6CLxX8MTwOQ==", + "dependencies": { + "@tonaljs/core": "^4.6.5", + "@tonaljs/pcset": "^4.6.5" + } + }, + "node_modules/@tonaljs/time-signature": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@tonaljs/time-signature/-/time-signature-4.6.2.tgz", + "integrity": "sha512-OlZY4gdLd21WpMeAI1nS9E9zWcYU6oAzh6ptAUndqmVnFIrIWIWKCkWapdFx8dWdqrX8jqya3m4T33wmeo7w5Q==" + }, + "node_modules/@tonaljs/tonal": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/tonal/-/tonal-4.6.5.tgz", + "integrity": "sha512-lmsWinI9dy7nQyzCEgDVeVAwJtsk4ey05cJZd6oa4QVuSFD+CR8ebaEiwT4/Na+W0kHrKicT3h0uYc2PJIvx5Q==", + "dependencies": { + "@tonaljs/abc-notation": "^4.6.5", + "@tonaljs/array": "^4.6.5", + "@tonaljs/chord": "^4.6.5", + "@tonaljs/chord-type": "^4.6.5", + "@tonaljs/collection": "^4.6.2", + "@tonaljs/core": "^4.6.5", + "@tonaljs/duration-value": "^4.6.2", + "@tonaljs/interval": "^4.6.5", + "@tonaljs/key": "^4.6.5", + "@tonaljs/midi": "^4.6.5", + "@tonaljs/mode": "^4.6.5", + "@tonaljs/note": "^4.6.5", + "@tonaljs/pcset": "^4.6.5", + "@tonaljs/progression": "^4.6.5", + "@tonaljs/range": "^4.6.5", + "@tonaljs/roman-numeral": "^4.6.5", + "@tonaljs/scale": "^4.6.5", + "@tonaljs/scale-type": "^4.6.5", + "@tonaljs/time-signature": "^4.6.2" + } + }, + "node_modules/@tonejs/piano": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@tonejs/piano/-/piano-0.2.1.tgz", + "integrity": "sha512-JIwZ91RSFR7Rt16o7cA7O7G30wenFl0lY5yhTsuwZmn48MO9KV+X7kyXE98Bqvs/dCBVg9PoAJ1GKMabPOW4yQ==", + "dependencies": { + "tslib": "^1.11.1" + }, + "peerDependencies": { + "tone": "^14.6.1", + "webmidi": "^2.5.1" + } + }, + "node_modules/automation-events": { + "version": "4.0.19", + "resolved": "https://registry.npmjs.org/automation-events/-/automation-events-4.0.19.tgz", + "integrity": "sha512-e8ALmWdXSkDAtDVkmqLcCDMfMMvHcPTwsg+1GsxEO8+Cyg7FQs7F3VKifzdRTADVU6S1aqlPzDE3+KLFsH0sxA==", + "dependencies": { + "@babel/runtime": "^7.18.3", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=12.20.1" + } + }, + "node_modules/automation-events/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "node_modules/bjork": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/bjork/-/bjork-0.0.1.tgz", + "integrity": "sha512-IAq1k24hAwuACo82E0NobWh44z2heG4VM0C6c4MxLCDx54Tt4s4tjT8M+0ON4pfXzH2V5Br1tfhhnb19oiMp2w==" + }, + "node_modules/chord-voicings": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/chord-voicings/-/chord-voicings-0.0.1.tgz", + "integrity": "sha512-SutgB/4ynkkuiK6qdQ/k3QvCFcH0Vj8Ch4t6LbRyRQbVzP/TOztiCk3kvXd516UZ6fqk7ijDRELEFcKN+6V8sA==", + "dependencies": { + "@tonaljs/tonal": "^4.6.5" + } + }, + "node_modules/commander": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.3.0.tgz", + "integrity": "sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fraction.js": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz", + "integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==", + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://www.patreon.com/infusion" + } + }, + "node_modules/multimap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/multimap/-/multimap-1.1.0.tgz", + "integrity": "sha512-0ZIR9PasPxGXmRsEF8jsDzndzHDj7tIav+JUmvIFB/WHswliFnquxECT/De7GR4yg99ky/NlRKJT82G1y271bw==" + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/peggy": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/peggy/-/peggy-2.0.1.tgz", + "integrity": "sha512-mBqfmdUAOVn7RILpXTbcRBhLfTR4Go0SresSnivGDdRylBOyVFJncFiVyCNNpPWq8HmgeRleXHs/Go4o8kQVXA==", + "dev": true, + "dependencies": { + "commander": "^9.3.0", + "source-map-generator": "0.8.0" + }, + "bin": { + "peggy": "bin/peggy.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + }, + "node_modules/shift-ast": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/shift-ast/-/shift-ast-6.1.0.tgz", + "integrity": "sha512-Vj4XUIJIFPIh6VcBGJ1hjH/kM88XGer94Pr7Rvxa+idEylDsrwtLw268HoxGo5xReL6T3DdRl/9/Pr1XihZ/8Q==" + }, + "node_modules/shift-codegen": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/shift-codegen/-/shift-codegen-7.0.3.tgz", + "integrity": "sha512-dfCVVdBF0qZ6pkajQ3bjxRdNEltyxEITVe7tBJkQt2eCI3znUkSxq0VSe/tTWq1LKHeAS4HuOiqYEuHMFkSq9w==", + "dependencies": { + "esutils": "^2.0.2", + "object-assign": "^4.1.0", + "shift-reducer": "6.0.0" + } + }, + "node_modules/shift-parser": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/shift-parser/-/shift-parser-7.0.3.tgz", + "integrity": "sha512-uYX2ORyZfKZrUc4iKKkO9KOhzUSxCrSBk7QK6ZmShId+BOo1gh1IwecVy97ynyOTpmhPWUttjC8BzsnQl65Zew==", + "dependencies": { + "multimap": "^1.0.2", + "shift-ast": "6.0.0", + "shift-reducer": "6.0.0", + "shift-regexp-acceptor": "2.0.3" + } + }, + "node_modules/shift-parser/node_modules/shift-ast": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/shift-ast/-/shift-ast-6.0.0.tgz", + "integrity": "sha512-XXxDcEBWVBzqWXfNYJlLyJ1/9kMvOXVRXiqPjkOrTCC5qRsBvEMJMRLLFhU3tn8ue56Y7IZyBE6bexFum5QLUw==" + }, + "node_modules/shift-reducer": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/shift-reducer/-/shift-reducer-6.0.0.tgz", + "integrity": "sha512-2rJraRP8drIOjvaE/sALa+0tGJmMVUzlmS3wIJerJbaYuCjpFAiF0WjkTOFVtz1144Nm/ECmqeG+7yRhuMVsMg==", + "dependencies": { + "shift-ast": "6.0.0" + } + }, + "node_modules/shift-reducer/node_modules/shift-ast": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/shift-ast/-/shift-ast-6.0.0.tgz", + "integrity": "sha512-XXxDcEBWVBzqWXfNYJlLyJ1/9kMvOXVRXiqPjkOrTCC5qRsBvEMJMRLLFhU3tn8ue56Y7IZyBE6bexFum5QLUw==" + }, + "node_modules/shift-regexp-acceptor": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/shift-regexp-acceptor/-/shift-regexp-acceptor-2.0.3.tgz", + "integrity": "sha512-sxL7e5JNUFxm+gutFRXktX2D6KVgDAHNuDsk5XHB9Z+N5yXooZG6pdZ1GEbo3Jz6lF7ETYLBC4WAjIFm2RKTmA==", + "dependencies": { + "unicode-match-property-ecmascript": "1.0.4", + "unicode-match-property-value-ecmascript": "1.0.2", + "unicode-property-aliases-ecmascript": "1.0.4" + } + }, + "node_modules/shift-spec": { + "version": "2018.0.2", + "resolved": "https://registry.npmjs.org/shift-spec/-/shift-spec-2018.0.2.tgz", + "integrity": "sha512-5CP/cKDEim4rZ6ViCSipTLY2U7HJr8q/kpDuCBmebFqbx/0DeozWO+9ienHmYjgGLDfHrqj+LBAN67FRK2vE6w==" + }, + "node_modules/shift-traverser": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shift-traverser/-/shift-traverser-1.0.0.tgz", + "integrity": "sha512-DMY3512wJbdC+IC+nhLH3/Stgr2BbxbNcg7qyZ6+e5qNnNs8TBQJWdMsRgHlX1JXwF4C0ONKS8VUxsPT0Tf7aw==", + "dependencies": { + "estraverse": "4.2.0", + "shift-spec": "2018.0.0" + } + }, + "node_modules/shift-traverser/node_modules/estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha512-VHvyaGnJy+FuGfcfaM7W7OZw4mQiKW73jPHwQXx2VnMSUBajYmytOT5sKEfsBvNPtGX6YDwcrGDz2eocoHg0JA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shift-traverser/node_modules/shift-spec": { + "version": "2018.0.0", + "resolved": "https://registry.npmjs.org/shift-spec/-/shift-spec-2018.0.0.tgz", + "integrity": "sha512-/aiPOkj7dbe+CV2VZhIMTHQToZmgniofpRG7Yr7x2/0sO6CSVC++py1Wzf+s+rWSTDHKcLvziVAxjRRV4i4EoQ==" + }, + "node_modules/source-map-generator": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/source-map-generator/-/source-map-generator-0.8.0.tgz", + "integrity": "sha512-psgxdGMwl5MZM9S3FWee4EgsEaIjahYV5AzGnwUvPhWeITz/j6rKpysQHlQ4USdxvINlb8lKfWGIXwfkrgtqkA==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/standardized-audio-context": { + "version": "25.3.28", + "resolved": "https://registry.npmjs.org/standardized-audio-context/-/standardized-audio-context-25.3.28.tgz", + "integrity": "sha512-w3TIDQ2z5iA76A3qFjL/knf45BAwHYAqQmDNlDrlE2El89kFKv43TjiN94N0joiMr7G3CRmO1bOuQ7wopDon9g==", + "dependencies": { + "@babel/runtime": "^7.18.3", + "automation-events": "^4.0.19", + "tslib": "^2.4.0" + } + }, + "node_modules/standardized-audio-context/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "node_modules/tone": { + "version": "14.7.77", + "resolved": "https://registry.npmjs.org/tone/-/tone-14.7.77.tgz", + "integrity": "sha512-tCfK73IkLHyzoKUvGq47gyDyxiKLFvKiVCOobynGgBB9Dl0NkxTM2p+eRJXyCYrjJwy9Y0XCMqD3uOYsYt2Fdg==", + "dependencies": { + "standardized-audio-context": "^25.1.8", + "tslib": "^2.0.1" + } + }, + "node_modules/tone/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz", + "integrity": "sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz", + "integrity": "sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg==", + "engines": { + "node": ">=4" + } + }, + "node_modules/webmidi": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/webmidi/-/webmidi-2.5.3.tgz", + "integrity": "sha512-PyMGvKcDGpvbQUfnmBORQJciyG3VAZ4aHlGy1iRZ3uEs4kG4HCvI7KRthUpM1vuHDPL98lidRIUaoRomkJtWtg==", + "peer": true, + "engines": { + "node": ">0.6.x" + } + } + }, + "dependencies": { + "@babel/runtime": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.3.tgz", + "integrity": "sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@strudel.cycles/core": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@strudel.cycles/core/-/core-0.1.2.tgz", + "integrity": "sha512-PdN8NO7lTySuEuPce/fPo6Npl0zAnw7VuvJcmn5qbkKlkgf/cJ+h2+BRvmsvwzv9rOSoc+y1Ioek/00JDlfG9w==", + "requires": { + "bjork": "^0.0.1", + "fraction.js": "^4.2.0" + } + }, + "@strudel.cycles/eval": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@strudel.cycles/eval/-/eval-0.1.3.tgz", + "integrity": "sha512-FPtmJcWMXHnF9qQVC5zptdWt7wm6DumPDWbPEWLuC75JnLE/kNdEp1/C2PvO3uk1l6eGCSEb+UhH6uUOQ7X8eg==", + "requires": { + "@strudel.cycles/core": "^0.1.2", + "estraverse": "^5.3.0", + "shift-ast": "^6.1.0", + "shift-codegen": "^7.0.3", + "shift-parser": "^7.0.3", + "shift-spec": "^2018.0.2", + "shift-traverser": "^1.0.0" + } + }, + "@strudel.cycles/tone": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@strudel.cycles/tone/-/tone-0.1.3.tgz", + "integrity": "sha512-4CLENhjizYghnyubYC5m7++d8U1qeCSrK9C71zRnC5kwhRZ72nzdpY45fVZZqA9DTk5E5BQ7NsfC1LoNXlQW8Q==", + "requires": { + "@strudel.cycles/core": "^0.1.2", + "@tonejs/piano": "^0.2.1", + "chord-voicings": "^0.0.1", + "tone": "^14.7.77" + } + }, + "@tonaljs/abc-notation": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/abc-notation/-/abc-notation-4.6.5.tgz", + "integrity": "sha512-1S0Jnx0NfDLgyhkQOMEHqOacELL6RUdPcWWUP+nAnsOsb9owvB9RKYLSzp5odd16FVUR7U8c/JLc2yxIRvSeJw==", + "requires": { + "@tonaljs/core": "^4.6.5" + } + }, + "@tonaljs/array": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/array/-/array-4.6.5.tgz", + "integrity": "sha512-7A3DbBQ+qIQ134FqE518b4tJ8V2a15Sn303JjHzgnqZqKrNh/s3wqwkL60F7LKcd09tcp+vIKQP/MYt4xMcRAA==", + "requires": { + "@tonaljs/core": "^4.6.5" + } + }, + "@tonaljs/chord": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/chord/-/chord-4.6.5.tgz", + "integrity": "sha512-Pjdel4aDVv4kcx9PW6Qozt5BB9nAt13AOExfzKztpgPmlBSy0SKHse7Jp1cA4MGAuLHU8dzVssTFYpCskEFw3w==", + "requires": { + "@tonaljs/chord-detect": "^4.6.5", + "@tonaljs/chord-type": "^4.6.5", + "@tonaljs/collection": "^4.6.2", + "@tonaljs/core": "^4.6.5", + "@tonaljs/pcset": "^4.6.5", + "@tonaljs/scale-type": "^4.6.5" + } + }, + "@tonaljs/chord-detect": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/chord-detect/-/chord-detect-4.6.5.tgz", + "integrity": "sha512-4xu53UP4kNTfdTNpAAVijhXcQ+ypJqmeMnsST08ZXSjoYfJUhmf5rWDWfz36KOTtNdCA6AbYgdtTYV/Xw0nd/w==", + "requires": { + "@tonaljs/chord-type": "^4.6.5", + "@tonaljs/core": "^4.6.5", + "@tonaljs/pcset": "^4.6.5" + } + }, + "@tonaljs/chord-type": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/chord-type/-/chord-type-4.6.5.tgz", + "integrity": "sha512-Ol4DDopqpZCF9odosO2i8I+plud3Ul7VWJGNvL+PPCf4Qnwuz87q3aJQDLNoRUz4VyW0u66mq3LyVh6A8kb6Ug==", + "requires": { + "@tonaljs/core": "^4.6.5", + "@tonaljs/pcset": "^4.6.5" + } + }, + "@tonaljs/collection": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@tonaljs/collection/-/collection-4.6.2.tgz", + "integrity": "sha512-bfPCotLJNB/tG1NrdbsQPLDKZB5jlMs7uPQ6RYKiNkaena3345ZKkbCGl5pj6YTXeDm/oblXiSbFAn7SlLRZdQ==" + }, + "@tonaljs/core": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/core/-/core-4.6.5.tgz", + "integrity": "sha512-t7Vx0+L3j/ubQj2AhI1H45D/K745np4DwJjJjXNi5FlGD+TL2wyw50dCwkHKGHsrLDqup1qqP6yN7LBpC6UwNg==" + }, + "@tonaljs/duration-value": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@tonaljs/duration-value/-/duration-value-4.6.2.tgz", + "integrity": "sha512-zrXT0L/qsDQ6251Mlqz54vcUbYUB9xb6uJhlxUzc6VauXOt8UOfrdTULubRTXTaBwWt1h8J5n9pXTQmNGzNI9A==" + }, + "@tonaljs/interval": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/interval/-/interval-4.6.5.tgz", + "integrity": "sha512-7EDWhqZ7Nnh9oD4ahRYJHLc799ACGxYL4hDHwMKD16B2MgXqPvDeDvwQ31qUuO0ruGz8tMb3FDlgg0Hplowcbw==", + "requires": { + "@tonaljs/core": "^4.6.5" + } + }, + "@tonaljs/key": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/key/-/key-4.6.5.tgz", + "integrity": "sha512-ZdZWb5IStx6CLRmdEjawR66CqNpoW3EVUua2nVZBMdgnNebWxt4nvgH/ZNvGlCQGFZkUZzRhCfTwqsS6e3OmSA==", + "requires": { + "@tonaljs/core": "^4.6.5", + "@tonaljs/note": "^4.6.5", + "@tonaljs/roman-numeral": "^4.6.5" + } + }, + "@tonaljs/midi": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/midi/-/midi-4.6.5.tgz", + "integrity": "sha512-fJEZtNvV3M6yW1w+Tep60Rbv5PvuKszQcQzaJS1Loq5mHOKAzdmRfuJSpEpZBiaKEZ1WAMh1QKXYyOd+imyGQg==", + "requires": { + "@tonaljs/core": "^4.6.5" + } + }, + "@tonaljs/mode": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/mode/-/mode-4.6.5.tgz", + "integrity": "sha512-54iaON1rJ6q8fV5iuei8RGDxYhKBGGxZz3rjAxGSqdTUwBRVOdPqtzOkofThf9gRGYOMhzPp1BMbxbV+UCAPsA==", + "requires": { + "@tonaljs/collection": "^4.6.2", + "@tonaljs/core": "^4.6.5", + "@tonaljs/interval": "^4.6.5", + "@tonaljs/pcset": "^4.6.5", + "@tonaljs/scale-type": "^4.6.5" + } + }, + "@tonaljs/note": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/note/-/note-4.6.5.tgz", + "integrity": "sha512-Y0/eTzcReXzfcSLLG4k/dLLayqbvh/XYIkybG/QMDyR0BREuJq0Sw+NavbzhTtO0dadIQb/qfe0GFq4k2xS+NQ==", + "requires": { + "@tonaljs/core": "^4.6.5", + "@tonaljs/midi": "^4.6.5" + } + }, + "@tonaljs/pcset": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/pcset/-/pcset-4.6.5.tgz", + "integrity": "sha512-oWAKflP3cREnUfScqsBzg2LLKNevxSnpDtrq8CPtwOAsrAa8PjQG07NQfhqIiFMjPUdgkDiER3qVA1n8dDwAJA==", + "requires": { + "@tonaljs/collection": "^4.6.2", + "@tonaljs/core": "^4.6.5" + } + }, + "@tonaljs/progression": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/progression/-/progression-4.6.5.tgz", + "integrity": "sha512-ijYEgMFQG4izHYUw5cRtBRNBuoYzmpGvb/tRiykhJNI6XIjekZEMiMsOMfb1u5q+EGvnVNXRmrluMRDIz2rmRw==", + "requires": { + "@tonaljs/chord": "^4.6.5", + "@tonaljs/core": "^4.6.5", + "@tonaljs/roman-numeral": "^4.6.5" + } + }, + "@tonaljs/range": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/range/-/range-4.6.5.tgz", + "integrity": "sha512-99cOvVJ3l4X0UJuTSa6qE87JriREnnWIsi3xo1/n7RoqFxnfi8YPh4SfJJyysvHcT18X4EfcTNde9ancMBVu6A==", + "requires": { + "@tonaljs/collection": "^4.6.2", + "@tonaljs/midi": "^4.6.5" + } + }, + "@tonaljs/roman-numeral": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/roman-numeral/-/roman-numeral-4.6.5.tgz", + "integrity": "sha512-bWYQNZWKmYDDcmbQQNwcWAHfTWanpzmvI0wplrMnGd4x0op5etwUEv+Yzjg0B1ef+E+zcU02Sl0WwRJhaDK3hg==", + "requires": { + "@tonaljs/core": "^4.6.5" + } + }, + "@tonaljs/scale": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/scale/-/scale-4.6.5.tgz", + "integrity": "sha512-isYDamelOBtcd5bEnJ8QV0Js7jKRwZ0FlFVE/+bUN3wsyo9u6KLL5gMyfH9RKdx74m8lE13JXYTXgKqe+AOa4A==", + "requires": { + "@tonaljs/chord-type": "^4.6.5", + "@tonaljs/collection": "^4.6.2", + "@tonaljs/core": "^4.6.5", + "@tonaljs/note": "^4.6.5", + "@tonaljs/pcset": "^4.6.5", + "@tonaljs/scale-type": "^4.6.5" + } + }, + "@tonaljs/scale-type": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/scale-type/-/scale-type-4.6.5.tgz", + "integrity": "sha512-rwcDOYf2UifjLJhmuQ8f8bJSeOCMDQJ1lB7lzlqdFxes03OeQhdOEfrT0nPtW8BhBEvq4GMM2NA6CLxX8MTwOQ==", + "requires": { + "@tonaljs/core": "^4.6.5", + "@tonaljs/pcset": "^4.6.5" + } + }, + "@tonaljs/time-signature": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@tonaljs/time-signature/-/time-signature-4.6.2.tgz", + "integrity": "sha512-OlZY4gdLd21WpMeAI1nS9E9zWcYU6oAzh6ptAUndqmVnFIrIWIWKCkWapdFx8dWdqrX8jqya3m4T33wmeo7w5Q==" + }, + "@tonaljs/tonal": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/@tonaljs/tonal/-/tonal-4.6.5.tgz", + "integrity": "sha512-lmsWinI9dy7nQyzCEgDVeVAwJtsk4ey05cJZd6oa4QVuSFD+CR8ebaEiwT4/Na+W0kHrKicT3h0uYc2PJIvx5Q==", + "requires": { + "@tonaljs/abc-notation": "^4.6.5", + "@tonaljs/array": "^4.6.5", + "@tonaljs/chord": "^4.6.5", + "@tonaljs/chord-type": "^4.6.5", + "@tonaljs/collection": "^4.6.2", + "@tonaljs/core": "^4.6.5", + "@tonaljs/duration-value": "^4.6.2", + "@tonaljs/interval": "^4.6.5", + "@tonaljs/key": "^4.6.5", + "@tonaljs/midi": "^4.6.5", + "@tonaljs/mode": "^4.6.5", + "@tonaljs/note": "^4.6.5", + "@tonaljs/pcset": "^4.6.5", + "@tonaljs/progression": "^4.6.5", + "@tonaljs/range": "^4.6.5", + "@tonaljs/roman-numeral": "^4.6.5", + "@tonaljs/scale": "^4.6.5", + "@tonaljs/scale-type": "^4.6.5", + "@tonaljs/time-signature": "^4.6.2" + } + }, + "@tonejs/piano": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@tonejs/piano/-/piano-0.2.1.tgz", + "integrity": "sha512-JIwZ91RSFR7Rt16o7cA7O7G30wenFl0lY5yhTsuwZmn48MO9KV+X7kyXE98Bqvs/dCBVg9PoAJ1GKMabPOW4yQ==", + "requires": { + "tslib": "^1.11.1" + } + }, + "automation-events": { + "version": "4.0.19", + "resolved": "https://registry.npmjs.org/automation-events/-/automation-events-4.0.19.tgz", + "integrity": "sha512-e8ALmWdXSkDAtDVkmqLcCDMfMMvHcPTwsg+1GsxEO8+Cyg7FQs7F3VKifzdRTADVU6S1aqlPzDE3+KLFsH0sxA==", + "requires": { + "@babel/runtime": "^7.18.3", + "tslib": "^2.4.0" + }, + "dependencies": { + "tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + } + } + }, + "bjork": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/bjork/-/bjork-0.0.1.tgz", + "integrity": "sha512-IAq1k24hAwuACo82E0NobWh44z2heG4VM0C6c4MxLCDx54Tt4s4tjT8M+0ON4pfXzH2V5Br1tfhhnb19oiMp2w==" + }, + "chord-voicings": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/chord-voicings/-/chord-voicings-0.0.1.tgz", + "integrity": "sha512-SutgB/4ynkkuiK6qdQ/k3QvCFcH0Vj8Ch4t6LbRyRQbVzP/TOztiCk3kvXd516UZ6fqk7ijDRELEFcKN+6V8sA==", + "requires": { + "@tonaljs/tonal": "^4.6.5" + } + }, + "commander": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.3.0.tgz", + "integrity": "sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==", + "dev": true + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + }, + "fraction.js": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz", + "integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==" + }, + "multimap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/multimap/-/multimap-1.1.0.tgz", + "integrity": "sha512-0ZIR9PasPxGXmRsEF8jsDzndzHDj7tIav+JUmvIFB/WHswliFnquxECT/De7GR4yg99ky/NlRKJT82G1y271bw==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" + }, + "peggy": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/peggy/-/peggy-2.0.1.tgz", + "integrity": "sha512-mBqfmdUAOVn7RILpXTbcRBhLfTR4Go0SresSnivGDdRylBOyVFJncFiVyCNNpPWq8HmgeRleXHs/Go4o8kQVXA==", + "dev": true, + "requires": { + "commander": "^9.3.0", + "source-map-generator": "0.8.0" + } + }, + "regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + }, + "shift-ast": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/shift-ast/-/shift-ast-6.1.0.tgz", + "integrity": "sha512-Vj4XUIJIFPIh6VcBGJ1hjH/kM88XGer94Pr7Rvxa+idEylDsrwtLw268HoxGo5xReL6T3DdRl/9/Pr1XihZ/8Q==" + }, + "shift-codegen": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/shift-codegen/-/shift-codegen-7.0.3.tgz", + "integrity": "sha512-dfCVVdBF0qZ6pkajQ3bjxRdNEltyxEITVe7tBJkQt2eCI3znUkSxq0VSe/tTWq1LKHeAS4HuOiqYEuHMFkSq9w==", + "requires": { + "esutils": "^2.0.2", + "object-assign": "^4.1.0", + "shift-reducer": "6.0.0" + } + }, + "shift-parser": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/shift-parser/-/shift-parser-7.0.3.tgz", + "integrity": "sha512-uYX2ORyZfKZrUc4iKKkO9KOhzUSxCrSBk7QK6ZmShId+BOo1gh1IwecVy97ynyOTpmhPWUttjC8BzsnQl65Zew==", + "requires": { + "multimap": "^1.0.2", + "shift-ast": "6.0.0", + "shift-reducer": "6.0.0", + "shift-regexp-acceptor": "2.0.3" + }, + "dependencies": { + "shift-ast": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/shift-ast/-/shift-ast-6.0.0.tgz", + "integrity": "sha512-XXxDcEBWVBzqWXfNYJlLyJ1/9kMvOXVRXiqPjkOrTCC5qRsBvEMJMRLLFhU3tn8ue56Y7IZyBE6bexFum5QLUw==" + } + } + }, + "shift-reducer": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/shift-reducer/-/shift-reducer-6.0.0.tgz", + "integrity": "sha512-2rJraRP8drIOjvaE/sALa+0tGJmMVUzlmS3wIJerJbaYuCjpFAiF0WjkTOFVtz1144Nm/ECmqeG+7yRhuMVsMg==", + "requires": { + "shift-ast": "6.0.0" + }, + "dependencies": { + "shift-ast": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/shift-ast/-/shift-ast-6.0.0.tgz", + "integrity": "sha512-XXxDcEBWVBzqWXfNYJlLyJ1/9kMvOXVRXiqPjkOrTCC5qRsBvEMJMRLLFhU3tn8ue56Y7IZyBE6bexFum5QLUw==" + } + } + }, + "shift-regexp-acceptor": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/shift-regexp-acceptor/-/shift-regexp-acceptor-2.0.3.tgz", + "integrity": "sha512-sxL7e5JNUFxm+gutFRXktX2D6KVgDAHNuDsk5XHB9Z+N5yXooZG6pdZ1GEbo3Jz6lF7ETYLBC4WAjIFm2RKTmA==", + "requires": { + "unicode-match-property-ecmascript": "1.0.4", + "unicode-match-property-value-ecmascript": "1.0.2", + "unicode-property-aliases-ecmascript": "1.0.4" + } + }, + "shift-spec": { + "version": "2018.0.2", + "resolved": "https://registry.npmjs.org/shift-spec/-/shift-spec-2018.0.2.tgz", + "integrity": "sha512-5CP/cKDEim4rZ6ViCSipTLY2U7HJr8q/kpDuCBmebFqbx/0DeozWO+9ienHmYjgGLDfHrqj+LBAN67FRK2vE6w==" + }, + "shift-traverser": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shift-traverser/-/shift-traverser-1.0.0.tgz", + "integrity": "sha512-DMY3512wJbdC+IC+nhLH3/Stgr2BbxbNcg7qyZ6+e5qNnNs8TBQJWdMsRgHlX1JXwF4C0ONKS8VUxsPT0Tf7aw==", + "requires": { + "estraverse": "4.2.0", + "shift-spec": "2018.0.0" + }, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha512-VHvyaGnJy+FuGfcfaM7W7OZw4mQiKW73jPHwQXx2VnMSUBajYmytOT5sKEfsBvNPtGX6YDwcrGDz2eocoHg0JA==" + }, + "shift-spec": { + "version": "2018.0.0", + "resolved": "https://registry.npmjs.org/shift-spec/-/shift-spec-2018.0.0.tgz", + "integrity": "sha512-/aiPOkj7dbe+CV2VZhIMTHQToZmgniofpRG7Yr7x2/0sO6CSVC++py1Wzf+s+rWSTDHKcLvziVAxjRRV4i4EoQ==" + } + } + }, + "source-map-generator": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/source-map-generator/-/source-map-generator-0.8.0.tgz", + "integrity": "sha512-psgxdGMwl5MZM9S3FWee4EgsEaIjahYV5AzGnwUvPhWeITz/j6rKpysQHlQ4USdxvINlb8lKfWGIXwfkrgtqkA==", + "dev": true + }, + "standardized-audio-context": { + "version": "25.3.28", + "resolved": "https://registry.npmjs.org/standardized-audio-context/-/standardized-audio-context-25.3.28.tgz", + "integrity": "sha512-w3TIDQ2z5iA76A3qFjL/knf45BAwHYAqQmDNlDrlE2El89kFKv43TjiN94N0joiMr7G3CRmO1bOuQ7wopDon9g==", + "requires": { + "@babel/runtime": "^7.18.3", + "automation-events": "^4.0.19", + "tslib": "^2.4.0" + }, + "dependencies": { + "tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + } + } + }, + "tone": { + "version": "14.7.77", + "resolved": "https://registry.npmjs.org/tone/-/tone-14.7.77.tgz", + "integrity": "sha512-tCfK73IkLHyzoKUvGq47gyDyxiKLFvKiVCOobynGgBB9Dl0NkxTM2p+eRJXyCYrjJwy9Y0XCMqD3uOYsYt2Fdg==", + "requires": { + "standardized-audio-context": "^25.1.8", + "tslib": "^2.0.1" + }, + "dependencies": { + "tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + } + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==" + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz", + "integrity": "sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ==" + }, + "unicode-property-aliases-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz", + "integrity": "sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg==" + }, + "webmidi": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/webmidi/-/webmidi-2.5.3.tgz", + "integrity": "sha512-PyMGvKcDGpvbQUfnmBORQJciyG3VAZ4aHlGy1iRZ3uEs4kG4HCvI7KRthUpM1vuHDPL98lidRIUaoRomkJtWtg==", + "peer": true + } + } +} diff --git a/packages/mini/package.json b/packages/mini/package.json index 35677057b..39fe3562e 100644 --- a/packages/mini/package.json +++ b/packages/mini/package.json @@ -5,7 +5,8 @@ "main": "index.mjs", "type": "module", "scripts": { - "test": "mocha --colors" + "test": "mocha --colors", + "build:parser": "peggy -o krill-parser.js --format es ./krill.pegjs" }, "repository": { "type": "git", @@ -28,5 +29,8 @@ "@strudel.cycles/core": "^0.1.2", "@strudel.cycles/eval": "^0.1.3", "@strudel.cycles/tone": "^0.1.3" + }, + "devDependencies": { + "peggy": "^2.0.1" } } diff --git a/packages/react/dist/index.cjs.js b/packages/react/dist/index.cjs.js index dcb7b66f3..a975a8a09 100644 --- a/packages/react/dist/index.cjs.js +++ b/packages/react/dist/index.cjs.js @@ -1,3 +1,3 @@ -"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t=require("react"),re=require("react-codemirror6"),H=require("@codemirror/view"),U=require("@codemirror/state"),ne=require("@codemirror/lang-javascript"),n=require("@codemirror/highlight"),se=require("react-hook-inview"),ce=require("@strudel.cycles/eval"),le=require("@strudel.cycles/core/util.mjs"),b=require("@strudel.cycles/tone"),I=require("@strudel.cycles/core"),y=require("@strudel.cycles/midi");function ie(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var u=ie(t);const ue="#abb2bf",de="#7d8799",fe="#ffffff",ge="#21252b",A="rgba(0, 0, 0, 0.5)",me="transparent",L="#353a42",pe="rgba(128, 203, 196, 0.5)",$="#ffcc00",be=H.EditorView.theme({"&":{color:"#ffffff",backgroundColor:me,fontSize:"15px","z-index":11},".cm-content":{caretColor:$,lineHeight:"22px"},".cm-line":{background:"#2C323699"},"&.cm-focused .cm-cursor":{backgroundColor:$,width:"3px"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:pe},".cm-panels":{backgroundColor:ge,color:"#ffffff"},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:A},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847",outline:"1px solid #515a6b"},".cm-gutters":{background:"transparent",color:"#676e95",border:"none"},".cm-activeLineGutter":{backgroundColor:A},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:L},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:L,borderBottomColor:L},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:A,color:ue}}},{dark:!0}),he=n.HighlightStyle.define([{tag:n.tags.keyword,color:"#c792ea"},{tag:n.tags.operator,color:"#89ddff"},{tag:n.tags.special(n.tags.variableName),color:"#eeffff"},{tag:n.tags.typeName,color:"#f07178"},{tag:n.tags.atom,color:"#f78c6c"},{tag:n.tags.number,color:"#ff5370"},{tag:n.tags.definition(n.tags.variableName),color:"#82aaff"},{tag:n.tags.string,color:"#c3e88d"},{tag:n.tags.special(n.tags.string),color:"#f07178"},{tag:n.tags.comment,color:de},{tag:n.tags.variableName,color:"#f07178"},{tag:n.tags.tagName,color:"#ff5370"},{tag:n.tags.bracket,color:"#a2a1a4"},{tag:n.tags.meta,color:"#ffcb6b"},{tag:n.tags.attributeName,color:"#c792ea"},{tag:n.tags.propertyName,color:"#c792ea"},{tag:n.tags.className,color:"#decb6b"},{tag:n.tags.invalid,color:fe}]),ve=[be,he],W=U.StateEffect.define(),ye=U.StateField.define({create(){return H.Decoration.none},update(e,a){try{for(let i of a.effects)i.is(W)&&(e=H.Decoration.set(i.value.flatMap(d=>(d.context.locations||[]).map(({start:g,end:s})=>{const c=d.context.color||"#FFCA28";let m=a.newDoc.line(g.line).from+g.column,l=a.newDoc.line(s.line).from+s.column;const r=a.newDoc.length;return m>r||l>r?void 0:H.Decoration.mark({attributes:{style:`outline: 1px solid ${c}`}}).range(m,l)})).filter(Boolean),!0));return e}catch{return e}},provide:e=>H.EditorView.decorations.from(e)});function G({value:e,onChange:a,onViewChanged:i,onCursor:d,options:g,editorDidMount:s,theme:c}){return u.default.createElement(u.default.Fragment,null,u.default.createElement(re.CodeMirror,{onViewChange:i,style:{display:"flex",flexDirection:"column",flex:"1 0 auto"},value:e,onChange:a,extensions:[ne.javascript(),c||ve,ye]}))}function J(e){const{onEvent:a,onQuery:i,onSchedule:d,ready:g=!0,onDraw:s}=e,[c,m]=t.useState(!1),l=1,r=()=>Math.floor(b.Tone.getTransport().seconds/l),E=(h=r())=>{const _=new I.TimeSpan(h,h+1),q=i?.(new I.State(_))||[];d?.(q,h);const B=_.begin.valueOf();b.Tone.getTransport().cancel(B);const T=(h+1)*l-.5,R=Math.max(b.Tone.getTransport().seconds,T)+.1;b.Tone.getTransport().schedule(()=>{E(h+1)},R),q?.filter(p=>p.part.begin.equals(p.whole?.begin)).forEach(p=>{b.Tone.getTransport().schedule(v=>{a(v,p,b.Tone.getContext().currentTime),b.Tone.Draw.schedule(()=>{s?.(v,p)},v)},p.part.begin.valueOf())})};t.useEffect(()=>{g&&E()},[a,d,i,s,g]);const N=async()=>{m(!0),await b.Tone.start(),b.Tone.getTransport().start("+0.1")},C=(h=!1)=>{h?(b.Tone.getTransport().cancel(),b.Tone.getTransport().stop()):b.Tone.getTransport().pause(),m(!1)};return{start:N,stop:C,onEvent:a,started:c,setStarted:m,toggle:()=>c?C():N(),query:E,activeCycle:r}}function K(e){return t.useEffect(()=>(window.addEventListener("message",e),()=>window.removeEventListener("message",e)),[e]),t.useCallback(a=>window.postMessage(a,"*"),[])}let Ce=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);const we=e=>encodeURIComponent(btoa(e));function X({tune:e,defaultSynth:a,autolink:i=!0,onEvent:d,onDraw:g}){const s=t.useMemo(()=>Ce(),[]),[c,m]=t.useState(e),[l,r]=t.useState(),[E,N]=t.useState(""),[C,w]=t.useState(),[h,_]=t.useState(!1),[q,B]=t.useState(""),[T,R]=t.useState(),p=t.useMemo(()=>c!==l||C,[c,l,C]),v=t.useCallback(f=>N(o=>o+`${o?` +"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t=require("react"),ne=require("react-codemirror6"),C=require("@codemirror/view"),W=require("@codemirror/state"),se=require("@codemirror/lang-javascript"),s=require("@codemirror/highlight"),ce=require("react-hook-inview"),le=require("@strudel.cycles/eval"),ie=require("@strudel.cycles/core/util.mjs"),b=require("@strudel.cycles/tone"),Q=require("@strudel.cycles/core"),y=require("@strudel.cycles/midi");function ue(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var d=ue(t);const de="#abb2bf",fe="#7d8799",ge="#ffffff",me="#21252b",P="rgba(0, 0, 0, 0.5)",pe="transparent",L="#353a42",be="rgba(128, 203, 196, 0.5)",U="#ffcc00",he=C.EditorView.theme({"&":{color:"#ffffff",backgroundColor:pe,fontSize:"15px","z-index":11},".cm-content":{caretColor:U,lineHeight:"22px"},".cm-line":{background:"#2C323699"},"&.cm-focused .cm-cursor":{backgroundColor:U,width:"3px"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:be},".cm-panels":{backgroundColor:me,color:"#ffffff"},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:P},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847",outline:"1px solid #515a6b"},".cm-gutters":{background:"transparent",color:"#676e95",border:"none"},".cm-activeLineGutter":{backgroundColor:P},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:L},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:L,borderBottomColor:L},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:P,color:de}}},{dark:!0}),ve=s.HighlightStyle.define([{tag:s.tags.keyword,color:"#c792ea"},{tag:s.tags.operator,color:"#89ddff"},{tag:s.tags.special(s.tags.variableName),color:"#eeffff"},{tag:s.tags.typeName,color:"#f07178"},{tag:s.tags.atom,color:"#f78c6c"},{tag:s.tags.number,color:"#ff5370"},{tag:s.tags.definition(s.tags.variableName),color:"#82aaff"},{tag:s.tags.string,color:"#c3e88d"},{tag:s.tags.special(s.tags.string),color:"#f07178"},{tag:s.tags.comment,color:fe},{tag:s.tags.variableName,color:"#f07178"},{tag:s.tags.tagName,color:"#ff5370"},{tag:s.tags.bracket,color:"#a2a1a4"},{tag:s.tags.meta,color:"#ffcb6b"},{tag:s.tags.attributeName,color:"#c792ea"},{tag:s.tags.propertyName,color:"#c792ea"},{tag:s.tags.className,color:"#decb6b"},{tag:s.tags.invalid,color:ge}]),ye=[he,ve],O=W.StateEffect.define(),Ce=W.StateField.define({create(){return C.Decoration.none},update(e,o){try{for(let a of o.effects)if(a.is(O))if(a.value){const u=C.Decoration.mark({attributes:{style:"background-color: #FFCA2880"}});e=C.Decoration.set([u.range(0,o.newDoc.length)])}else e=C.Decoration.set([]);return e}catch(a){return console.warn("flash error",a),e}},provide:e=>C.EditorView.decorations.from(e)}),ke=e=>{e.dispatch({effects:O.of(!0)}),setTimeout(()=>{e.dispatch({effects:O.of(!1)})},200)},H=W.StateEffect.define(),we=W.StateField.define({create(){return C.Decoration.none},update(e,o){try{for(let a of o.effects)a.is(H)&&(e=C.Decoration.set(a.value.flatMap(u=>(u.context.locations||[]).map(({start:g,end:c})=>{const l=u.context.color||"#FFCA28";let m=o.newDoc.line(g.line).from+g.column,i=o.newDoc.line(c.line).from+c.column;const r=o.newDoc.length;return m>r||i>r?void 0:C.Decoration.mark({attributes:{style:`outline: 1px solid ${l}`}}).range(m,i)})).filter(Boolean),!0));return e}catch{return e}},provide:e=>C.EditorView.decorations.from(e)});function J({value:e,onChange:o,onViewChanged:a,onCursor:u,options:g,editorDidMount:c,theme:l}){return d.default.createElement(d.default.Fragment,null,d.default.createElement(ne.CodeMirror,{onViewChange:a,style:{display:"flex",flexDirection:"column",flex:"1 0 auto"},value:e,onChange:o,extensions:[se.javascript(),l||ye,we,Ce]}))}function K(e){const{onEvent:o,onQuery:a,onSchedule:u,ready:g=!0,onDraw:c}=e,[l,m]=t.useState(!1),i=1,r=()=>Math.floor(b.Tone.getTransport().seconds/i),T=(h=r())=>{const S=new Q.TimeSpan(h,h+1),q=a?.(new Q.State(S))||[];u?.(q,h);const F=S.begin.valueOf();b.Tone.getTransport().cancel(F);const x=(h+1)*i-.5,R=Math.max(b.Tone.getTransport().seconds,x)+.1;b.Tone.getTransport().schedule(()=>{T(h+1)},R),q?.filter(p=>p.part.begin.equals(p.whole?.begin)).forEach(p=>{b.Tone.getTransport().schedule(v=>{o(v,p,b.Tone.getContext().currentTime),b.Tone.Draw.schedule(()=>{c?.(v,p)},v)},p.part.begin.valueOf())})};t.useEffect(()=>{g&&T()},[o,u,a,c,g]);const N=async()=>{m(!0),await b.Tone.start(),b.Tone.getTransport().start("+0.1")},k=(h=!1)=>{h?(b.Tone.getTransport().cancel(),b.Tone.getTransport().stop()):b.Tone.getTransport().pause(),m(!1)};return{start:N,stop:k,onEvent:o,started:l,setStarted:m,toggle:()=>l?k():N(),query:T,activeCycle:r}}function X(e){return t.useEffect(()=>(window.addEventListener("message",e),()=>window.removeEventListener("message",e)),[e]),t.useCallback(o=>window.postMessage(o,"*"),[])}let Me=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);const Ee=e=>encodeURIComponent(btoa(e));function Y({tune:e,defaultSynth:o,autolink:a=!0,onEvent:u,onDraw:g}){const c=t.useMemo(()=>Me(),[]),[l,m]=t.useState(e),[i,r]=t.useState(),[T,N]=t.useState(""),[k,w]=t.useState(),[h,S]=t.useState(!1),[q,F]=t.useState(""),[x,R]=t.useState(),p=t.useMemo(()=>l!==i||k,[l,i,k]),v=t.useCallback(f=>N(n=>n+`${n?` -`:""}${f}`),[]),V=t.useMemo(()=>{if(l&&!l.includes("strudel disable-highlighting"))return(f,o)=>g?.(f,o,l)},[l,g]),x=J({onDraw:V,onEvent:t.useCallback((f,o,M)=>{try{d?.(f,o,M),o.context.logs?.length&&o.context.logs.forEach(v);const{onTrigger:S,velocity:oe}=o.context;if(S)S(f,o,M,1,o.wholeOrPart().begin.valueOf(),o.duration.valueOf());else if(a){const ae=le.getPlayableNoteValue(o);a.triggerAttackRelease(ae,o.duration.valueOf(),f,oe)}else if(!d)throw new Error("no defaultSynth nor onEvent passed to useRepl + event has no onTrigger. nothing happens")}catch(S){console.warn(S),S.message="unplayable event: "+S?.message,v(S.message)}},[d,v,a]),onQuery:t.useCallback(f=>{try{return T?.query(f)||[]}catch(o){return console.warn(o),o.message="query error: "+o.message,w(o),[]}},[T]),onSchedule:t.useCallback((f,o)=>Z(f,o),[]),ready:!!T&&!!l}),F=K(({data:{from:f,type:o}})=>{o==="start"&&f!==s&&(x.setStarted(!1),r(void 0))}),z=t.useCallback(async(f=c,o=!1)=>{if(l&&!p){w(void 0),!o&&x.start();return}try{_(!0);const M=await ce.evaluate(f);!o&&x.start(),F({type:"start",from:s}),R(()=>M.pattern),i&&(window.location.hash="#"+encodeURIComponent(btoa(c))),B(we(c)),w(void 0),r(f),_(!1)}catch(M){M.message="evaluation error: "+M.message,console.warn(M),w(M)}},[l,p,c,x,i,s,F]),Z=(f,o)=>{f.length},ee=()=>{x.started?x.stop():z()},j=()=>{x.stop(!0),r(void 0)},te=()=>{z(c,!0)};return t.useEffect(()=>()=>j(),[]),{pending:h,code:c,setCode:m,pattern:T,error:C,cycle:x,setPattern:R,dirty:p,log:E,togglePlay:ee,stop:j,setActiveCode:r,activateCode:z,evaluateOnly:te,activeCode:l,pushLog:v,hash:q}}function P(...e){return e.filter(Boolean).join(" ")}let D=[],Q;function Y({view:e,pattern:a,active:i}){t.useEffect(()=>{if(e)if(a&&i){let g=function(){try{const s=b.Tone.getTransport().seconds,m=[Math.max(Q||s,s-1/10),s+1/60];Q=s+1/60,D=D.filter(r=>r.whole.end>s);const l=a.queryArc(...m).filter(r=>r.hasOnset());D=D.concat(l),e.dispatch({effects:W.of(D)})}catch{e.dispatch({effects:W.of([])})}d=requestAnimationFrame(g)},d=requestAnimationFrame(g);return()=>{cancelAnimationFrame(d)}}else D=[],e.dispatch({effects:W.of([])})},[a,i,e])}const Me="_container_10e1g_1",ke="_header_10e1g_5",Ee="_buttons_10e1g_9",Te="_button_10e1g_9",xe="_buttonDisabled_10e1g_17",_e="_error_10e1g_21",Se="_body_10e1g_25";var k={container:Me,header:ke,buttons:Ee,button:Te,buttonDisabled:xe,error:_e,body:Se};function O({type:e}){return u.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"sc-h-5 sc-w-5",viewBox:"0 0 20 20",fill:"currentColor"},{refresh:u.default.createElement("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"}),play:u.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z",clipRule:"evenodd"}),pause:u.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"}),stop:u.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z",clipRule:"evenodd"})}[e])}function Ne({tune:e,defaultSynth:a,hideOutsideView:i=!1,theme:d,init:g,onEvent:s}){const{code:c,setCode:m,pattern:l,activeCode:r,activateCode:E,evaluateOnly:N,error:C,cycle:w,dirty:h,togglePlay:_,stop:q}=X({tune:e,defaultSynth:a,autolink:!1,onEvent:s});t.useEffect(()=>{g&&N()},[e,g]);const[B,T]=t.useState(),[R,p]=se.useInView({threshold:.01}),v=t.useRef(),V=t.useMemo(()=>((p||!i)&&(v.current=!0),p||v.current),[p,i]);return Y({view:B,pattern:l,active:w.started&&!r?.includes("strudel disable-highlighting")}),u.default.createElement("div",{className:k.container,ref:R},u.default.createElement("div",{className:k.header},u.default.createElement("div",{className:k.buttons},u.default.createElement("button",{className:P(k.button,w.started?"sc-animate-pulse":""),onClick:()=>_()},u.default.createElement(O,{type:w.started?"pause":"play"})),u.default.createElement("button",{className:P(h?k.button:k.buttonDisabled),onClick:()=>E()},u.default.createElement(O,{type:"refresh"})),u.default.createElement("button",{className:P(k.button),onClick:()=>q(!0)},u.default.createElement(O,{type:"stop"}))),C&&u.default.createElement("div",{className:k.error},C.message)),u.default.createElement("div",{className:k.body},V&&u.default.createElement(G,{theme:d,value:c,onChange:m,onViewChanged:T})))}function qe(e){const{ready:a,connected:i,disconnected:d}=e,[g,s]=t.useState(!0),[c,m]=t.useState(y.WebMidi?.outputs||[]);return t.useEffect(()=>{y.enableWebMidi().then(()=>{y.WebMidi.addListener("connected",r=>{m([...y.WebMidi.outputs]),i?.(y.WebMidi,r)}),y.WebMidi.addListener("disconnected",r=>{m([...y.WebMidi.outputs]),d?.(y.WebMidi,r)}),a?.(y.WebMidi),s(!1)}).catch(r=>{if(r){console.error(r),console.warn("Web Midi could not be enabled..");return}})},[a,i,d,c]),{loading:g,outputs:c,outputByName:r=>y.WebMidi.getOutputByName(r)}}exports.CodeMirror=G;exports.MiniRepl=Ne;exports.cx=P;exports.useCycle=J;exports.useHighlighting=Y;exports.usePostMessage=K;exports.useRepl=X;exports.useWebMidi=qe; +`:""}${f}`),[]),z=t.useMemo(()=>{if(i&&!i.includes("strudel disable-highlighting"))return(f,n)=>g?.(f,n,i)},[i,g]),_=K({onDraw:z,onEvent:t.useCallback((f,n,M)=>{try{u?.(f,n,M),n.context.logs?.length&&n.context.logs.forEach(v);const{onTrigger:D,velocity:ae}=n.context;if(D)D(f,n,M,1);else if(o){const re=ie.getPlayableNoteValue(n);o.triggerAttackRelease(re,n.duration.valueOf(),f,ae)}else if(!u)throw new Error("no defaultSynth nor onEvent passed to useRepl + event has no onTrigger. nothing happens")}catch(D){console.warn(D),D.message="unplayable event: "+D?.message,v(D.message)}},[u,v,o]),onQuery:t.useCallback(f=>{try{return x?.query(f)||[]}catch(n){return console.warn(n),n.message="query error: "+n.message,w(n),[]}},[x]),onSchedule:t.useCallback((f,n)=>ee(f,n),[]),ready:!!x&&!!i}),I=X(({data:{from:f,type:n}})=>{n==="start"&&f!==c&&(_.setStarted(!1),r(void 0))}),A=t.useCallback(async(f=l,n=!1)=>{if(i&&!p){w(void 0),!n&&_.start();return}try{S(!0);const M=await le.evaluate(f);!n&&_.start(),I({type:"start",from:c}),R(()=>M.pattern),a&&(window.location.hash="#"+encodeURIComponent(btoa(l))),F(Ee(l)),w(void 0),r(f),S(!1)}catch(M){M.message="evaluation error: "+M.message,console.warn(M),w(M)}},[i,p,l,_,a,c,I]),ee=(f,n)=>{f.length},te=()=>{_.started?_.stop():A()},$=()=>{_.stop(!0),r(void 0)},oe=()=>{A(l,!0)};return t.useEffect(()=>()=>$(),[]),{pending:h,code:l,setCode:m,pattern:x,error:k,cycle:_,setPattern:R,dirty:p,log:T,togglePlay:te,stop:$,setActiveCode:r,activateCode:A,evaluateOnly:oe,activeCode:i,pushLog:v,hash:q}}function V(...e){return e.filter(Boolean).join(" ")}let B=[],G;function Z({view:e,pattern:o,active:a}){t.useEffect(()=>{if(e)if(o&&a){let g=function(){try{const c=b.Tone.getTransport().seconds,m=[Math.max(G||c,c-1/10),c+1/60];G=c+1/60,B=B.filter(r=>r.whole.end>c);const i=o.queryArc(...m).filter(r=>r.hasOnset());B=B.concat(i),e.dispatch({effects:H.of(B)})}catch{e.dispatch({effects:H.of([])})}u=requestAnimationFrame(g)},u=requestAnimationFrame(g);return()=>{cancelAnimationFrame(u)}}else B=[],e.dispatch({effects:H.of([])})},[o,a,e])}const Te="_container_10e1g_1",xe="_header_10e1g_5",_e="_buttons_10e1g_9",Se="_button_10e1g_9",De="_buttonDisabled_10e1g_17",Ne="_error_10e1g_21",qe="_body_10e1g_25";var E={container:Te,header:xe,buttons:_e,button:Se,buttonDisabled:De,error:Ne,body:qe};function j({type:e}){return d.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"sc-h-5 sc-w-5",viewBox:"0 0 20 20",fill:"currentColor"},{refresh:d.default.createElement("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"}),play:d.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z",clipRule:"evenodd"}),pause:d.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"}),stop:d.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z",clipRule:"evenodd"})}[e])}function Re({tune:e,defaultSynth:o,hideOutsideView:a=!1,theme:u,init:g,onEvent:c}){const{code:l,setCode:m,pattern:i,activeCode:r,activateCode:T,evaluateOnly:N,error:k,cycle:w,dirty:h,togglePlay:S,stop:q}=Y({tune:e,defaultSynth:o,autolink:!1,onEvent:c});t.useEffect(()=>{g&&N()},[e,g]);const[F,x]=t.useState(),[R,p]=ce.useInView({threshold:.01}),v=t.useRef(),z=t.useMemo(()=>((p||!a)&&(v.current=!0),p||v.current),[p,a]);return Z({view:F,pattern:i,active:w.started&&!r?.includes("strudel disable-highlighting")}),d.default.createElement("div",{className:E.container,ref:R},d.default.createElement("div",{className:E.header},d.default.createElement("div",{className:E.buttons},d.default.createElement("button",{className:V(E.button,w.started?"sc-animate-pulse":""),onClick:()=>S()},d.default.createElement(j,{type:w.started?"pause":"play"})),d.default.createElement("button",{className:V(h?E.button:E.buttonDisabled),onClick:()=>T()},d.default.createElement(j,{type:"refresh"})),d.default.createElement("button",{className:V(E.button),onClick:()=>q(!0)},d.default.createElement(j,{type:"stop"}))),k&&d.default.createElement("div",{className:E.error},k.message)),d.default.createElement("div",{className:E.body},z&&d.default.createElement(J,{theme:u,value:l,onChange:m,onViewChanged:x})))}function Be(e){const{ready:o,connected:a,disconnected:u}=e,[g,c]=t.useState(!0),[l,m]=t.useState(y.WebMidi?.outputs||[]);return t.useEffect(()=>{y.enableWebMidi().then(()=>{y.WebMidi.addListener("connected",r=>{m([...y.WebMidi.outputs]),a?.(y.WebMidi,r)}),y.WebMidi.addListener("disconnected",r=>{m([...y.WebMidi.outputs]),u?.(y.WebMidi,r)}),o?.(y.WebMidi),c(!1)}).catch(r=>{if(r){console.error(r),console.warn("Web Midi could not be enabled..");return}})},[o,a,u,l]),{loading:g,outputs:l,outputByName:r=>y.WebMidi.getOutputByName(r)}}exports.CodeMirror=J;exports.MiniRepl=Re;exports.cx=V;exports.flash=ke;exports.useCycle=K;exports.useHighlighting=Z;exports.usePostMessage=X;exports.useRepl=Y;exports.useWebMidi=Be; diff --git a/packages/react/dist/index.es.js b/packages/react/dist/index.es.js index 0b3933f3b..ee50a163e 100644 --- a/packages/react/dist/index.es.js +++ b/packages/react/dist/index.es.js @@ -145,6 +145,37 @@ const materialPalenightHighlightStyle = HighlightStyle.define([ // : Extension const materialPalenight = [materialPalenightTheme, materialPalenightHighlightStyle]; +const setFlash = StateEffect.define(); +const flashField = StateField.define({ + create() { + return Decoration.none; + }, + update(flash2, tr) { + try { + for (let e of tr.effects) { + if (e.is(setFlash)) { + if (e.value) { + const mark = Decoration.mark({ attributes: { style: `background-color: #FFCA2880` } }); + flash2 = Decoration.set([mark.range(0, tr.newDoc.length)]); + } else { + flash2 = Decoration.set([]); + } + } + } + return flash2; + } catch (err) { + console.warn("flash error", err); + return flash2; + } + }, + provide: (f) => EditorView.decorations.from(f) +}); +const flash = (view) => { + view.dispatch({ effects: setFlash.of(true) }); + setTimeout(() => { + view.dispatch({ effects: setFlash.of(false) }); + }, 200); +}; const setHighlights = StateEffect.define(); const highlightField = StateField.define({ create() { @@ -187,7 +218,8 @@ function CodeMirror({ value, onChange, onViewChanged, onCursor, options, editorD extensions: [ javascript(), theme || materialPalenight, - highlightField + highlightField, + flashField ] })); } @@ -347,14 +379,7 @@ function useRepl({ tune, defaultSynth, autolink = true, onEvent, onDraw: onDrawP /* console.warn('no instrument chosen', event); throw new Error(`no instrument chosen for ${JSON.stringify(event)}`); */ } else { - onTrigger( - time, - event, - currentTime, - 1 /* cps */, - event.wholeOrPart().begin.valueOf(), - event.duration.valueOf(), - ); + onTrigger(time, event, currentTime, 1 /* cps */); } } catch (err) { console.warn(err); @@ -660,4 +685,4 @@ function useWebMidi(props) { return { loading, outputs, outputByName }; } -export { CodeMirror, MiniRepl, cx, useCycle, useHighlighting, usePostMessage, useRepl, useWebMidi }; +export { CodeMirror, MiniRepl, cx, flash, useCycle, useHighlighting, usePostMessage, useRepl, useWebMidi }; diff --git a/packages/react/src/components/CodeMirror6.jsx b/packages/react/src/components/CodeMirror6.jsx index 90768669f..aab5afdbe 100644 --- a/packages/react/src/components/CodeMirror6.jsx +++ b/packages/react/src/components/CodeMirror6.jsx @@ -7,6 +7,39 @@ import { javascript } from '@codemirror/lang-javascript'; // import { materialPalenight } from 'codemirror6-themes'; import { materialPalenight } from '../themes/material-palenight'; +export const setFlash = StateEffect.define(); +const flashField = StateField.define({ + create() { + return Decoration.none; + }, + update(flash, tr) { + try { + for (let e of tr.effects) { + if (e.is(setFlash)) { + if (e.value) { + const mark = Decoration.mark({ attributes: { style: `background-color: #FFCA2880` } }); + flash = Decoration.set([mark.range(0, tr.newDoc.length)]); + } else { + flash = Decoration.set([]); + } + } + } + return flash; + } catch (err) { + console.warn('flash error', err); + return flash; + } + }, + provide: (f) => EditorView.decorations.from(f), +}); + +export const flash = (view) => { + view.dispatch({ effects: setFlash.of(true) }); + setTimeout(() => { + view.dispatch({ effects: setFlash.of(false) }); + }, 200); +}; + export const setHighlights = StateEffect.define(); const highlightField = StateField.define({ create() { @@ -61,6 +94,7 @@ export default function CodeMirror({ value, onChange, onViewChanged, onCursor, o javascript(), theme || materialPalenight, highlightField, + flashField, // theme, language, ... ]} /> diff --git a/packages/react/src/index.js b/packages/react/src/index.js index f008dbde7..7ba993a7e 100644 --- a/packages/react/src/index.js +++ b/packages/react/src/index.js @@ -1,6 +1,6 @@ // import 'tailwindcss/tailwind.css'; -export { default as CodeMirror } from './components/CodeMirror6'; +export { default as CodeMirror, flash } from './components/CodeMirror6'; export * from './components/MiniRepl'; export { default as useCycle } from './hooks/useCycle'; export { default as useHighlighting } from './hooks/useHighlighting'; diff --git a/packages/soundfonts/fontloader.mjs b/packages/soundfonts/fontloader.mjs index d4d165dfd..341dfde7b 100644 --- a/packages/soundfonts/fontloader.mjs +++ b/packages/soundfonts/fontloader.mjs @@ -16,6 +16,9 @@ async function loadFont(name) { } export async function getFontBufferSource(name, pitch, ac) { + if (typeof pitch === 'string') { + pitch = toMidi(pitch); + } const { buffer, zone } = await getFontPitch(name, pitch, ac); const src = ac.createBufferSource(); src.buffer = buffer; diff --git a/packages/tone/pianoroll.mjs b/packages/tone/pianoroll.mjs index 678176e10..67e65f746 100644 --- a/packages/tone/pianoroll.mjs +++ b/packages/tone/pianoroll.mjs @@ -8,7 +8,7 @@ import { Pattern } from '@strudel.cycles/core'; const scale = (normalized, min, max) => normalized * (max - min) + min; const getValue = (e) => { - let value = typeof e.value === 'object' ? e.value.n : e.value; + let value = typeof e.value === 'object' ? e.value.note ?? e.value.n : e.value; if (typeof value === 'string') { value = toMidi(value); } diff --git a/packages/webaudio/sampler.mjs b/packages/webaudio/sampler.mjs index 30e94169c..10c6d6be9 100644 --- a/packages/webaudio/sampler.mjs +++ b/packages/webaudio/sampler.mjs @@ -93,16 +93,32 @@ export const loadGithubSamples = async (path, nameFn) => { * */ -export const samples = (sampleMap, baseUrl = sampleMap._base) => { +export const samples = (sampleMap, baseUrl = sampleMap._base || '') => { sampleCache.current = { ...sampleCache.current, ...Object.fromEntries( - Object.entries(sampleMap).map(([key, value]) => [ - key, - (typeof value === 'string' ? [value] : value).map((v) => - (baseUrl + v).replace('github:', 'https://raw.githubusercontent.com/'), - ), - ]), + Object.entries(sampleMap).map(([key, value]) => { + if (typeof value === 'string') { + value = [value]; + } + if (typeof value !== 'object') { + throw new Error('wrong sample map format for ' + key); + } + baseUrl = value._base || baseUrl; + const replaceUrl = (v) => (baseUrl + v).replace('github:', 'https://raw.githubusercontent.com/'); + if (Array.isArray(value)) { + return [key, value.map(replaceUrl)]; + } + // must be object + return [ + key, + Object.fromEntries( + Object.entries(value).map(([note, samples]) => { + return [note, (typeof samples === 'string' ? [samples] : samples).map(replaceUrl)]; + }), + ), + ]; + }), ), }; }; diff --git a/packages/webaudio/webaudio.mjs b/packages/webaudio/webaudio.mjs index fea9df258..8a13e30cd 100644 --- a/packages/webaudio/webaudio.mjs +++ b/packages/webaudio/webaudio.mjs @@ -6,7 +6,7 @@ This program is free software: you can redistribute it and/or modify it under th // import { Pattern, getFrequency, patternify2 } from '@strudel.cycles/core'; import * as strudel from '@strudel.cycles/core'; -import { fromMidi } from '@strudel.cycles/core'; +import { fromMidi, toMidi } from '@strudel.cycles/core'; import { loadBuffer } from './sampler.mjs'; const { Pattern } = strudel; @@ -68,7 +68,11 @@ const getSoundfontKey = (s) => { return; }; -const getSampleBufferSource = async (s, n) => { +const getSampleBufferSource = async (s, n, note) => { + let transpose = 0; + if (note) { + transpose = toMidi(note) - 36; // C3 is middle C + } const ac = getAudioContext(); // is sample from loaded samples(..) const samples = getLoadedSamples(); @@ -79,13 +83,47 @@ const getSampleBufferSource = async (s, n) => { if (!bank) { throw new Error('sample not found:', s, 'try one of ' + Object.keys(samples)); } - const sampleUrl = bank[n % bank.length]; + if (typeof bank !== 'object') { + throw new Error('wrong format for sample bank:', s); + } + let sampleUrl; + if (Array.isArray(bank)) { + sampleUrl = bank[n % bank.length]; + } else { + if (!note) { + throw new Error('no note(...) set for sound', s); + } + const midiDiff = (noteA) => toMidi(noteA) - toMidi(note); + // object format will expect keys as notes + const closest = Object.keys(bank) + .filter((k) => !k.startsWith('_')) + .reduce( + (closest, key, j) => (!closest || Math.abs(midiDiff(key)) < Math.abs(midiDiff(closest)) ? key : closest), + null, + ); + transpose = -midiDiff(closest); // semitones to repitch + sampleUrl = bank[closest][n % bank[closest].length]; + } const buffer = await loadBuffer(sampleUrl, ac); const bufferSource = ac.createBufferSource(); bufferSource.buffer = buffer; + const playbackRate = 1.0 * Math.pow(2, transpose / 12); + // bufferSource.playbackRate.value = Math.pow(2, transpose / 12); + bufferSource.playbackRate.value = playbackRate; return bufferSource; }; +const splitSN = (s, n) => { + if (!s.includes(':')) { + return [s, n]; + } + let [s2, n2] = s.split(':'); + if (isNaN(Number(n2))) { + return [s, n]; + } + return [s2, n2]; +}; + Pattern.prototype.out = function () { return this.onTrigger(async (t, hap, ct) => { const ac = getAudioContext(); @@ -96,7 +134,9 @@ Pattern.prototype.out = function () { freq, s, sf, + clip = 0, // if 1, samples will be cut off when the hap ends n = 0, + note, gain = 1, cutoff, resonance = 1, @@ -106,19 +146,29 @@ Pattern.prototype.out = function () { bandq = 1, pan, attack = 0.001, - decay = 0, - sustain = 1, + decay = 0.05, + sustain = 0.5, release = 0.001, speed = 1, // sample playback speed begin = 0, end = 1, } = hap.value; + const { velocity = 1 } = hap.context; + gain *= velocity; // legacy fix for velocity // the chain will hold all audio nodes that connect to each other const chain = []; - if (typeof n === 'string') { - n = toMidi(n); // e.g. c3 => 48 + if (typeof s === 'string') { + [s, n] = splitSN(s, n); + } + if (typeof note === 'string') { + [note, n] = splitSN(note, n); } if (!s || ['sine', 'square', 'triangle', 'sawtooth'].includes(s)) { + // with synths, n and note are the same thing + n = note || n; + if (typeof n === 'string') { + n = toMidi(n); // e.g. c3 => 48 + } // get frequency if (!freq && typeof n === 'number') { freq = fromMidi(n); // + 48); @@ -128,7 +178,7 @@ Pattern.prototype.out = function () { chain.push(o); // level down oscillators as they are really loud compared to samples i've tested const g = ac.createGain(); - g.gain.value = 0.5; + g.gain.value = 0.3; chain.push(g); // TODO: make adsr work with samples without pops // envelope @@ -150,10 +200,10 @@ Pattern.prototype.out = function () { try { if (soundfont) { // is soundfont - bufferSource = await globalThis.getFontBufferSource(soundfont, n, ac); + bufferSource = await globalThis.getFontBufferSource(soundfont, note || n, ac); } else { // is sample from loaded samples(..) - bufferSource = await getSampleBufferSource(s, n); + bufferSource = await getSampleBufferSource(s, n, note); } } catch (err) { console.warn(err); @@ -170,27 +220,34 @@ Pattern.prototype.out = function () { } bufferSource.playbackRate.value = Math.abs(speed) * bufferSource.playbackRate.value; // TODO: nudge, unit, cut, loop - let duration = soundfont ? hap.duration : bufferSource.buffer.duration; + let duration = soundfont || clip ? hap.duration : bufferSource.buffer.duration; // let duration = bufferSource.buffer.duration; const offset = begin * duration; duration = ((end - begin) * duration) / Math.abs(speed); - if (soundfont) { + if (soundfont || clip) { bufferSource.start(t, offset); // duration does not work here for some reason } else { bufferSource.start(t, offset, duration); } - bufferSource.stop(t + duration); chain.push(bufferSource); - if (soundfont) { + if (soundfont || clip) { const env = ac.createGain(); - env.gain.value = 1; - const fadeLength = 0.1; - env.gain.value = 0.5; - env.gain.setValueAtTime(0.5, t + duration - fadeLength); - env.gain.linearRampToValueAtTime(0, t + duration); + const releaseLength = 0.1; + env.gain.value = 0.6; + env.gain.setValueAtTime(env.gain.value, t + duration); + env.gain.linearRampToValueAtTime(0, t + duration + releaseLength); + // env.gain.linearRampToValueAtTime(0, t + duration + releaseLength); chain.push(env); + bufferSource.stop(t + duration + releaseLength); + } else { + bufferSource.stop(t + duration); } } + // master out + const master = ac.createGain(); + master.gain.value = gain; + chain.push(master); + // filters cutoff !== undefined && chain.push(getFilter('lowpass', cutoff, resonance)); hcutoff !== undefined && chain.push(getFilter('highpass', hcutoff, hresonance)); @@ -204,9 +261,9 @@ Pattern.prototype.out = function () { chain.push(panner); } // master out - const master = ac.createGain(); + /* const master = ac.createGain(); master.gain.value = 0.8 * gain; - chain.push(master); + chain.push(master); */ chain.push(ac.destination); // connect chain elements together chain.slice(1).reduce((last, current) => last.connect(current), chain[0]); diff --git a/repl/package-lock.json b/repl/package-lock.json index c983ec80b..10375f90a 100644 --- a/repl/package-lock.json +++ b/repl/package-lock.json @@ -8,6 +8,8 @@ "name": "@strudel.cycles/repl", "version": "0.0.0", "dependencies": { + "@supabase/supabase-js": "^1.35.3", + "nanoid": "^4.0.0", "react": "^17.0.2", "react-dom": "^17.0.2" }, @@ -509,6 +511,59 @@ "node": ">= 8.0.0" } }, + "node_modules/@supabase/functions-js": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-1.3.3.tgz", + "integrity": "sha512-35vO9niHRtzGe1QSvXKdOfvGPiX2KC44dGpWU6y0/gZCfTIgog/soU9HqABzQC/maVowO3hGLWfez5aN0MKfow==", + "dependencies": { + "cross-fetch": "^3.1.5" + } + }, + "node_modules/@supabase/gotrue-js": { + "version": "1.22.16", + "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-1.22.16.tgz", + "integrity": "sha512-t/tR87anihvyc9ePk53NF2CG8yzTDiWOt0ReZpr7sRKV91sHNLbghVMsMDwPONWnVQ9V2/qfKutuAvPGTB/Dew==", + "dependencies": { + "cross-fetch": "^3.0.6" + } + }, + "node_modules/@supabase/postgrest-js": { + "version": "0.37.3", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-0.37.3.tgz", + "integrity": "sha512-Iqwv9D80YGkCi60Zl2lsV04WxOmjFqxpFmxoZ5xUqsVZHvIoAbJ9tMM3+0F7VkZZbsjnaYHrpJ58xLxU7cgy2w==", + "dependencies": { + "cross-fetch": "^3.1.5" + } + }, + "node_modules/@supabase/realtime-js": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-1.7.2.tgz", + "integrity": "sha512-DMUaFIKj7KszGtWTTQbhMmUzZf7UnwYqySsmY+G8HgYxvY3ZaVa+DZD0I6ofgr4OLNr0po/ODM2a4lf5m5GNBg==", + "dependencies": { + "@types/phoenix": "^1.5.4", + "websocket": "^1.0.34" + } + }, + "node_modules/@supabase/storage-js": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-1.7.1.tgz", + "integrity": "sha512-0ZlKlGgB3Qzhu07fts5pr2Y+c4xW58d7sDOB9m6nSfltS6SSfBPmqtdhU0zV9vy3vAjC74XeqUcpMhHP5E+aoA==", + "dependencies": { + "cross-fetch": "^3.1.0" + } + }, + "node_modules/@supabase/supabase-js": { + "version": "1.35.3", + "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-1.35.3.tgz", + "integrity": "sha512-uwO8OVdMFsGZNZ1xQhFz22+PSW0EWYZ5xVq+jQeGz8nhabEu+Q9Uyep/bcNzOpyPJRzbGfxSPRzgAdAxfJgFhw==", + "dependencies": { + "@supabase/functions-js": "^1.3.3", + "@supabase/gotrue-js": "^1.22.14", + "@supabase/postgrest-js": "^0.37.2", + "@supabase/realtime-js": "^1.7.2", + "@supabase/storage-js": "^1.7.0" + } + }, "node_modules/@tailwindcss/typography": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.2.tgz", @@ -523,6 +578,11 @@ "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1 || insiders" } }, + "node_modules/@types/phoenix": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.5.4.tgz", + "integrity": "sha512-L5eZmzw89eXBKkiqVBcJfU1QGx9y+wurRIEgt0cuLH0hwNtVUxtx+6cu0R2STwWj468sjXyBYPYDtGclUd1kjQ==" + }, "node_modules/@vitejs/plugin-react": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-1.3.2.tgz", @@ -688,6 +748,18 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/bufferutil": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz", + "integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==", + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, "node_modules/camelcase-css": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", @@ -790,6 +862,14 @@ "safe-buffer": "~5.1.1" } }, + "node_modules/cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "dependencies": { + "node-fetch": "2.6.7" + } + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -802,6 +882,15 @@ "node": ">=4" } }, + "node_modules/d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dependencies": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -860,6 +949,39 @@ "integrity": "sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA==", "dev": true }, + "node_modules/es5-ext": { + "version": "0.10.61", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz", + "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==", + "hasInstallScript": true, + "dependencies": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dependencies": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, "node_modules/esbuild": { "version": "0.14.39", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.39.tgz", @@ -1239,6 +1361,19 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, + "node_modules/ext": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "dependencies": { + "type": "^2.5.0" + } + }, + "node_modules/ext/node_modules/type": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz", + "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==" + }, "node_modules/fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -1426,6 +1561,11 @@ "node": ">=0.12.0" } }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -1528,15 +1668,48 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", - "dev": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz", + "integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg==", "bin": { - "nanoid": "bin/nanoid.cjs" + "nanoid": "bin/nanoid.js" }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": "^14 || ^16 || >=18" + } + }, + "node_modules/next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp-build": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" } }, "node_modules/node-releases": { @@ -1714,6 +1887,18 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, + "node_modules/postcss/node_modules/nanoid": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -1980,6 +2165,36 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/utf-8-validate": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", + "integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==", + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -2023,6 +2238,49 @@ } } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/websocket": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", + "dependencies": { + "bufferutil": "^4.0.1", + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "typedarray-to-buffer": "^3.1.5", + "utf-8-validate": "^5.0.2", + "yaeti": "^0.0.6" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/websocket/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/websocket/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -2032,6 +2290,14 @@ "node": ">=0.4" } }, + "node_modules/yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", + "engines": { + "node": ">=0.10.32" + } + }, "node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", @@ -2402,6 +2668,59 @@ "picomatch": "^2.2.2" } }, + "@supabase/functions-js": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-1.3.3.tgz", + "integrity": "sha512-35vO9niHRtzGe1QSvXKdOfvGPiX2KC44dGpWU6y0/gZCfTIgog/soU9HqABzQC/maVowO3hGLWfez5aN0MKfow==", + "requires": { + "cross-fetch": "^3.1.5" + } + }, + "@supabase/gotrue-js": { + "version": "1.22.16", + "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-1.22.16.tgz", + "integrity": "sha512-t/tR87anihvyc9ePk53NF2CG8yzTDiWOt0ReZpr7sRKV91sHNLbghVMsMDwPONWnVQ9V2/qfKutuAvPGTB/Dew==", + "requires": { + "cross-fetch": "^3.0.6" + } + }, + "@supabase/postgrest-js": { + "version": "0.37.3", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-0.37.3.tgz", + "integrity": "sha512-Iqwv9D80YGkCi60Zl2lsV04WxOmjFqxpFmxoZ5xUqsVZHvIoAbJ9tMM3+0F7VkZZbsjnaYHrpJ58xLxU7cgy2w==", + "requires": { + "cross-fetch": "^3.1.5" + } + }, + "@supabase/realtime-js": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-1.7.2.tgz", + "integrity": "sha512-DMUaFIKj7KszGtWTTQbhMmUzZf7UnwYqySsmY+G8HgYxvY3ZaVa+DZD0I6ofgr4OLNr0po/ODM2a4lf5m5GNBg==", + "requires": { + "@types/phoenix": "^1.5.4", + "websocket": "^1.0.34" + } + }, + "@supabase/storage-js": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-1.7.1.tgz", + "integrity": "sha512-0ZlKlGgB3Qzhu07fts5pr2Y+c4xW58d7sDOB9m6nSfltS6SSfBPmqtdhU0zV9vy3vAjC74XeqUcpMhHP5E+aoA==", + "requires": { + "cross-fetch": "^3.1.0" + } + }, + "@supabase/supabase-js": { + "version": "1.35.3", + "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-1.35.3.tgz", + "integrity": "sha512-uwO8OVdMFsGZNZ1xQhFz22+PSW0EWYZ5xVq+jQeGz8nhabEu+Q9Uyep/bcNzOpyPJRzbGfxSPRzgAdAxfJgFhw==", + "requires": { + "@supabase/functions-js": "^1.3.3", + "@supabase/gotrue-js": "^1.22.14", + "@supabase/postgrest-js": "^0.37.2", + "@supabase/realtime-js": "^1.7.2", + "@supabase/storage-js": "^1.7.0" + } + }, "@tailwindcss/typography": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.2.tgz", @@ -2413,6 +2732,11 @@ "lodash.merge": "^4.6.2" } }, + "@types/phoenix": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.5.4.tgz", + "integrity": "sha512-L5eZmzw89eXBKkiqVBcJfU1QGx9y+wurRIEgt0cuLH0hwNtVUxtx+6cu0R2STwWj468sjXyBYPYDtGclUd1kjQ==" + }, "@vitejs/plugin-react": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-1.3.2.tgz", @@ -2519,6 +2843,14 @@ "picocolors": "^1.0.0" } }, + "bufferutil": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz", + "integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==", + "requires": { + "node-gyp-build": "^4.3.0" + } + }, "camelcase-css": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", @@ -2593,12 +2925,29 @@ "safe-buffer": "~5.1.1" } }, + "cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "requires": { + "node-fetch": "2.6.7" + } + }, "cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", "dev": true }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -2643,6 +2992,35 @@ "integrity": "sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA==", "dev": true }, + "es5-ext": { + "version": "0.10.61", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz", + "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==", + "requires": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, "esbuild": { "version": "0.14.39", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.39.tgz", @@ -2829,6 +3207,21 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, + "ext": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "requires": { + "type": "^2.5.0" + }, + "dependencies": { + "type": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz", + "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==" + } + } + }, "fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -2965,6 +3358,11 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3043,10 +3441,27 @@ "dev": true }, "nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz", + "integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg==" + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "node-gyp-build": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" }, "node-releases": { "version": "2.0.4", @@ -3104,6 +3519,14 @@ "nanoid": "^3.3.3", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" + }, + "dependencies": { + "nanoid": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "dev": true + } } }, "postcss-js": { @@ -3325,6 +3748,32 @@ "is-number": "^7.0.0" } }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "utf-8-validate": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", + "integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==", + "requires": { + "node-gyp-build": "^4.3.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -3344,12 +3793,59 @@ "rollup": "^2.59.0" } }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "websocket": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", + "requires": { + "bufferutil": "^4.0.1", + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "typedarray-to-buffer": "^3.1.5", + "utf-8-validate": "^5.0.2", + "yaeti": "^0.0.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + } + } + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==" + }, "yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", diff --git a/repl/package.json b/repl/package.json index c0afb29a1..9c5923719 100644 --- a/repl/package.json +++ b/repl/package.json @@ -15,6 +15,8 @@ "static": "npx serve ../docs" }, "dependencies": { + "@supabase/supabase-js": "^1.35.3", + "nanoid": "^4.0.0", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/repl/public/piano/A0v8.mp3 b/repl/public/piano/A0v8.mp3 new file mode 100644 index 000000000..a70ced60d Binary files /dev/null and b/repl/public/piano/A0v8.mp3 differ diff --git a/repl/public/piano/A1v8.mp3 b/repl/public/piano/A1v8.mp3 new file mode 100644 index 000000000..4c77113d1 Binary files /dev/null and b/repl/public/piano/A1v8.mp3 differ diff --git a/repl/public/piano/A2v8.mp3 b/repl/public/piano/A2v8.mp3 new file mode 100644 index 000000000..a336ba9a3 Binary files /dev/null and b/repl/public/piano/A2v8.mp3 differ diff --git a/repl/public/piano/A3v8.mp3 b/repl/public/piano/A3v8.mp3 new file mode 100644 index 000000000..cdbf3e9a7 Binary files /dev/null and b/repl/public/piano/A3v8.mp3 differ diff --git a/repl/public/piano/A4v8.mp3 b/repl/public/piano/A4v8.mp3 new file mode 100644 index 000000000..374a9a855 Binary files /dev/null and b/repl/public/piano/A4v8.mp3 differ diff --git a/repl/public/piano/A5v8.mp3 b/repl/public/piano/A5v8.mp3 new file mode 100644 index 000000000..66a903656 Binary files /dev/null and b/repl/public/piano/A5v8.mp3 differ diff --git a/repl/public/piano/A6v8.mp3 b/repl/public/piano/A6v8.mp3 new file mode 100644 index 000000000..4caee72bb Binary files /dev/null and b/repl/public/piano/A6v8.mp3 differ diff --git a/repl/public/piano/A7v8.mp3 b/repl/public/piano/A7v8.mp3 new file mode 100644 index 000000000..64d32b4a8 Binary files /dev/null and b/repl/public/piano/A7v8.mp3 differ diff --git a/repl/public/piano/C1v8.mp3 b/repl/public/piano/C1v8.mp3 new file mode 100644 index 000000000..d6e17a6fb Binary files /dev/null and b/repl/public/piano/C1v8.mp3 differ diff --git a/repl/public/piano/C2v8.mp3 b/repl/public/piano/C2v8.mp3 new file mode 100644 index 000000000..8ed32f55b Binary files /dev/null and b/repl/public/piano/C2v8.mp3 differ diff --git a/repl/public/piano/C3v8.mp3 b/repl/public/piano/C3v8.mp3 new file mode 100644 index 000000000..98b80e04c Binary files /dev/null and b/repl/public/piano/C3v8.mp3 differ diff --git a/repl/public/piano/C4v8.mp3 b/repl/public/piano/C4v8.mp3 new file mode 100644 index 000000000..c7aba1c26 Binary files /dev/null and b/repl/public/piano/C4v8.mp3 differ diff --git a/repl/public/piano/C5v8.mp3 b/repl/public/piano/C5v8.mp3 new file mode 100644 index 000000000..7d566154e Binary files /dev/null and b/repl/public/piano/C5v8.mp3 differ diff --git a/repl/public/piano/C6v8.mp3 b/repl/public/piano/C6v8.mp3 new file mode 100644 index 000000000..c4f30ea53 Binary files /dev/null and b/repl/public/piano/C6v8.mp3 differ diff --git a/repl/public/piano/C7v8.mp3 b/repl/public/piano/C7v8.mp3 new file mode 100644 index 000000000..178353a75 Binary files /dev/null and b/repl/public/piano/C7v8.mp3 differ diff --git a/repl/public/piano/C8v8.mp3 b/repl/public/piano/C8v8.mp3 new file mode 100644 index 000000000..3357d0ed4 Binary files /dev/null and b/repl/public/piano/C8v8.mp3 differ diff --git a/repl/public/piano/Ds1v8.mp3 b/repl/public/piano/Ds1v8.mp3 new file mode 100644 index 000000000..ae7da2cd2 Binary files /dev/null and b/repl/public/piano/Ds1v8.mp3 differ diff --git a/repl/public/piano/Ds2v8.mp3 b/repl/public/piano/Ds2v8.mp3 new file mode 100644 index 000000000..0817e5817 Binary files /dev/null and b/repl/public/piano/Ds2v8.mp3 differ diff --git a/repl/public/piano/Ds3v8.mp3 b/repl/public/piano/Ds3v8.mp3 new file mode 100644 index 000000000..fda53ce01 Binary files /dev/null and b/repl/public/piano/Ds3v8.mp3 differ diff --git a/repl/public/piano/Ds4v8.mp3 b/repl/public/piano/Ds4v8.mp3 new file mode 100644 index 000000000..7894b6d05 Binary files /dev/null and b/repl/public/piano/Ds4v8.mp3 differ diff --git a/repl/public/piano/Ds5v8.mp3 b/repl/public/piano/Ds5v8.mp3 new file mode 100644 index 000000000..98d04e061 Binary files /dev/null and b/repl/public/piano/Ds5v8.mp3 differ diff --git a/repl/public/piano/Ds6v8.mp3 b/repl/public/piano/Ds6v8.mp3 new file mode 100644 index 000000000..314331f75 Binary files /dev/null and b/repl/public/piano/Ds6v8.mp3 differ diff --git a/repl/public/piano/Ds7v8.mp3 b/repl/public/piano/Ds7v8.mp3 new file mode 100644 index 000000000..c2554a9d7 Binary files /dev/null and b/repl/public/piano/Ds7v8.mp3 differ diff --git a/repl/public/piano/Fs1v8.mp3 b/repl/public/piano/Fs1v8.mp3 new file mode 100644 index 000000000..47d4da8b6 Binary files /dev/null and b/repl/public/piano/Fs1v8.mp3 differ diff --git a/repl/public/piano/Fs2v8.mp3 b/repl/public/piano/Fs2v8.mp3 new file mode 100644 index 000000000..3502c6ff8 Binary files /dev/null and b/repl/public/piano/Fs2v8.mp3 differ diff --git a/repl/public/piano/Fs3v8.mp3 b/repl/public/piano/Fs3v8.mp3 new file mode 100644 index 000000000..ad3546b0f Binary files /dev/null and b/repl/public/piano/Fs3v8.mp3 differ diff --git a/repl/public/piano/Fs4v8.mp3 b/repl/public/piano/Fs4v8.mp3 new file mode 100644 index 000000000..12908edd7 Binary files /dev/null and b/repl/public/piano/Fs4v8.mp3 differ diff --git a/repl/public/piano/Fs5v8.mp3 b/repl/public/piano/Fs5v8.mp3 new file mode 100644 index 000000000..6aa830a12 Binary files /dev/null and b/repl/public/piano/Fs5v8.mp3 differ diff --git a/repl/public/piano/Fs6v8.mp3 b/repl/public/piano/Fs6v8.mp3 new file mode 100644 index 000000000..602f4580f Binary files /dev/null and b/repl/public/piano/Fs6v8.mp3 differ diff --git a/repl/public/piano/Fs7v8.mp3 b/repl/public/piano/Fs7v8.mp3 new file mode 100644 index 000000000..8a016d988 Binary files /dev/null and b/repl/public/piano/Fs7v8.mp3 differ diff --git a/repl/src/App.jsx b/repl/src/App.jsx index 4b9005916..27c7310a1 100644 --- a/repl/src/App.jsx +++ b/repl/src/App.jsx @@ -6,15 +6,25 @@ This program is free software: you can redistribute it and/or modify it under th import controls from '@strudel.cycles/core/controls.mjs'; import { evalScope, evaluate } from '@strudel.cycles/eval'; -import { CodeMirror, cx, useHighlighting, useRepl, useWebMidi } from '@strudel.cycles/react'; +import { CodeMirror, cx, flash, useHighlighting, useRepl, useWebMidi } from '@strudel.cycles/react'; import { getDefaultSynth, cleanupDraw, cleanupUi, Tone } from '@strudel.cycles/tone'; -import React, { useCallback, useLayoutEffect, useRef, useState } from 'react'; +import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'; import './App.css'; import logo from './logo.svg'; import * as tunes from './tunes.mjs'; +import { prebake } from './prebake.mjs'; import * as WebDirt from 'WebDirt'; import { loadWebDirt } from '@strudel.cycles/webdirt'; import { resetLoadedSamples, getAudioContext } from '@strudel.cycles/webaudio'; +import { createClient } from '@supabase/supabase-js'; +import { nanoid } from 'nanoid'; + +// Create a single supabase client for interacting with your database +const supabase = createClient( + 'https://pidxdsxphlhzjnzmifth.supabase.co', + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBpZHhkc3hwaGxoempuem1pZnRoIiwicm9sZSI6ImFub24iLCJpYXQiOjE2NTYyMzA1NTYsImV4cCI6MTk3MTgwNjU1Nn0.bqlw7802fsWRnqU5BLYtmXk_k-D1VFmbkHMywWc15NM', +); + evalScope( Tone, controls, @@ -37,13 +47,37 @@ loadWebDirt({ sampleFolder: 'EmuSP12', }); -const initialUrl = window.location.href; -const codeParam = window.location.href.split('#')[1]; -let decoded; -try { - decoded = atob(decodeURIComponent(codeParam || '')); -} catch (err) { - console.warn('failed to decode', err); +prebake(); + +async function initCode() { + // load code from url hash (either short hash from database or decode long hash) + try { + const initialUrl = window.location.href; + const hash = initialUrl.split('?')[1]?.split('#')?.[0]; + const codeParam = window.location.href.split('#')[1]; + // looking like https://strudel.tidalcycles.org/?J01s5i1J0200 (fixed hash length) + if (codeParam) { + console.log('decode hash from url'); + // looking like https://strudel.tidalcycles.org/#ImMzIGUzIg%3D%3D (hash length depends on code length) + return atob(decodeURIComponent(codeParam || '')); + } else if (hash) { + return supabase + .from('code') + .select('code') + .eq('hash', hash) + .then(({ data, error }) => { + if (error) { + console.warn('failed to load hash', err); + } + if (data.length) { + console.log('load hash from database', hash); + return data[0].code; + } + }); + } + } catch (err) { + console.warn('failed to decode', err); + } } function getRandomTune() { @@ -58,6 +92,7 @@ const isEmbedded = window.location !== window.parent.location; function App() { // const [editor, setEditor] = useState(); const [view, setView] = useState(); + const [lastShared, setLastShared] = useState(); const { setCode, setPattern, @@ -74,9 +109,12 @@ function App() { pushLog, pending, } = useRepl({ - tune: decoded || randomTune, + tune: '// LOADING...', defaultSynth, }); + useEffect(() => { + initCode().then((decoded) => setCode(decoded || randomTune)); + }, []); const logBox = useRef(); // scroll log box to bottom when log changes useLayoutEffect(() => { @@ -92,6 +130,7 @@ function App() { if (e.ctrlKey || e.altKey) { if (e.code === 'Enter') { e.preventDefault(); + flash(view); await activateCode(); } else if (e.code === 'Period') { cycle.stop(); @@ -101,7 +140,7 @@ function App() { }; window.addEventListener('keydown', handleKeyPress, true); return () => window.removeEventListener('keydown', handleKeyPress, true); - }, [pattern, code, activateCode, cycle]); + }, [pattern, code, activateCode, cycle, view]); useHighlighting({ view, pattern, active: cycle.started && !activeCode?.includes('strudel disable-highlighting') }); @@ -182,6 +221,7 @@ function App() { cleanupDraw(); cleanupUi(); resetLoadedSamples(); + prebake(); const parsed = await evaluate(_code); setPattern(parsed.pattern); setActiveCode(_code); @@ -195,6 +235,38 @@ function App() { 📚 tutorial )} + {!isEmbedded && ( + + )} {isEmbedded && (