From b29857e81ff1a0b2f3695f7d339c8bfbbb503ceb Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sun, 13 Feb 2022 12:11:46 +0100 Subject: [PATCH] build --- docs/dist/parse.js | 1 + docs/dist/tonal.js | 10 ++++++++++ docs/dist/voicings.js | 4 +--- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 docs/dist/tonal.js diff --git a/docs/dist/parse.js b/docs/dist/parse.js index 5f5fd1f1..79f8a779 100644 --- a/docs/dist/parse.js +++ b/docs/dist/parse.js @@ -4,6 +4,7 @@ import {Scale, Note, Interval} from "../_snowpack/pkg/@tonaljs/tonal.js"; import "./tone.js"; import "./midi.js"; import "./voicings.js"; +import "./tonal.js"; import * as toneStuff from "./tone.js"; import shapeshifter from "./shapeshifter.js"; const { diff --git a/docs/dist/tonal.js b/docs/dist/tonal.js new file mode 100644 index 00000000..0542b3d9 --- /dev/null +++ b/docs/dist/tonal.js @@ -0,0 +1,10 @@ +import {Note, Interval} from "../_snowpack/pkg/@tonaljs/tonal.js"; +import {Pattern as _Pattern} from "../_snowpack/link/strudel.js"; +const Pattern = _Pattern; +Pattern.prototype._transpose = function(intervalOrSemitones) { + const interval = !isNaN(Number(intervalOrSemitones)) ? Interval.fromSemitones(intervalOrSemitones) : String(intervalOrSemitones); + return this.fmap((note) => Note.transpose(note, interval)); +}; +Pattern.prototype.transpose = function(intervalOrSemitones) { + return this._patternify(Pattern.prototype._transpose)(intervalOrSemitones); +}; diff --git a/docs/dist/voicings.js b/docs/dist/voicings.js index 2d21dbc7..4ad12908 100644 --- a/docs/dist/voicings.js +++ b/docs/dist/voicings.js @@ -10,9 +10,7 @@ const getVoicing = (chord, lastVoicing, range = ["F3", "A4"]) => dictionaryVoici }); const Pattern = _Pattern; Pattern.prototype.fmapNested = function(func) { - return new Pattern((span) => this.query(span).map((event) => { - return reify(func(event)).query(span).map((hap) => new Hap(event.whole, event.part, hap.value)); - }).flat()); + return new Pattern((span) => this.query(span).map((event) => reify(func(event)).query(span).map((hap) => new Hap(event.whole, event.part, hap.value))).flat()); }; Pattern.prototype.voicings = function(range = ["F3", "A4"]) { let lastVoicing;