From 164d007f95c2f73ac89229e92b9a796e38f7293a Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 24 Feb 2022 12:29:07 +0000 Subject: [PATCH] repl build --- docs/_snowpack/link/strudel.js | 18 +- docs/tutorial/index.acaced6c.js | 109447 ------------------------ docs/tutorial/index.acaced6c.js.map | 1 - docs/tutorial/index.fd7d9b66.css | 1349 - docs/tutorial/index.fd7d9b66.css.map | 1 - docs/tutorial/index.html | 4 +- 6 files changed, 17 insertions(+), 110803 deletions(-) delete mode 100644 docs/tutorial/index.acaced6c.js delete mode 100644 docs/tutorial/index.acaced6c.js.map delete mode 100644 docs/tutorial/index.fd7d9b66.css delete mode 100644 docs/tutorial/index.fd7d9b66.css.map diff --git a/docs/_snowpack/link/strudel.js b/docs/_snowpack/link/strudel.js index 11fc5cbd..ca355e0e 100644 --- a/docs/_snowpack/link/strudel.js +++ b/docs/_snowpack/link/strudel.js @@ -53,7 +53,7 @@ Fraction.prototype.min = function(other) { return this.lt(other) ? this : other; }; Fraction.prototype.show = function() { - return this.n + "/" + this.d; + return this.s * this.n + "/" + this.d; }; Fraction.prototype.or = function(other) { return this.eq(0) ? other : this; @@ -276,6 +276,12 @@ class Pattern { sub(other) { return this._opleft(other, (a) => (b) => a - b); } + mul(other) { + return this._opleft(other, (a) => (b) => a * b); + } + div(other) { + return this._opleft(other, (a) => (b) => a / b); + } union(other) { return this._opleft(other, (a) => (b) => Object.assign({}, a, b)); } @@ -316,6 +322,12 @@ class Pattern { outerJoin() { return this.outerBind(id); } + _apply(func) { + return func(this); + } + layer(...funcs) { + return stack(...funcs.map((func) => func(this))); + } _patternify(func) { const pat = this; const patterned = function(...args) { @@ -384,7 +396,7 @@ class Pattern { return stack(with_pat, without_pat); } off(time_pat, func) { - return stack([this, func(this._early(time_pat))]); + return stack(this, func(this.late(time_pat))); } every(n, func) { const pat = this; @@ -447,7 +459,7 @@ class Pattern { return silence; } } -Pattern.prototype.patternified = ["fast", "slow", "early", "late"]; +Pattern.prototype.patternified = ["apply", "fast", "slow", "early", "late"]; Pattern.prototype.factories = {pure, stack, slowcat, fastcat, cat, timeCat, sequence, polymeter, pm, polyrhythm, pr}; const silence = new Pattern((_) => []); function pure(value) { diff --git a/docs/tutorial/index.acaced6c.js b/docs/tutorial/index.acaced6c.js deleted file mode 100644 index 9e3ae416..00000000 --- a/docs/tutorial/index.acaced6c.js +++ /dev/null @@ -1,109447 +0,0 @@ -// modules are defined as an array -// [ module function, map of requires ] -// -// map of requires is short require name -> numeric require -// -// anything defined in a previous bundle is accessed via the -// orig method which is the require for previous bundles - -(function (modules, entry, mainEntry, parcelRequireName, globalName) { - /* eslint-disable no-undef */ - var globalObject = - typeof globalThis !== 'undefined' - ? globalThis - : typeof self !== 'undefined' - ? self - : typeof window !== 'undefined' - ? window - : typeof global !== 'undefined' - ? global - : {}; - /* eslint-enable no-undef */ - - // Save the require from previous bundle to this closure if any - var previousRequire = - typeof globalObject[parcelRequireName] === 'function' && - globalObject[parcelRequireName]; - - var cache = previousRequire.cache || {}; - // Do not use `require` to prevent Webpack from trying to bundle this call - var nodeRequire = - typeof module !== 'undefined' && - typeof module.require === 'function' && - module.require.bind(module); - - function newRequire(name, jumped) { - if (!cache[name]) { - if (!modules[name]) { - // if we cannot find the module within our internal map or - // cache jump to the current global require ie. the last bundle - // that was added to the page. - var currentRequire = - typeof globalObject[parcelRequireName] === 'function' && - globalObject[parcelRequireName]; - if (!jumped && currentRequire) { - return currentRequire(name, true); - } - - // If there are other bundles on this page the require from the - // previous one is saved to 'previousRequire'. Repeat this as - // many times as there are bundles until the module is found or - // we exhaust the require chain. - if (previousRequire) { - return previousRequire(name, true); - } - - // Try the node require function if it exists. - if (nodeRequire && typeof name === 'string') { - return nodeRequire(name); - } - - var err = new Error("Cannot find module '" + name + "'"); - err.code = 'MODULE_NOT_FOUND'; - throw err; - } - - localRequire.resolve = resolve; - localRequire.cache = {}; - - var module = (cache[name] = new newRequire.Module(name)); - - modules[name][0].call( - module.exports, - localRequire, - module, - module.exports, - this - ); - } - - return cache[name].exports; - - function localRequire(x) { - var res = localRequire.resolve(x); - return res === false ? {} : newRequire(res); - } - - function resolve(x) { - var id = modules[name][1][x]; - return id != null ? id : x; - } - } - - function Module(moduleName) { - this.id = moduleName; - this.bundle = newRequire; - this.exports = {}; - } - - newRequire.isParcelRequire = true; - newRequire.Module = Module; - newRequire.modules = modules; - newRequire.cache = cache; - newRequire.parent = previousRequire; - newRequire.register = function (id, exports) { - modules[id] = [ - function (require, module) { - module.exports = exports; - }, - {}, - ]; - }; - - Object.defineProperty(newRequire, 'root', { - get: function () { - return globalObject[parcelRequireName]; - }, - }); - - globalObject[parcelRequireName] = newRequire; - - for (var i = 0; i < entry.length; i++) { - newRequire(entry[i]); - } - - if (mainEntry) { - // Expose entry point to Node, AMD or browser globals - // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js - var mainExports = newRequire(mainEntry); - - // CommonJS - if (typeof exports === 'object' && typeof module !== 'undefined') { - module.exports = mainExports; - - // RequireJS - } else if (typeof define === 'function' && define.amd) { - define(function () { - return mainExports; - }); - - // +