From 651a73c605055f966b568e661095d2db635fe836 Mon Sep 17 00:00:00 2001 From: tmhglnd Date: Fri, 11 Sep 2020 15:36:12 +0200 Subject: [PATCH] added drunk() and print methods --- mercury_ide/code/mercury.js | 10 + .../@tonaljs/abc-notation/package.json | 16 +- .../node_modules/@tonaljs/array/package.json | 16 +- .../@tonaljs/chord-detect/dist/index.es.js | 35 +- .../chord-detect/dist/index.es.js.map | 2 +- .../@tonaljs/chord-detect/dist/index.js | 35 +- .../@tonaljs/chord-detect/dist/index.js.map | 2 +- .../@tonaljs/chord-detect/package.json | 30 +- .../@tonaljs/chord-type/dist/index.es.js | 71 +- .../@tonaljs/chord-type/dist/index.es.js.map | 2 +- .../@tonaljs/chord-type/dist/index.js | 93 +- .../@tonaljs/chord-type/dist/index.js.map | 2 +- .../@tonaljs/chord-type/package.json | 21 +- .../node_modules/@tonaljs/chord/README.md | 4 +- .../@tonaljs/chord/dist/index.d.ts | 2 +- .../@tonaljs/chord/dist/index.es.js | 17 +- .../@tonaljs/chord/dist/index.es.js.map | 2 +- .../node_modules/@tonaljs/chord/dist/index.js | 41 +- .../@tonaljs/chord/dist/index.js.map | 2 +- .../node_modules/@tonaljs/chord/package.json | 34 +- .../@tonaljs/core/dist/index.es.js | 6 +- .../@tonaljs/core/dist/index.es.js.map | 2 +- .../node_modules/@tonaljs/core/dist/index.js | 6 +- .../@tonaljs/core/dist/index.js.map | 2 +- .../node_modules/@tonaljs/core/package.json | 14 +- .../@tonaljs/interval/dist/index.d.ts | 4 +- .../@tonaljs/interval/package.json | 16 +- .../@tonaljs/midi/dist/index.es.js | 2 + .../@tonaljs/midi/dist/index.es.js.map | 2 +- .../node_modules/@tonaljs/midi/dist/index.js | 2 + .../@tonaljs/midi/dist/index.js.map | 2 +- .../node_modules/@tonaljs/midi/package.json | 16 +- .../node_modules/@tonaljs/mode/dist/index.js | 20 +- .../node_modules/@tonaljs/mode/package.json | 18 +- .../code/node_modules/@tonaljs/note/README.md | 24 +- .../@tonaljs/note/dist/index.d.ts | 24 +- .../@tonaljs/note/dist/index.es.js | 18 +- .../@tonaljs/note/dist/index.es.js.map | 2 +- .../node_modules/@tonaljs/note/dist/index.js | 16 + .../@tonaljs/note/dist/index.js.map | 2 +- .../node_modules/@tonaljs/note/package.json | 18 +- .../@tonaljs/pcset/dist/index.d.ts | 6 +- .../node_modules/@tonaljs/pcset/package.json | 16 +- .../@tonaljs/progression/dist/index.js | 2 +- .../@tonaljs/progression/package.json | 30 +- .../node_modules/@tonaljs/range/package.json | 16 +- .../@tonaljs/roman-numeral/package.json | 16 +- .../@tonaljs/scale-type/dist/index.es.js | 9 +- .../@tonaljs/scale-type/dist/index.es.js.map | 2 +- .../@tonaljs/scale-type/dist/index.js | 29 +- .../@tonaljs/scale-type/dist/index.js.map | 2 +- .../@tonaljs/scale-type/package.json | 18 +- .../node_modules/@tonaljs/scale/dist/index.js | 22 +- .../node_modules/@tonaljs/scale/package.json | 24 +- .../@tonaljs/tonal/browser/tonal.min.js | 2 +- .../@tonaljs/tonal/browser/tonal.min.js.map | 2 +- .../node_modules/@tonaljs/tonal/package.json | 28 +- .../fast-glob/out/managers/tasks.js | 1 + .../fast-glob/out/providers/filters/deep.d.ts | 2 +- .../fast-glob/out/providers/filters/deep.js | 30 +- .../fast-glob/out/providers/filters/entry.js | 21 +- .../node_modules/fast-glob/out/settings.js | 1 + .../node_modules/fast-glob/out/utils/array.js | 1 + .../node_modules/fast-glob/out/utils/errno.js | 1 + .../node_modules/fast-glob/out/utils/fs.js | 1 + .../node_modules/fast-glob/out/utils/index.js | 1 + .../node_modules/fast-glob/out/utils/path.js | 1 + .../fast-glob/out/utils/pattern.js | 30 +- .../fast-glob/out/utils/stream.js | 1 + .../fast-glob/out/utils/string.js | 1 + .../code/node_modules/fast-glob/package.json | 27 +- .../code/node_modules/fastq/index.d.ts | 17 +- .../code/node_modules/fastq/package.json | 12 +- .../code/node_modules/fastq/test/example.ts | 38 +- .../code/node_modules/fs-extra/CHANGELOG.md | 7 + .../fs-extra/lib/mkdirs/make-dir.js | 3 +- .../fs-extra/lib/remove/rimraf.js | 12 - .../code/node_modules/fs-extra/package.json | 30 +- .../node_modules/graceful-fs/graceful-fs.js | 30 +- .../node_modules/graceful-fs/package.json | 23 +- .../node_modules => }/jsonfile/CHANGELOG.md | 0 .../node_modules => }/jsonfile/LICENSE | 0 .../node_modules => }/jsonfile/README.md | 0 .../node_modules => }/jsonfile/index.js | 0 .../node_modules => }/jsonfile/package.json | 4 +- .../node_modules => }/jsonfile/utils.js | 0 mercury_ide/code/node_modules/merge2/LICENSE | 42 +- .../code/node_modules/merge2/README.md | 2 + mercury_ide/code/node_modules/merge2/index.js | 67 +- .../code/node_modules/merge2/package.json | 20 +- .../code/node_modules/save-dev/README.md | 9 + .../code/node_modules/save-dev/package.json | 38 + .../node_modules/total-serialism/README.md | 327 +++- .../node_modules/total-serialism/_config.yml | 1 + .../total-serialism/build/ts.bundle.js | 954 +++++++++--- .../total-serialism/build/ts.es5.js | 1138 +++++++++++--- .../total-serialism/build/ts.es5.min.js | 2 +- .../total-serialism/data/fibonacci.json | 2 +- .../node_modules/total-serialism/docs/LICENSE | 21 + .../docs/algorithmic-methods.md | 184 +++ .../docs/generative-methods.md | 119 ++ .../total-serialism/docs/statistic-methods.md | 68 + .../docs/stochastic-methods.md | 268 ++++ .../total-serialism/docs/transform-methods.md | 137 ++ .../total-serialism/docs/translate-methods.md | 125 ++ .../total-serialism/docs/utility-methods.md | 52 + .../node_modules/total-serialism/index.js | 6 +- .../node_modules/total-serialism/package.json | 41 +- .../total-serialism/src/gen-basic.js | 19 +- .../total-serialism/src/gen-complex.js | 60 +- .../total-serialism/src/gen-stochastic.js | 166 +- .../total-serialism/src/statistic.js | 141 ++ .../total-serialism/src/transform.js | 64 +- .../total-serialism/src/utility.js | 57 +- .../total-serialism/test-plot.txt | 21 + .../total-serialism/test/serialism.test.js | 148 +- .../node_modules => }/universalify/LICENSE | 0 .../node_modules => }/universalify/README.md | 0 .../node_modules => }/universalify/index.js | 0 .../universalify/package.json | 6 +- mercury_ide/code/package-lock.json | 244 +-- mercury_ide/code/package.json | 6 +- mercury_ide/patchers/_mercury_main.maxpat | 1338 +++++++++++++---- 123 files changed, 5564 insertions(+), 1501 deletions(-) rename mercury_ide/code/node_modules/{fs-extra/node_modules => }/jsonfile/CHANGELOG.md (100%) rename mercury_ide/code/node_modules/{fs-extra/node_modules => }/jsonfile/LICENSE (100%) rename mercury_ide/code/node_modules/{fs-extra/node_modules => }/jsonfile/README.md (100%) rename mercury_ide/code/node_modules/{fs-extra/node_modules => }/jsonfile/index.js (100%) rename mercury_ide/code/node_modules/{fs-extra/node_modules => }/jsonfile/package.json (94%) rename mercury_ide/code/node_modules/{fs-extra/node_modules => }/jsonfile/utils.js (100%) create mode 100644 mercury_ide/code/node_modules/save-dev/README.md create mode 100644 mercury_ide/code/node_modules/save-dev/package.json create mode 100644 mercury_ide/code/node_modules/total-serialism/_config.yml create mode 100644 mercury_ide/code/node_modules/total-serialism/docs/LICENSE create mode 100644 mercury_ide/code/node_modules/total-serialism/docs/algorithmic-methods.md create mode 100644 mercury_ide/code/node_modules/total-serialism/docs/generative-methods.md create mode 100644 mercury_ide/code/node_modules/total-serialism/docs/statistic-methods.md create mode 100644 mercury_ide/code/node_modules/total-serialism/docs/stochastic-methods.md create mode 100644 mercury_ide/code/node_modules/total-serialism/docs/transform-methods.md create mode 100644 mercury_ide/code/node_modules/total-serialism/docs/translate-methods.md create mode 100644 mercury_ide/code/node_modules/total-serialism/docs/utility-methods.md create mode 100644 mercury_ide/code/node_modules/total-serialism/src/statistic.js create mode 100644 mercury_ide/code/node_modules/total-serialism/test-plot.txt rename mercury_ide/code/node_modules/{fs-extra/node_modules => }/universalify/LICENSE (100%) rename mercury_ide/code/node_modules/{fs-extra/node_modules => }/universalify/README.md (100%) rename mercury_ide/code/node_modules/{fs-extra/node_modules => }/universalify/index.js (100%) rename mercury_ide/code/node_modules/{fs-extra/node_modules => }/universalify/package.json (92%) diff --git a/mercury_ide/code/mercury.js b/mercury_ide/code/mercury.js index 4e0aa670..76a85d41 100644 --- a/mercury_ide/code/mercury.js +++ b/mercury_ide/code/mercury.js @@ -174,6 +174,16 @@ const handlers = { 'randF' : (...v) => { return Rand.randomFloat(...v); }, + // generate a random walk (drunk) + 'drunk' : (...v) => { + return Rand.drunk(...v); + }, + 'drunkF' : (...v) => { + return Rand.drunkFloat(...v); + }, + 'drunkFloat' : (...v) => { + return Rand.drunkFloat(...v); + }, // generate random values picked from an urn 'urn' : (...v) => { return Rand.urn(...v); diff --git a/mercury_ide/code/node_modules/@tonaljs/abc-notation/package.json b/mercury_ide/code/node_modules/@tonaljs/abc-notation/package.json index d84b102a..74ffdde6 100644 --- a/mercury_ide/code/node_modules/@tonaljs/abc-notation/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/abc-notation/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/abc-notation@^3.5.4", - "_id": "@tonaljs/abc-notation@3.5.4", + "_id": "@tonaljs/abc-notation@3.5.5", "_inBundle": false, - "_integrity": "sha512-vRFDKxLOY2n3GR6NSzl+9OpAO3Bbw54XupfF5obOztaMHGMW3CoCnv7D2YUPNtvWvEKnKAC4LjU6/VZFOxqk6Q==", + "_integrity": "sha512-VwYS/u2MJl6hYWF3N7G+QFp0plqjsu0170jcuy+1Gk1lsk6kOrn7Zb845M5YYv9JzjPOjA4Qm0fRXYcMKadayQ==", "_location": "/@tonaljs/abc-notation", "_phantomChildren": {}, "_requested": { @@ -19,23 +19,23 @@ "_requiredBy": [ "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/abc-notation/-/abc-notation-3.5.4.tgz", - "_shasum": "b90568a0c7440cf0969b6e8d46ab2b403e6d9e27", + "_resolved": "https://registry.npmjs.org/@tonaljs/abc-notation/-/abc-notation-3.5.5.tgz", + "_shasum": "5132363eb4f40e8e230abb28397801c8a0f400fe", "_spec": "@tonaljs/abc-notation@^3.5.4", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/core": "^3.5.3" + "@tonaljs/core": "^3.5.4" }, "deprecated": false, "description": "Parse musical notes in abc notation", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "4af3763c34780d04b577f40367e267423a6e11dc", "keywords": [ "note", "abc", @@ -55,5 +55,5 @@ "build": "rollup -c=../../rollup.config.js" }, "types": "dist/index.d.ts", - "version": "3.5.4" + "version": "3.5.5" } diff --git a/mercury_ide/code/node_modules/@tonaljs/array/package.json b/mercury_ide/code/node_modules/@tonaljs/array/package.json index 5c2d2fa3..a587989d 100644 --- a/mercury_ide/code/node_modules/@tonaljs/array/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/array/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/array@^3.2.8", - "_id": "@tonaljs/array@3.2.8", + "_id": "@tonaljs/array@3.2.9", "_inBundle": false, - "_integrity": "sha512-c0q1ENeUPfWKtM7iqyZdd2z+HzcjN+EUQRrz4//t+JRWaUL4pHQh5eccIhXhPPtOppj8/CYQClFtJ+F4VOPMBQ==", + "_integrity": "sha512-eJTCGsHDy/9IHMN1qHdceaWTLH2okPXRlAlpycqPd0rCP5G7XL8hWO4eu9ck/oNFTw2CNGEbJQtl0iEpnm/oYw==", "_location": "/@tonaljs/array", "_phantomChildren": {}, "_requested": { @@ -19,23 +19,23 @@ "_requiredBy": [ "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/array/-/array-3.2.8.tgz", - "_shasum": "735ff3f3a7732f630a9ed33aa093679cb6426ec3", + "_resolved": "https://registry.npmjs.org/@tonaljs/array/-/array-3.2.9.tgz", + "_shasum": "2e71814d9d2662f35bb6719176a74f3d680e5f07", "_spec": "@tonaljs/array@^3.2.8", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/core": "^3.5.3" + "@tonaljs/core": "^3.5.4" }, "deprecated": false, "description": "Functions to work with arrays of tonal objects", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "4af3763c34780d04b577f40367e267423a6e11dc", "keywords": [ "array", "music", @@ -50,5 +50,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.2.8" + "version": "3.2.9" } diff --git a/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.es.js b/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.es.js index 87c4d425..10ce39c4 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.es.js +++ b/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.es.js @@ -1,8 +1,7 @@ -import { get } from '@tonaljs/chord-type'; +import { all } from '@tonaljs/chord-type'; import { note } from '@tonaljs/core'; import { modes } from '@tonaljs/pcset'; -const NotFound = { weight: 0, name: "" }; const namedSet = (notes) => { const pcToName = notes.reduce((record, n) => { const chroma = note(n).chroma; @@ -28,20 +27,26 @@ function findExactMatches(notes, weight) { const tonic = notes[0]; const tonicChroma = note(tonic).chroma; const noteName = namedSet(notes); + // we need to test all chormas to get the correct baseNote const allModes = modes(notes, false); - const found = allModes.map((mode, chroma) => { - const chordName = get(mode).aliases[0]; - if (!chordName) { - return NotFound; - } - const baseNote = noteName(chroma); - const isInversion = chroma !== tonicChroma; - if (isInversion) { - return { weight: 0.5 * weight, name: `${baseNote}${chordName}/${tonic}` }; - } - else { - return { weight: 1 * weight, name: `${baseNote}${chordName}` }; - } + const found = []; + allModes.forEach((mode, index) => { + // some chords could have the same chroma but different interval spelling + const chordTypes = all().filter((chordType) => chordType.chroma === mode); + chordTypes.forEach((chordType) => { + const chordName = chordType.aliases[0]; + const baseNote = noteName(index); + const isInversion = index !== tonicChroma; + if (isInversion) { + found.push({ + weight: 0.5 * weight, + name: `${baseNote}${chordName}/${tonic}`, + }); + } + else { + found.push({ weight: 1 * weight, name: `${baseNote}${chordName}` }); + } + }); }); return found; } diff --git a/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.es.js.map b/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.es.js.map index b8fc0c47..2ab467fa 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.es.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.es.js.map @@ -1 +1 @@ -{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.js b/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.js index cc68a79a..c2dd1add 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.js +++ b/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.js @@ -1,10 +1,9 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tonaljs/chord-type'), require('@tonaljs/core'), require('@tonaljs/pcset')) : typeof define === 'function' && define.amd ? define(['exports', '@tonaljs/chord-type', '@tonaljs/core', '@tonaljs/pcset'], factory) : - (global = global || self, factory(global.ChordDetect = {}, global.chordType, global.core, global.pcset)); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ChordDetect = {}, global.chordType, global.core, global.pcset)); }(this, (function (exports, chordType, core, pcset) { 'use strict'; - var NotFound = { weight: 0, name: "" }; var namedSet = function (notes) { var pcToName = notes.reduce(function (record, n) { var chroma = core.note(n).chroma; @@ -30,20 +29,26 @@ var tonic = notes[0]; var tonicChroma = core.note(tonic).chroma; var noteName = namedSet(notes); + // we need to test all chormas to get the correct baseNote var allModes = pcset.modes(notes, false); - var found = allModes.map(function (mode, chroma) { - var chordName = chordType.get(mode).aliases[0]; - if (!chordName) { - return NotFound; - } - var baseNote = noteName(chroma); - var isInversion = chroma !== tonicChroma; - if (isInversion) { - return { weight: 0.5 * weight, name: "" + baseNote + chordName + "/" + tonic }; - } - else { - return { weight: 1 * weight, name: "" + baseNote + chordName }; - } + var found = []; + allModes.forEach(function (mode, index) { + // some chords could have the same chroma but different interval spelling + var chordTypes = chordType.all().filter(function (chordType) { return chordType.chroma === mode; }); + chordTypes.forEach(function (chordType) { + var chordName = chordType.aliases[0]; + var baseNote = noteName(index); + var isInversion = index !== tonicChroma; + if (isInversion) { + found.push({ + weight: 0.5 * weight, + name: "" + baseNote + chordName + "/" + tonic, + }); + } + else { + found.push({ weight: 1 * weight, name: "" + baseNote + chordName }); + } + }); }); return found; } diff --git a/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.js.map b/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.js.map index 99fe8e46..f898597a 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/chord-detect/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/chord-detect/package.json b/mercury_ide/code/node_modules/@tonaljs/chord-detect/package.json index db7c49c1..1152d842 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord-detect/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/chord-detect/package.json @@ -1,43 +1,43 @@ { - "_from": "@tonaljs/chord-detect@^3.5.4", - "_id": "@tonaljs/chord-detect@3.5.4", + "_from": "@tonaljs/chord-detect@^3.6.1", + "_id": "@tonaljs/chord-detect@3.6.1", "_inBundle": false, - "_integrity": "sha512-+g00XJxt6kAHfX2Vb2r+f6RXEnZumkvAmEvKxHPPyMpjCC9lKfCnI6bRhQZwJMgdvuJbngGebuchHA8piAcw/Q==", + "_integrity": "sha512-VmWon+0t4d7gQ7aK2IXbut68j8GSKLX0zoLoGN2qNHRYqaCvr8KHyIm7UdcwYK1dicq7KKPN2ChMseScVM24Gw==", "_location": "/@tonaljs/chord-detect", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "@tonaljs/chord-detect@^3.5.4", + "raw": "@tonaljs/chord-detect@^3.6.1", "name": "@tonaljs/chord-detect", "escapedName": "@tonaljs%2fchord-detect", "scope": "@tonaljs", - "rawSpec": "^3.5.4", + "rawSpec": "^3.6.1", "saveSpec": null, - "fetchSpec": "^3.5.4" + "fetchSpec": "^3.6.1" }, "_requiredBy": [ "/@tonaljs/chord" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/chord-detect/-/chord-detect-3.5.4.tgz", - "_shasum": "0025fede11ad728ff043e85664f9cb0443156211", - "_spec": "@tonaljs/chord-detect@^3.5.4", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/chord", + "_resolved": "https://registry.npmjs.org/@tonaljs/chord-detect/-/chord-detect-3.6.1.tgz", + "_shasum": "3dc29890c4ccbd0359bd711efdc678212345c18f", + "_spec": "@tonaljs/chord-detect@^3.6.1", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/chord", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/chord-type": "^3.5.4", - "@tonaljs/core": "^3.5.3", - "@tonaljs/pcset": "^3.5.3" + "@tonaljs/chord-type": "^3.6.1", + "@tonaljs/core": "^3.5.4", + "@tonaljs/pcset": "^3.5.4" }, "deprecated": false, "description": "Detect chord name based on note names", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "f4c1218b87107144f8cfd42295aa2a9910079773", "keywords": [ "chord-detect", "music", @@ -52,5 +52,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.4" + "version": "3.6.1" } diff --git a/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.es.js b/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.es.js index 3b00cebe..e791a0e9 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.es.js +++ b/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.es.js @@ -9,27 +9,36 @@ import { get as get$1, EmptyPcset } from '@tonaljs/pcset'; */ const CHORDS = [ // ==Major== - ["1P 3M 5P", "major", "M "], - ["1P 3M 5P 7M", "major seventh", "maj7 Δ ma7 M7 Maj7"], - ["1P 3M 5P 7M 9M", "major ninth", "maj9 Δ9"], - ["1P 3M 5P 7M 9M 13M", "major thirteenth", "maj13 Maj13"], + ["1P 3M 5P", "major", "M ^ "], + ["1P 3M 5P 7M", "major seventh", "maj7 Δ ma7 M7 Maj7 ^7"], + ["1P 3M 5P 7M 9M", "major ninth", "maj9 Δ9 ^9"], + ["1P 3M 5P 7M 9M 13M", "major thirteenth", "maj13 Maj13 ^13"], ["1P 3M 5P 6M", "sixth", "6 add6 add13 M6"], - ["1P 3M 5P 6M 9M", "sixth/ninth", "6/9 69"], - ["1P 3M 5P 7M 11A", "lydian", "maj#4 Δ#4 Δ#11"], - ["1P 3M 6m 7M", "major seventh flat sixth", "M7b6"], + ["1P 3M 5P 6M 9M", "sixth/ninth", "6/9 69 M69"], + ["1P 3M 6m 7M", "major seventh flat sixth", "M7b6 ^7b6"], + [ + "1P 3M 5P 7M 11A", + "major seventh sharp eleventh", + "maj#4 Δ#4 Δ#11 M7#11 ^7#11 maj7#11", + ], // ==Minor== // '''Normal''' ["1P 3m 5P", "minor", "m min -"], ["1P 3m 5P 7m", "minor seventh", "m7 min7 mi7 -7"], - ["1P 3m 5P 7M", "minor/major seventh", "m/ma7 m/maj7 mM7 m/M7 -Δ7 mΔ"], - ["1P 3m 5P 6M", "minor sixth", "m6"], - ["1P 3m 5P 7m 9M", "minor ninth", "m9"], - ["1P 3m 5P 7m 9M 11P", "minor eleventh", "m11"], - ["1P 3m 5P 7m 9M 13M", "minor thirteenth", "m13"], + [ + "1P 3m 5P 7M", + "minor/major seventh", + "m/ma7 m/maj7 mM7 mMaj7 m/M7 -Δ7 mΔ -^7", + ], + ["1P 3m 5P 6M", "minor sixth", "m6 -6"], + ["1P 3m 5P 7m 9M", "minor ninth", "m9 -9"], + ["1P 3m 5P 7M 9M", "minor/major ninth", "mM9 mMaj9 -^9"], + ["1P 3m 5P 7m 9M 11P", "minor eleventh", "m11 -11"], + ["1P 3m 5P 7m 9M 13M", "minor thirteenth", "m13 -13"], // '''Diminished''' ["1P 3m 5d", "diminished", "dim ° o"], ["1P 3m 5d 7d", "diminished seventh", "dim7 °7 o7"], - ["1P 3m 5d 7m", "half-diminished", "m7b5 ø"], + ["1P 3m 5d 7m", "half-diminished", "m7b5 ø -7b5 h7 h"], // ==Dominant/Seventh== // '''Normal''' ["1P 3M 5P 7m", "dominant seventh", "7 dom"], @@ -41,38 +50,47 @@ const CHORDS = [ ["1P 3M 5P 7m 9A", "dominant sharp ninth", "7#9"], ["1P 3M 7m 9m", "altered", "alt7"], // '''Suspended''' - ["1P 4P 5P", "suspended fourth", "sus4"], + ["1P 4P 5P", "suspended fourth", "sus4 sus"], ["1P 2M 5P", "suspended second", "sus2"], - ["1P 4P 5P 7m", "suspended fourth seventh", "7sus4"], + ["1P 4P 5P 7m", "suspended fourth seventh", "7sus4 7sus"], ["1P 5P 7m 9M 11P", "eleventh", "11"], - ["1P 4P 5P 7m 9m", "suspended fourth flat ninth", "b9sus phryg"], + [ + "1P 4P 5P 7m 9m", + "suspended fourth flat ninth", + "b9sus phryg 7b9sus 7b9sus4", + ], // ==Other== ["1P 5P", "fifth", "5"], - ["1P 3M 5A", "augmented", "aug + +5"], - ["1P 3M 5A 7M", "augmented seventh", "maj7#5 maj7+5"], - ["1P 3M 5P 7M 9M 11A", "major sharp eleventh (lydian)", "maj9#11 Δ9#11"], + ["1P 3M 5A", "augmented", "aug + +5 ^#5"], + ["1P 3m 5A", "minor augmented", "m#5 -#5 m+"], + ["1P 3M 5A 7M", "augmented seventh", "maj7#5 maj7+5 +maj7 ^7#5"], + [ + "1P 3M 5P 7M 9M 11A", + "major sharp eleventh (lydian)", + "maj9#11 Δ9#11 ^9#11", + ], // ==Legacy== ["1P 2M 4P 5P", "", "sus24 sus4add9"], - ["1P 3M 13m", "", "Mb6"], ["1P 3M 5A 7M 9M", "", "maj9#5 Maj9#5"], - ["1P 3M 5A 7m", "", "7#5 +7 7aug aug7"], - ["1P 3M 5A 7m 9A", "", "7#5#9 7alt"], + ["1P 3M 5A 7m", "", "7#5 +7 7+ 7aug aug7"], + ["1P 3M 5A 7m 9A", "", "7#5#9 7#9#5 7alt"], ["1P 3M 5A 7m 9M", "", "9#5 9+"], ["1P 3M 5A 7m 9M 11A", "", "9#5#11"], - ["1P 3M 5A 7m 9m", "", "7#5b9"], + ["1P 3M 5A 7m 9m", "", "7#5b9 7b9#5"], ["1P 3M 5A 7m 9m 11A", "", "7#5b9#11"], ["1P 3M 5A 9A", "", "+add#9"], ["1P 3M 5A 9M", "", "M#5add9 +add9"], ["1P 3M 5P 6M 11A", "", "M6#11 M6b5 6#11 6b5"], ["1P 3M 5P 6M 7M 9M", "", "M7add13"], ["1P 3M 5P 6M 9M 11A", "", "69#11"], + ["1P 3m 5P 6M 9M", "", "m69 -69"], ["1P 3M 5P 6m 7m", "", "7b6"], ["1P 3M 5P 7M 9A 11A", "", "maj7#9#11"], ["1P 3M 5P 7M 9M 11A 13M", "", "M13#11 maj13#11 M13+4 M13#4"], ["1P 3M 5P 7M 9m", "", "M7b9"], ["1P 3M 5P 7m 11A 13m", "", "7#11b13 7b5b13"], ["1P 3M 5P 7m 13M", "", "7add6 67 7add13"], - ["1P 3M 5P 7m 9A 11A", "", "7#9#11 7b5#9"], + ["1P 3M 5P 7m 9A 11A", "", "7#9#11 7b5#9 7#9b5"], ["1P 3M 5P 7m 9A 11A 13M", "", "13#9#11"], ["1P 3M 5P 7m 9A 11A 13m", "", "7#9#11b13"], ["1P 3M 5P 7m 9A 13M", "", "13#9"], @@ -80,7 +98,7 @@ const CHORDS = [ ["1P 3M 5P 7m 9M 11A", "", "9#11 9+4 9#4"], ["1P 3M 5P 7m 9M 11A 13M", "", "13#11 13+4 13#4"], ["1P 3M 5P 7m 9M 11A 13m", "", "9#11b13 9b5b13"], - ["1P 3M 5P 7m 9m 11A", "", "7b9#11 7b5b9"], + ["1P 3M 5P 7m 9m 11A", "", "7b9#11 7b5b9 7b9b5"], ["1P 3M 5P 7m 9m 11A 13M", "", "13b9#11"], ["1P 3M 5P 7m 9m 11A 13m", "", "7b9b13#11 7b9#11b13 7b5b9b13"], ["1P 3M 5P 7m 9m 13M", "", "13b9"], @@ -100,11 +118,8 @@ const CHORDS = [ ["1P 3M 7m 9M 13M", "", "13no5"], ["1P 3M 7m 9M 13m", "", "9b13"], ["1P 3m 4P 5P", "", "madd4"], - ["1P 3m 5A", "", "m#5 m+ mb6"], - ["1P 3m 5P 6M 9M", "", "m69"], ["1P 3m 5P 6m 7M", "", "mMaj7b6"], ["1P 3m 5P 6m 7M 9M", "", "mMaj9b6"], - ["1P 3m 5P 7M 9M", "", "mMaj9"], ["1P 3m 5P 7m 11P", "", "m7add11 m7add4"], ["1P 3m 5P 9M", "", "madd9"], ["1P 3m 5d 6M 7M", "", "o7M7"], diff --git a/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.es.js.map b/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.es.js.map index 13eeb599..ed22e22f 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.es.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.es.js.map @@ -1 +1 @@ -{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.js b/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.js index 34ffda15..cecde0e4 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.js +++ b/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.js @@ -1,22 +1,22 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tonaljs/core'), require('@tonaljs/pcset')) : typeof define === 'function' && define.amd ? define(['exports', '@tonaljs/core', '@tonaljs/pcset'], factory) : - (global = global || self, factory(global.ChordType = {}, global.core, global.pcset)); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ChordType = {}, global.core, global.pcset)); }(this, (function (exports, core, pcset) { 'use strict'; /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 + Copyright (c) Microsoft Corporation. - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var __assign = function() { @@ -38,27 +38,36 @@ */ var CHORDS = [ // ==Major== - ["1P 3M 5P", "major", "M "], - ["1P 3M 5P 7M", "major seventh", "maj7 Δ ma7 M7 Maj7"], - ["1P 3M 5P 7M 9M", "major ninth", "maj9 Δ9"], - ["1P 3M 5P 7M 9M 13M", "major thirteenth", "maj13 Maj13"], + ["1P 3M 5P", "major", "M ^ "], + ["1P 3M 5P 7M", "major seventh", "maj7 Δ ma7 M7 Maj7 ^7"], + ["1P 3M 5P 7M 9M", "major ninth", "maj9 Δ9 ^9"], + ["1P 3M 5P 7M 9M 13M", "major thirteenth", "maj13 Maj13 ^13"], ["1P 3M 5P 6M", "sixth", "6 add6 add13 M6"], - ["1P 3M 5P 6M 9M", "sixth/ninth", "6/9 69"], - ["1P 3M 5P 7M 11A", "lydian", "maj#4 Δ#4 Δ#11"], - ["1P 3M 6m 7M", "major seventh flat sixth", "M7b6"], + ["1P 3M 5P 6M 9M", "sixth/ninth", "6/9 69 M69"], + ["1P 3M 6m 7M", "major seventh flat sixth", "M7b6 ^7b6"], + [ + "1P 3M 5P 7M 11A", + "major seventh sharp eleventh", + "maj#4 Δ#4 Δ#11 M7#11 ^7#11 maj7#11", + ], // ==Minor== // '''Normal''' ["1P 3m 5P", "minor", "m min -"], ["1P 3m 5P 7m", "minor seventh", "m7 min7 mi7 -7"], - ["1P 3m 5P 7M", "minor/major seventh", "m/ma7 m/maj7 mM7 m/M7 -Δ7 mΔ"], - ["1P 3m 5P 6M", "minor sixth", "m6"], - ["1P 3m 5P 7m 9M", "minor ninth", "m9"], - ["1P 3m 5P 7m 9M 11P", "minor eleventh", "m11"], - ["1P 3m 5P 7m 9M 13M", "minor thirteenth", "m13"], + [ + "1P 3m 5P 7M", + "minor/major seventh", + "m/ma7 m/maj7 mM7 mMaj7 m/M7 -Δ7 mΔ -^7", + ], + ["1P 3m 5P 6M", "minor sixth", "m6 -6"], + ["1P 3m 5P 7m 9M", "minor ninth", "m9 -9"], + ["1P 3m 5P 7M 9M", "minor/major ninth", "mM9 mMaj9 -^9"], + ["1P 3m 5P 7m 9M 11P", "minor eleventh", "m11 -11"], + ["1P 3m 5P 7m 9M 13M", "minor thirteenth", "m13 -13"], // '''Diminished''' ["1P 3m 5d", "diminished", "dim ° o"], ["1P 3m 5d 7d", "diminished seventh", "dim7 °7 o7"], - ["1P 3m 5d 7m", "half-diminished", "m7b5 ø"], + ["1P 3m 5d 7m", "half-diminished", "m7b5 ø -7b5 h7 h"], // ==Dominant/Seventh== // '''Normal''' ["1P 3M 5P 7m", "dominant seventh", "7 dom"], @@ -70,38 +79,47 @@ ["1P 3M 5P 7m 9A", "dominant sharp ninth", "7#9"], ["1P 3M 7m 9m", "altered", "alt7"], // '''Suspended''' - ["1P 4P 5P", "suspended fourth", "sus4"], + ["1P 4P 5P", "suspended fourth", "sus4 sus"], ["1P 2M 5P", "suspended second", "sus2"], - ["1P 4P 5P 7m", "suspended fourth seventh", "7sus4"], + ["1P 4P 5P 7m", "suspended fourth seventh", "7sus4 7sus"], ["1P 5P 7m 9M 11P", "eleventh", "11"], - ["1P 4P 5P 7m 9m", "suspended fourth flat ninth", "b9sus phryg"], + [ + "1P 4P 5P 7m 9m", + "suspended fourth flat ninth", + "b9sus phryg 7b9sus 7b9sus4", + ], // ==Other== ["1P 5P", "fifth", "5"], - ["1P 3M 5A", "augmented", "aug + +5"], - ["1P 3M 5A 7M", "augmented seventh", "maj7#5 maj7+5"], - ["1P 3M 5P 7M 9M 11A", "major sharp eleventh (lydian)", "maj9#11 Δ9#11"], + ["1P 3M 5A", "augmented", "aug + +5 ^#5"], + ["1P 3m 5A", "minor augmented", "m#5 -#5 m+"], + ["1P 3M 5A 7M", "augmented seventh", "maj7#5 maj7+5 +maj7 ^7#5"], + [ + "1P 3M 5P 7M 9M 11A", + "major sharp eleventh (lydian)", + "maj9#11 Δ9#11 ^9#11", + ], // ==Legacy== ["1P 2M 4P 5P", "", "sus24 sus4add9"], - ["1P 3M 13m", "", "Mb6"], ["1P 3M 5A 7M 9M", "", "maj9#5 Maj9#5"], - ["1P 3M 5A 7m", "", "7#5 +7 7aug aug7"], - ["1P 3M 5A 7m 9A", "", "7#5#9 7alt"], + ["1P 3M 5A 7m", "", "7#5 +7 7+ 7aug aug7"], + ["1P 3M 5A 7m 9A", "", "7#5#9 7#9#5 7alt"], ["1P 3M 5A 7m 9M", "", "9#5 9+"], ["1P 3M 5A 7m 9M 11A", "", "9#5#11"], - ["1P 3M 5A 7m 9m", "", "7#5b9"], + ["1P 3M 5A 7m 9m", "", "7#5b9 7b9#5"], ["1P 3M 5A 7m 9m 11A", "", "7#5b9#11"], ["1P 3M 5A 9A", "", "+add#9"], ["1P 3M 5A 9M", "", "M#5add9 +add9"], ["1P 3M 5P 6M 11A", "", "M6#11 M6b5 6#11 6b5"], ["1P 3M 5P 6M 7M 9M", "", "M7add13"], ["1P 3M 5P 6M 9M 11A", "", "69#11"], + ["1P 3m 5P 6M 9M", "", "m69 -69"], ["1P 3M 5P 6m 7m", "", "7b6"], ["1P 3M 5P 7M 9A 11A", "", "maj7#9#11"], ["1P 3M 5P 7M 9M 11A 13M", "", "M13#11 maj13#11 M13+4 M13#4"], ["1P 3M 5P 7M 9m", "", "M7b9"], ["1P 3M 5P 7m 11A 13m", "", "7#11b13 7b5b13"], ["1P 3M 5P 7m 13M", "", "7add6 67 7add13"], - ["1P 3M 5P 7m 9A 11A", "", "7#9#11 7b5#9"], + ["1P 3M 5P 7m 9A 11A", "", "7#9#11 7b5#9 7#9b5"], ["1P 3M 5P 7m 9A 11A 13M", "", "13#9#11"], ["1P 3M 5P 7m 9A 11A 13m", "", "7#9#11b13"], ["1P 3M 5P 7m 9A 13M", "", "13#9"], @@ -109,7 +127,7 @@ ["1P 3M 5P 7m 9M 11A", "", "9#11 9+4 9#4"], ["1P 3M 5P 7m 9M 11A 13M", "", "13#11 13+4 13#4"], ["1P 3M 5P 7m 9M 11A 13m", "", "9#11b13 9b5b13"], - ["1P 3M 5P 7m 9m 11A", "", "7b9#11 7b5b9"], + ["1P 3M 5P 7m 9m 11A", "", "7b9#11 7b5b9 7b9b5"], ["1P 3M 5P 7m 9m 11A 13M", "", "13b9#11"], ["1P 3M 5P 7m 9m 11A 13m", "", "7b9b13#11 7b9#11b13 7b5b9b13"], ["1P 3M 5P 7m 9m 13M", "", "13b9"], @@ -129,11 +147,8 @@ ["1P 3M 7m 9M 13M", "", "13no5"], ["1P 3M 7m 9M 13m", "", "9b13"], ["1P 3m 4P 5P", "", "madd4"], - ["1P 3m 5A", "", "m#5 m+ mb6"], - ["1P 3m 5P 6M 9M", "", "m69"], ["1P 3m 5P 6m 7M", "", "mMaj7b6"], ["1P 3m 5P 6m 7M 9M", "", "mMaj9b6"], - ["1P 3m 5P 7M 9M", "", "mMaj9"], ["1P 3m 5P 7m 11P", "", "m7add11 m7add4"], ["1P 3m 5P 9M", "", "madd9"], ["1P 3m 5d 6M 7M", "", "o7M7"], diff --git a/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.js.map b/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.js.map index a80aa930..62c29e7b 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/chord-type/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/chord-type/package.json b/mercury_ide/code/node_modules/@tonaljs/chord-type/package.json index 4b5467e2..16659f5f 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord-type/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/chord-type/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/chord-type@^3.5.4", - "_id": "@tonaljs/chord-type@3.5.4", + "_id": "@tonaljs/chord-type@3.6.1", "_inBundle": false, - "_integrity": "sha512-Y6/HPfhNzc1UgB/QlLUuha4/vi65dAJdiA3NlUFOgU+V2lZqZw+pf49VPHvGMj0JE0nG3xLBYzfux39ZwtBfWg==", + "_integrity": "sha512-mR18zyMut+M6ZBp8tgCLOhatbAsVLcp2wmY4Km4p6/ffqDjgvOz5EGSDw1IOdlT3KJRrWcAKHIh/k01GTPiVVg==", "_location": "/@tonaljs/chord-type", "_phantomChildren": {}, "_requested": { @@ -22,24 +22,24 @@ "/@tonaljs/scale", "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/chord-type/-/chord-type-3.5.4.tgz", - "_shasum": "c96dfe511c4800f5227bf4c661d79d79ad13edca", + "_resolved": "https://registry.npmjs.org/@tonaljs/chord-type/-/chord-type-3.6.1.tgz", + "_shasum": "f50f1c1a8689b795635b9b54e05184dbf204dfc4", "_spec": "@tonaljs/chord-type@^3.5.4", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/core": "^3.5.3", - "@tonaljs/pcset": "^3.5.3" + "@tonaljs/core": "^3.5.4", + "@tonaljs/pcset": "^3.5.4" }, "deprecated": false, "description": "A dictionary of musical chords", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "f4c1218b87107144f8cfd42295aa2a9910079773", "keywords": [ "chord", "dictionary", @@ -55,6 +55,9 @@ "publishConfig": { "access": "public" }, + "scripts": { + "build": "rollup -c=../../rollup.config.js" + }, "types": "dist/index.d.ts", - "version": "3.5.4" + "version": "3.6.1" } diff --git a/mercury_ide/code/node_modules/@tonaljs/chord/README.md b/mercury_ide/code/node_modules/@tonaljs/chord/README.md index 08738411..4ec26dea 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord/README.md +++ b/mercury_ide/code/node_modules/@tonaljs/chord/README.md @@ -43,9 +43,9 @@ Chord.getChord("maj7", "G4", "B4"); // => // type: "major seventh", // aliases: ["maj7", "Δ", "ma7", "M7", "Maj7"], // chroma: "100010010001", -// intervals: ["1P", "3M", "5P", "7M"], +// intervals: ["3M", "5P", "7M", "8P"], // normalized: "100010010001", -// notes: ["G4", "B4", "D5", "F#5"], +// notes: ["B4", "D5", "F#5", "G5"], // quality: "Major", // } ``` diff --git a/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.d.ts b/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.d.ts index 934f4c3f..a4903dee 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.d.ts +++ b/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.d.ts @@ -4,7 +4,7 @@ import { NoteName } from "@tonaljs/core"; export { detect } from "@tonaljs/chord-detect"; declare type ChordName = string; declare type ChordNameTokens = [string, string]; -interface Chord extends ChordType { +export interface Chord extends ChordType { tonic: string | null; type: string; root: string; diff --git a/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.es.js b/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.es.js index d2fd3103..68308e12 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.es.js +++ b/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.es.js @@ -97,18 +97,27 @@ function getChord(typeName, optionalTonic, optionalRoot) { if (!root.empty && !rootDegree) { return NoChord; } + const intervals = Array.from(type.intervals); + for (let i = 1; i < rootDegree; i++) { + const num = intervals[0][0]; + const quality = intervals[0][1]; + const newNum = parseInt(num, 10) + 7; + intervals.push(`${newNum}${quality}`); + intervals.shift(); + } const notes = tonic.empty ? [] - : type.intervals.map((i) => transpose$1(tonic, i)); + : intervals.map((i) => transpose$1(tonic, i)); typeName = type.aliases.indexOf(typeName) !== -1 ? typeName : type.aliases[0]; - const symbol = `${tonic.empty ? "" : tonic.pc}${typeName}${root.empty ? "" : "/" + root.pc}`; - const name = `${optionalTonic ? tonic.pc + " " : ""}${type.name}${optionalRoot ? " over " + root.pc : ""}`; + const symbol = `${tonic.empty ? "" : tonic.pc}${typeName}${root.empty || rootDegree <= 1 ? "" : "/" + root.pc}`; + const name = `${optionalTonic ? tonic.pc + " " : ""}${type.name}${rootDegree > 1 && optionalRoot ? " over " + root.pc : ""}`; return { ...type, name, symbol, type: type.name, root: root.name, + intervals, rootDegree, tonic: tonic.name, notes, @@ -127,7 +136,7 @@ const chord = deprecate("Chord.chord", "Chord.get", get); function transpose(chordName, interval) { const [tonic, type] = tokenize(chordName); if (!tonic) { - return name; + return chordName; } return transpose$1(tonic, interval) + type; } diff --git a/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.es.js.map b/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.es.js.map index 0f1703be..cf55dfa1 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.es.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.es.js.map @@ -1 +1 @@ -{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.js b/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.js index d8a60814..656cb0df 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.js +++ b/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.js @@ -1,22 +1,22 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tonaljs/chord-detect'), require('@tonaljs/chord-type'), require('@tonaljs/core'), require('@tonaljs/pcset'), require('@tonaljs/scale-type')) : typeof define === 'function' && define.amd ? define(['exports', '@tonaljs/chord-detect', '@tonaljs/chord-type', '@tonaljs/core', '@tonaljs/pcset', '@tonaljs/scale-type'], factory) : - (global = global || self, factory(global.Chord = {}, global.chordDetect, global.chordType, global.core, global.pcset, global.scaleType)); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Chord = {}, global.chordDetect, global.chordType, global.core, global.pcset, global.scaleType)); }(this, (function (exports, chordDetect, chordType, core, pcset, scaleType) { 'use strict'; /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 + Copyright (c) Microsoft Corporation. - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var __assign = function() { @@ -122,14 +122,23 @@ if (!root.empty && !rootDegree) { return NoChord; } + var intervals = Array.from(type.intervals); + for (var i = 1; i < rootDegree; i++) { + var num = intervals[0][0]; + var quality = intervals[0][1]; + var newNum = parseInt(num, 10) + 7; + intervals.push("" + newNum + quality); + intervals.shift(); + } var notes = tonic.empty ? [] - : type.intervals.map(function (i) { return core.transpose(tonic, i); }); + : intervals.map(function (i) { return core.transpose(tonic, i); }); typeName = type.aliases.indexOf(typeName) !== -1 ? typeName : type.aliases[0]; - var symbol = "" + (tonic.empty ? "" : tonic.pc) + typeName + (root.empty ? "" : "/" + root.pc); - var name = "" + (optionalTonic ? tonic.pc + " " : "") + type.name + (optionalRoot ? " over " + root.pc : ""); + var symbol = "" + (tonic.empty ? "" : tonic.pc) + typeName + (root.empty || rootDegree <= 1 ? "" : "/" + root.pc); + var name = "" + (optionalTonic ? tonic.pc + " " : "") + type.name + (rootDegree > 1 && optionalRoot ? " over " + root.pc : ""); return __assign(__assign({}, type), { name: name, - symbol: symbol, type: type.name, root: root.name, rootDegree: rootDegree, tonic: tonic.name, notes: notes }); + symbol: symbol, type: type.name, root: root.name, intervals: intervals, + rootDegree: rootDegree, tonic: tonic.name, notes: notes }); } var chord = core.deprecate("Chord.chord", "Chord.get", get); /** @@ -144,7 +153,7 @@ function transpose(chordName, interval) { var _a = tokenize(chordName), tonic = _a[0], type = _a[1]; if (!tonic) { - return name; + return chordName; } return core.transpose(tonic, interval) + type; } diff --git a/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.js.map b/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.js.map index 8f12c102..34adf28a 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/chord/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/chord/package.json b/mercury_ide/code/node_modules/@tonaljs/chord/package.json index 935c2b95..b6b91e88 100644 --- a/mercury_ide/code/node_modules/@tonaljs/chord/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/chord/package.json @@ -1,47 +1,47 @@ { - "_from": "@tonaljs/chord@^3.6.3", - "_id": "@tonaljs/chord@3.6.3", + "_from": "@tonaljs/chord@^3.6.4", + "_id": "@tonaljs/chord@3.8.1", "_inBundle": false, - "_integrity": "sha512-bj7dBHLNLZ1zk2T/imkb8fjYtcYOeiP4ln9Z3QSD0AAWFy8JOPZfs1rsbUVjlhTKYEiZMG0kVKtrk7IEhz/Isw==", + "_integrity": "sha512-nDB6ydW1efrm8v2CFuutUfONxFQ7X1jSllg+uUIeUP5CqzhCNgNJEZ/xGlaszhsVdFZqbzpkLoG8y+RdprUuBQ==", "_location": "/@tonaljs/chord", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "@tonaljs/chord@^3.6.3", + "raw": "@tonaljs/chord@^3.6.4", "name": "@tonaljs/chord", "escapedName": "@tonaljs%2fchord", "scope": "@tonaljs", - "rawSpec": "^3.6.3", + "rawSpec": "^3.6.4", "saveSpec": null, - "fetchSpec": "^3.6.3" + "fetchSpec": "^3.6.4" }, "_requiredBy": [ "/@tonaljs/progression", "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/chord/-/chord-3.6.3.tgz", - "_shasum": "c8e386b4af81aae758e5e457968f741377d9d080", - "_spec": "@tonaljs/chord@^3.6.3", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_resolved": "https://registry.npmjs.org/@tonaljs/chord/-/chord-3.8.1.tgz", + "_shasum": "968ee26cd7bc673e0e5d4a0dcfb7e1125538a41e", + "_spec": "@tonaljs/chord@^3.6.4", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/chord-detect": "^3.5.4", - "@tonaljs/chord-type": "^3.5.4", + "@tonaljs/chord-detect": "^3.6.1", + "@tonaljs/chord-type": "^3.6.1", "@tonaljs/collection": "^3.5.3", - "@tonaljs/core": "^3.5.3", - "@tonaljs/pcset": "^3.5.3", - "@tonaljs/scale-type": "^3.5.4" + "@tonaljs/core": "^3.5.4", + "@tonaljs/pcset": "^3.5.4", + "@tonaljs/scale-type": "^3.6.0" }, "deprecated": false, "description": "Musical chords and its relations", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "f4c1218b87107144f8cfd42295aa2a9910079773", "keywords": [ "chord", "chords", @@ -57,5 +57,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.6.3" + "version": "3.8.1" } diff --git a/mercury_ide/code/node_modules/@tonaljs/core/dist/index.es.js b/mercury_ide/code/node_modules/@tonaljs/core/dist/index.es.js index 9951786a..48b0e916 100644 --- a/mercury_ide/code/node_modules/@tonaljs/core/dist/index.es.js +++ b/mercury_ide/code/node_modules/@tonaljs/core/dist/index.es.js @@ -100,6 +100,7 @@ function tokenizeNote(str) { function coordToNote(noteCoord) { return note(decode(noteCoord)); } +const mod = (n, m) => ((n % m) + m) % m; const SEMI = [0, 2, 4, 5, 7, 9, 11]; function parse(noteName) { const tokens = tokenizeNote(noteName); @@ -116,8 +117,9 @@ function parse(noteName) { const name = letter + acc + octStr; const pc = letter + acc; const chroma = (SEMI[step] + alt + 120) % 12; - const o = oct === undefined ? -100 : oct; - const height = SEMI[step] + alt + 12 * (o + 1); + const height = oct === undefined + ? mod(SEMI[step] + alt, 12) - 12 * 99 + : SEMI[step] + alt + 12 * (oct + 1); const midi = height >= 0 && height <= 127 ? height : null; const freq = oct === undefined ? null : Math.pow(2, (height - 69) / 12) * 440; return { diff --git a/mercury_ide/code/node_modules/@tonaljs/core/dist/index.es.js.map b/mercury_ide/code/node_modules/@tonaljs/core/dist/index.es.js.map index 226db8fa..d2edcf80 100644 --- a/mercury_ide/code/node_modules/@tonaljs/core/dist/index.es.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/core/dist/index.es.js.map @@ -1 +1 @@ -{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/core/dist/index.js b/mercury_ide/code/node_modules/@tonaljs/core/dist/index.js index d5a8a16c..873177d5 100644 --- a/mercury_ide/code/node_modules/@tonaljs/core/dist/index.js +++ b/mercury_ide/code/node_modules/@tonaljs/core/dist/index.js @@ -116,6 +116,7 @@ function coordToNote(noteCoord) { return note(decode(noteCoord)); } + var mod = function (n, m) { return ((n % m) + m) % m; }; var SEMI = [0, 2, 4, 5, 7, 9, 11]; function parse(noteName) { var tokens = tokenizeNote(noteName); @@ -132,8 +133,9 @@ var name = letter + acc + octStr; var pc = letter + acc; var chroma = (SEMI[step] + alt + 120) % 12; - var o = oct === undefined ? -100 : oct; - var height = SEMI[step] + alt + 12 * (o + 1); + var height = oct === undefined + ? mod(SEMI[step] + alt, 12) - 12 * 99 + : SEMI[step] + alt + 12 * (oct + 1); var midi = height >= 0 && height <= 127 ? height : null; var freq = oct === undefined ? null : Math.pow(2, (height - 69) / 12) * 440; return { diff --git a/mercury_ide/code/node_modules/@tonaljs/core/dist/index.js.map b/mercury_ide/code/node_modules/@tonaljs/core/dist/index.js.map index 17eadd0a..49e0f3f8 100644 --- a/mercury_ide/code/node_modules/@tonaljs/core/dist/index.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/core/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/core/package.json b/mercury_ide/code/node_modules/@tonaljs/core/package.json index 56f385d0..ffef1a17 100644 --- a/mercury_ide/code/node_modules/@tonaljs/core/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/core/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/core@^3.5.3", - "_id": "@tonaljs/core@3.5.3", + "_id": "@tonaljs/core@3.5.4", "_inBundle": false, - "_integrity": "sha512-FekC8POq8tEJnMlBy93xfvjhb9/OPgdc7x6zw2DmZVJHDBZDseZoDEAPm+L5dHUbnBwJAEM/ZMmv2Csq7sFdhw==", + "_integrity": "sha512-Rhe7TKNmkOb9/Ilu1ByCI7jIEc0hztGbfHMtI7N5sIdAXVaVzz0WaZdEuPKnAYibS8IRsT5Jm3B/oAEy5CdQAQ==", "_location": "/@tonaljs/core", "_phantomChildren": {}, "_requested": { @@ -34,10 +34,10 @@ "/@tonaljs/scale-type", "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/core/-/core-3.5.3.tgz", - "_shasum": "ff279659884a3918b4ee522395e6ca3bad40001c", + "_resolved": "https://registry.npmjs.org/@tonaljs/core/-/core-3.5.4.tgz", + "_shasum": "ceb6c13cac0413ef6b3bee2a59e03d3e460f74c6", "_spec": "@tonaljs/core@^3.5.3", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, @@ -47,7 +47,7 @@ "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "4af3763c34780d04b577f40367e267423a6e11dc", "keywords": [ "music", "theory" @@ -63,5 +63,5 @@ "build": "rollup -c=../../rollup.config.js" }, "types": "dist/index.d.ts", - "version": "3.5.3" + "version": "3.5.4" } diff --git a/mercury_ide/code/node_modules/@tonaljs/interval/dist/index.d.ts b/mercury_ide/code/node_modules/@tonaljs/interval/dist/index.d.ts index 5f4d64ef..45301e02 100644 --- a/mercury_ide/code/node_modules/@tonaljs/interval/dist/index.d.ts +++ b/mercury_ide/code/node_modules/@tonaljs/interval/dist/index.d.ts @@ -99,7 +99,7 @@ export declare const distance: typeof dist; * @example * Interval.add("3m", "5P") // => "7m" */ -export declare const add: (a: string, b: string) => string | undefined; +export declare const add: (a: IntervalName, b: IntervalName) => IntervalName | undefined; /** * Returns a function that adds an interval * @@ -119,7 +119,7 @@ export declare const addTo: (interval: string) => (other: string) => string | un * Interval.substract('5P', '3M') // => '3m' * Interval.substract('3M', '5P') // => '-3m' */ -export declare const substract: (a: string, b: string) => string | undefined; +export declare const substract: (a: IntervalName, b: IntervalName) => IntervalName | undefined; declare const _default: { names: typeof names; get: typeof props; diff --git a/mercury_ide/code/node_modules/@tonaljs/interval/package.json b/mercury_ide/code/node_modules/@tonaljs/interval/package.json index 4d06cf6e..b84b8bb4 100644 --- a/mercury_ide/code/node_modules/@tonaljs/interval/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/interval/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/interval@^3.5.3", - "_id": "@tonaljs/interval@3.5.3", + "_id": "@tonaljs/interval@3.5.4", "_inBundle": false, - "_integrity": "sha512-N5nn+vqrea1k6ERfcbBwp30rduC05x/NLwEN5W0F25u4NNzf4G5gkDgsnHjnqpYzckeidDVrzISgMmQ88ycJpA==", + "_integrity": "sha512-cgbTL3SNpzRMXkFh93y3Qy4IXmZOGF12we1E6u4swzR1H1D3OsQrEugPoYzOhiIax3Q+mZ9vm9mgk/KWzCIhww==", "_location": "/@tonaljs/interval", "_phantomChildren": {}, "_requested": { @@ -19,23 +19,23 @@ "_requiredBy": [ "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/interval/-/interval-3.5.3.tgz", - "_shasum": "875053fa941c234b657ce0cd970263eb67c879a9", + "_resolved": "https://registry.npmjs.org/@tonaljs/interval/-/interval-3.5.4.tgz", + "_shasum": "79283b50d22141878730610a5143a771df85b317", "_spec": "@tonaljs/interval@^3.5.3", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/core": "^3.5.3" + "@tonaljs/core": "^3.5.4" }, "deprecated": false, "description": "Parse and manipulate music intervals", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "4af3763c34780d04b577f40367e267423a6e11dc", "keywords": [ "interval", "music", @@ -50,5 +50,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.3" + "version": "3.5.4" } diff --git a/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.es.js b/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.es.js index 2ab08211..02c4531e 100644 --- a/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.es.js +++ b/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.es.js @@ -76,6 +76,8 @@ const FLATS = "C Db D Eb E F Gb G Ab A Bb B".split(" "); * midiToNoteName(61.7) // => "D4" */ function midiToNoteName(midi, options = {}) { + if (isNaN(midi) || midi === -Infinity || midi === Infinity) + return ""; midi = Math.round(midi); const pcs = options.sharps === true ? SHARPS : FLATS; const pc = pcs[midi % 12]; diff --git a/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.es.js.map b/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.es.js.map index 0fc9e05d..ad031cc2 100644 --- a/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.es.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.es.js.map @@ -1 +1 @@ -{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.js b/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.js index 99e75961..701e35d5 100644 --- a/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.js +++ b/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.js @@ -82,6 +82,8 @@ */ function midiToNoteName(midi, options) { if (options === void 0) { options = {}; } + if (isNaN(midi) || midi === -Infinity || midi === Infinity) + return ""; midi = Math.round(midi); var pcs = options.sharps === true ? SHARPS : FLATS; var pc = pcs[midi % 12]; diff --git a/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.js.map b/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.js.map index 8c10632f..12d870b5 100644 --- a/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/midi/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/midi/package.json b/mercury_ide/code/node_modules/@tonaljs/midi/package.json index f331bcbe..3119bdb6 100644 --- a/mercury_ide/code/node_modules/@tonaljs/midi/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/midi/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/midi@^3.5.3", - "_id": "@tonaljs/midi@3.5.3", + "_id": "@tonaljs/midi@3.5.4", "_inBundle": false, - "_integrity": "sha512-xc/MwuNOS90F5DCcjrxcMyHcCXnq6wmPyE/CubPm+6Deemqn+5OEnzvUQujDnW/+O//Gk4+ROIPPvWq1ifSV5w==", + "_integrity": "sha512-Xtunz9cVWTI5hJ9OjGXYWwlbJwcrof/IsmshvYmZXQGOhtVY2PPhY3JSKfAVN+CLFOraEjVJ4/YEGoFutF+yJA==", "_location": "/@tonaljs/midi", "_phantomChildren": {}, "_requested": { @@ -21,23 +21,23 @@ "/@tonaljs/range", "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/midi/-/midi-3.5.3.tgz", - "_shasum": "0b5c15bce7a259d5d29e5e29335e3a419898f56a", + "_resolved": "https://registry.npmjs.org/@tonaljs/midi/-/midi-3.5.4.tgz", + "_shasum": "9bd5a68367069419377a338fe19eea64e230ba8d", "_spec": "@tonaljs/midi@^3.5.3", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/core": "^3.5.3" + "@tonaljs/core": "^3.5.4" }, "deprecated": false, "description": "Functions to work with midi numbers", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "4af3763c34780d04b577f40367e267423a6e11dc", "keywords": [ "note", "midi", @@ -53,5 +53,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.3" + "version": "3.5.4" } diff --git a/mercury_ide/code/node_modules/@tonaljs/mode/dist/index.js b/mercury_ide/code/node_modules/@tonaljs/mode/dist/index.js index a3ab81b2..b87281fb 100644 --- a/mercury_ide/code/node_modules/@tonaljs/mode/dist/index.js +++ b/mercury_ide/code/node_modules/@tonaljs/mode/dist/index.js @@ -5,18 +5,18 @@ }(this, (function (exports, core, pcset) { 'use strict'; /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 + Copyright (c) Microsoft Corporation. - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var __assign = function() { diff --git a/mercury_ide/code/node_modules/@tonaljs/mode/package.json b/mercury_ide/code/node_modules/@tonaljs/mode/package.json index cbb9155b..29aabd65 100644 --- a/mercury_ide/code/node_modules/@tonaljs/mode/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/mode/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/mode@^3.5.3", - "_id": "@tonaljs/mode@3.5.3", + "_id": "@tonaljs/mode@3.5.4", "_inBundle": false, - "_integrity": "sha512-sJfHA0kKewPj3DRi7Jw7FSyPk4Cm6awno2E59RXuPq+isIpf1sLH9bN1JlvI+xGYkWv15N4RLdr8NeFRHDoYeQ==", + "_integrity": "sha512-iu3aFh62UPeNNrgGNLm/lvURx2L83E2+u78ESDjO86kYgSbkFKuK7D8MHynFSwFUmQCfw4+aOq9gHByuv5lz5A==", "_location": "/@tonaljs/mode", "_phantomChildren": {}, "_requested": { @@ -19,24 +19,24 @@ "_requiredBy": [ "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/mode/-/mode-3.5.3.tgz", - "_shasum": "c31fb28cff4aa3bd8afeb4f1754a2d6dbf507e82", + "_resolved": "https://registry.npmjs.org/@tonaljs/mode/-/mode-3.5.4.tgz", + "_shasum": "8cdc1fed7221a986dac4c9dc64660e001da66d59", "_spec": "@tonaljs/mode@^3.5.3", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/core": "^3.5.3", - "@tonaljs/pcset": "^3.5.3" + "@tonaljs/core": "^3.5.4", + "@tonaljs/pcset": "^3.5.4" }, "deprecated": false, "description": "Functions to work with musical modes", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "4af3763c34780d04b577f40367e267423a6e11dc", "keywords": [ "mode", "music", @@ -51,5 +51,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.3" + "version": "3.5.4" } diff --git a/mercury_ide/code/node_modules/@tonaljs/note/README.md b/mercury_ide/code/node_modules/@tonaljs/note/README.md index f6e586b4..461dcecb 100644 --- a/mercury_ide/code/node_modules/@tonaljs/note/README.md +++ b/mercury_ide/code/node_modules/@tonaljs/note/README.md @@ -69,6 +69,26 @@ There's also a `Note.fromMidiSharps` version: Note.fromMidiSharps(61); // => "C#4" ``` +#### `Note.fromFreq(freq: number) => string` + +Given a frequency in Hz, returns the note name. + +```js +Note.fromFreq(440); // => "A4" +``` + +It rounds to the nearest name: + +```js +[440, 550, 660].map(t.Note.fromFreq); // => [ 'A4', 'Db5', 'E5' ] +``` + +There's also a `Note.fromFreqSharps` version: + +```js +[440, 550, 660].map(t.Note.fromFreqSharps); // => [ 'A4', 'C#5', 'E5' ] +``` + ### Transposition and distances #### `transpose(note: string, interval: string) => string` @@ -102,9 +122,9 @@ Transpose a note a given number of fifths: Note.transposeFifths("G4", 3); // => "E6" Note.transposeFifths("G", 3); // => "E" -[0, 1, 2, 3, 4, 5, 6].map(n => transposeFifths("F#", n)); +[0, 1, 2, 3, 4, 5, 6].map((n) => transposeFifths("F#", n)); // => ["F#", "C#", "G#", "D#", "A#", "E#", "B#"] -[0, -1, -2, -3, -4, -5, -6].map(n => transposeFifths("Bb", n)); +[0, -1, -2, -3, -4, -5, -6].map((n) => transposeFifths("Bb", n)); // => ["Bb", "Eb", "Ab", "Db", "Gb", "Cb", "Fb"] ``` diff --git a/mercury_ide/code/node_modules/@tonaljs/note/dist/index.d.ts b/mercury_ide/code/node_modules/@tonaljs/note/dist/index.d.ts index 0a6c8fd5..6ace1502 100644 --- a/mercury_ide/code/node_modules/@tonaljs/note/dist/index.d.ts +++ b/mercury_ide/code/node_modules/@tonaljs/note/dist/index.d.ts @@ -1,4 +1,4 @@ -import { Note, note as props, NoteLiteral, NoteName, Pitch, transpose as _tr } from "@tonaljs/core"; +import { IntervalName, Note, note as props, NoteLiteral, NoteName, Pitch, transpose as _tr } from "@tonaljs/core"; /** * Return the natural note names without octave * @function @@ -60,6 +60,14 @@ export declare const chroma: (note: NoteLiteral) => number | undefined; * Note.fromMidi(61.7) // => "D4" */ export declare function fromMidi(midi: number): string; +/** + * Given a midi number, returns a note name. Uses flats for altered notes. + */ +export declare function fromFreq(freq: number): string; +/** + * Given a midi number, returns a note name. Uses flats for altered notes. + */ +export declare function fromFreqSharps(freq: number): string; /** * Given a midi number, returns a note name. Uses flats for altered notes. * @@ -84,8 +92,8 @@ export declare const tr: typeof _tr; * ["C", "D", "E"].map(Note.transposeBy("5P")); * // => ["G", "A", "B"] */ -export declare const transposeBy: (interval: string) => (note: string) => string; -export declare const trBy: (interval: string) => (note: string) => string; +export declare const transposeBy: (interval: IntervalName) => (note: NoteName) => string; +export declare const trBy: (interval: IntervalName) => (note: NoteName) => string; /** * Transpose from a note * @function @@ -94,8 +102,8 @@ export declare const trBy: (interval: string) => (note: string) => string; * ["1P", "3M", "5P"].map(Note.transposeFrom("C")); * // => ["C", "E", "G"] */ -export declare const transposeFrom: (note: string) => (interval: string) => string; -export declare const trFrom: (note: string) => (interval: string) => string; +export declare const transposeFrom: (note: NoteName) => (interval: IntervalName) => string; +export declare const trFrom: (note: NoteName) => (interval: IntervalName) => string; /** * Transpose a note by a number of perfect fifths. * @@ -129,7 +137,7 @@ export declare function sortedUniqNames(notes: any[]): string[]; * simplify("C###") * simplify("B#4") // => "C5" */ -export declare const simplify: (noteName: string | Pitch) => string; +export declare const simplify: (noteName: NoteName | Pitch) => string; /** * Get enharmonic of a note * @@ -140,7 +148,7 @@ export declare const simplify: (noteName: string | Pitch) => string; * Note.enharmonic("Db") // => "C#" * Note.enharmonic("C") // => "C" */ -export declare const enharmonic: (noteName: string | Pitch) => string; +export declare const enharmonic: (noteName: NoteName | Pitch) => string; declare const _default: { names: typeof names; get: typeof props; @@ -156,6 +164,8 @@ declare const _default: { fromMidi: typeof fromMidi; fromMidiSharps: typeof fromMidiSharps; freq: (note: NoteLiteral) => number | null | undefined; + fromFreq: typeof fromFreq; + fromFreqSharps: typeof fromFreqSharps; chroma: (note: NoteLiteral) => number | undefined; transpose: typeof _tr; tr: typeof _tr; diff --git a/mercury_ide/code/node_modules/@tonaljs/note/dist/index.es.js b/mercury_ide/code/node_modules/@tonaljs/note/dist/index.es.js index 4b8fc305..dfacfe28 100644 --- a/mercury_ide/code/node_modules/@tonaljs/note/dist/index.es.js +++ b/mercury_ide/code/node_modules/@tonaljs/note/dist/index.es.js @@ -1,5 +1,5 @@ import { note, transpose as transpose$1, coordToNote } from '@tonaljs/core'; -import { midiToNoteName } from '@tonaljs/midi'; +import { midiToNoteName, freqToMidi } from '@tonaljs/midi'; const NAMES = ["C", "D", "E", "F", "G", "A", "B"]; const toName = (n) => n.name; @@ -77,6 +77,18 @@ const chroma = (note) => get(note).chroma; function fromMidi(midi) { return midiToNoteName(midi); } +/** + * Given a midi number, returns a note name. Uses flats for altered notes. + */ +function fromFreq(freq) { + return midiToNoteName(freqToMidi(freq)); +} +/** + * Given a midi number, returns a note name. Uses flats for altered notes. + */ +function fromFreqSharps(freq) { + return midiToNoteName(freqToMidi(freq), { sharps: true }); +} /** * Given a midi number, returns a note name. Uses flats for altered notes. * @@ -200,6 +212,8 @@ var index = { fromMidi, fromMidiSharps, freq, + fromFreq, + fromFreqSharps, chroma, transpose, tr, @@ -214,5 +228,5 @@ var index = { }; export default index; -export { accidentals, ascending, chroma, descending, enharmonic, freq, fromMidi, fromMidiSharps, get, midi, name, names, octave, pitchClass, simplify, sortedNames, sortedUniqNames, tr, trBy, trFifths, trFrom, transpose, transposeBy, transposeFifths, transposeFrom }; +export { accidentals, ascending, chroma, descending, enharmonic, freq, fromFreq, fromFreqSharps, fromMidi, fromMidiSharps, get, midi, name, names, octave, pitchClass, simplify, sortedNames, sortedUniqNames, tr, trBy, trFifths, trFrom, transpose, transposeBy, transposeFifths, transposeFrom }; //# sourceMappingURL=index.es.js.map diff --git a/mercury_ide/code/node_modules/@tonaljs/note/dist/index.es.js.map b/mercury_ide/code/node_modules/@tonaljs/note/dist/index.es.js.map index b431e39f..e8b47c3f 100644 --- a/mercury_ide/code/node_modules/@tonaljs/note/dist/index.es.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/note/dist/index.es.js.map @@ -1 +1 @@ -{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/note/dist/index.js b/mercury_ide/code/node_modules/@tonaljs/note/dist/index.js index 48823d60..cd8b0853 100644 --- a/mercury_ide/code/node_modules/@tonaljs/note/dist/index.js +++ b/mercury_ide/code/node_modules/@tonaljs/note/dist/index.js @@ -82,6 +82,18 @@ function fromMidi(midi) { return midi$1.midiToNoteName(midi); } + /** + * Given a midi number, returns a note name. Uses flats for altered notes. + */ + function fromFreq(freq) { + return midi$1.midiToNoteName(midi$1.freqToMidi(freq)); + } + /** + * Given a midi number, returns a note name. Uses flats for altered notes. + */ + function fromFreqSharps(freq) { + return midi$1.midiToNoteName(midi$1.freqToMidi(freq), { sharps: true }); + } /** * Given a midi number, returns a note name. Uses flats for altered notes. * @@ -209,6 +221,8 @@ fromMidi: fromMidi, fromMidiSharps: fromMidiSharps, freq: freq, + fromFreq: fromFreq, + fromFreqSharps: fromFreqSharps, chroma: chroma, transpose: transpose, tr: tr, @@ -229,6 +243,8 @@ exports.descending = descending; exports.enharmonic = enharmonic; exports.freq = freq; + exports.fromFreq = fromFreq; + exports.fromFreqSharps = fromFreqSharps; exports.fromMidi = fromMidi; exports.fromMidiSharps = fromMidiSharps; exports.get = get; diff --git a/mercury_ide/code/node_modules/@tonaljs/note/dist/index.js.map b/mercury_ide/code/node_modules/@tonaljs/note/dist/index.js.map index 3d44a762..68d25b41 100644 --- a/mercury_ide/code/node_modules/@tonaljs/note/dist/index.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/note/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/note/package.json b/mercury_ide/code/node_modules/@tonaljs/note/package.json index 0f726667..8c2ba73d 100644 --- a/mercury_ide/code/node_modules/@tonaljs/note/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/note/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/note@^3.5.3", - "_id": "@tonaljs/note@3.5.3", + "_id": "@tonaljs/note@3.6.0", "_inBundle": false, - "_integrity": "sha512-UPOHFrVHwtJQMllM66RDG4sH6d3OP7X5H7eJVzclEhRjb1OGqz2HVSLjZw8C3LMr2kgRoICge+wOaYrOUfMBQw==", + "_integrity": "sha512-riwAjPdQBa01uhCl0h+3vc0M3VW/NS982pg3k2ntKYiC8YsSRu0tR7yDtUbOWwMjaj8loAk68Snmm44mutiIdQ==", "_location": "/@tonaljs/note", "_phantomChildren": {}, "_requested": { @@ -21,24 +21,24 @@ "/@tonaljs/scale", "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/note/-/note-3.5.3.tgz", - "_shasum": "dd4637e2ec486f1efb6cad8b1efa08d3a0eb15d4", + "_resolved": "https://registry.npmjs.org/@tonaljs/note/-/note-3.6.0.tgz", + "_shasum": "a1dd02a7900a081abaed9bba8aab3f02c04c4c7c", "_spec": "@tonaljs/note@^3.5.3", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/core": "^3.5.3", - "@tonaljs/midi": "^3.5.3" + "@tonaljs/core": "^3.5.4", + "@tonaljs/midi": "^3.5.4" }, "deprecated": false, "description": "Parse and manipulate music notes in scientific notation", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "4af3763c34780d04b577f40367e267423a6e11dc", "keywords": [ "note", "music", @@ -53,5 +53,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.3" + "version": "3.6.0" } diff --git a/mercury_ide/code/node_modules/@tonaljs/pcset/dist/index.d.ts b/mercury_ide/code/node_modules/@tonaljs/pcset/dist/index.d.ts index fcc463aa..72006dbd 100644 --- a/mercury_ide/code/node_modules/@tonaljs/pcset/dist/index.d.ts +++ b/mercury_ide/code/node_modules/@tonaljs/pcset/dist/index.d.ts @@ -97,7 +97,7 @@ export declare function isEqual(s1: Set, s2: Set): boolean; * inCMajor(["e6", "c4"]) // => true * inCMajor(["e6", "c4", "d3"]) // => false */ -export declare function isSubsetOf(set: Set): (notes: string | number | Pcset | Partial | string[] | string[]) => boolean | 0; +export declare function isSubsetOf(set: Set): (notes: Set | Pcset) => boolean | 0; /** * Create a function that test if a collection of notes is a * superset of a given set (it contains all notes and at least one more) @@ -125,7 +125,7 @@ export declare function isSupersetOf(set: Set): (notes: Set) => boolean | 0; * isNoteInCMajor('C4') // => true * isNoteInCMajor('C#4') // => false */ -export declare function isNoteIncludedIn(set: Set): (noteName: string) => boolean; +export declare function isNoteIncludedIn(set: Set): (noteName: NoteName) => boolean; /** @deprecated use: isNoteIncludedIn */ export declare const includes: typeof isNoteIncludedIn; /** @@ -139,7 +139,7 @@ export declare const includes: typeof isNoteIncludedIn; * Pcset.filter(["C", "D", "E"], ["c2", "c#2", "d2", "c3", "c#3", "d3"]) // => [ "c2", "d2", "c3", "d3" ]) * Pcset.filter(["C2"], ["c2", "c#2", "d2", "c3", "c#3", "d3"]) // => [ "c2", "c3" ]) */ -export declare function filter(set: Set): (notes: string[]) => string[]; +export declare function filter(set: Set): (notes: NoteName[]) => string[]; declare const _default: { get: typeof get; chroma: (set: Set) => string; diff --git a/mercury_ide/code/node_modules/@tonaljs/pcset/package.json b/mercury_ide/code/node_modules/@tonaljs/pcset/package.json index 9cac115b..d68f9af4 100644 --- a/mercury_ide/code/node_modules/@tonaljs/pcset/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/pcset/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/pcset@^3.5.3", - "_id": "@tonaljs/pcset@3.5.3", + "_id": "@tonaljs/pcset@3.5.4", "_inBundle": false, - "_integrity": "sha512-DOqgF+WLZijXMX1hNycmlGFsOOrYC6bjAHAFvlVjjG+3+qMOwPscIFla4xW+CMcI4VKdfWW5mlUEsbWsPsdTUQ==", + "_integrity": "sha512-RaB1KJoq5ZhXuDEWPlf1NWi1Cwa67yUr43usDhw/abvvIyZAkEJ1jyg4Yiks29ua7zBeQSyrEU+leuKxFBTGcQ==", "_location": "/@tonaljs/pcset", "_phantomChildren": {}, "_requested": { @@ -25,24 +25,24 @@ "/@tonaljs/scale-type", "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/pcset/-/pcset-3.5.3.tgz", - "_shasum": "c41203a7e7700057146c17be39044694a81c9888", + "_resolved": "https://registry.npmjs.org/@tonaljs/pcset/-/pcset-3.5.4.tgz", + "_shasum": "dd4bfe9fe0dc03fa6822473c708e3b60e84a9f09", "_spec": "@tonaljs/pcset@^3.5.3", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { "@tonaljs/collection": "^3.5.3", - "@tonaljs/core": "^3.5.3" + "@tonaljs/core": "^3.5.4" }, "deprecated": false, "description": "Functions to work with midi numbers", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "4af3763c34780d04b577f40367e267423a6e11dc", "keywords": [ "note", "midi", @@ -58,5 +58,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.3" + "version": "3.5.4" } diff --git a/mercury_ide/code/node_modules/@tonaljs/progression/dist/index.js b/mercury_ide/code/node_modules/@tonaljs/progression/dist/index.js index a38defd1..fc246261 100644 --- a/mercury_ide/code/node_modules/@tonaljs/progression/dist/index.js +++ b/mercury_ide/code/node_modules/@tonaljs/progression/dist/index.js @@ -1,7 +1,7 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tonaljs/chord'), require('@tonaljs/core'), require('@tonaljs/roman-numeral')) : typeof define === 'function' && define.amd ? define(['exports', '@tonaljs/chord', '@tonaljs/core', '@tonaljs/roman-numeral'], factory) : - (global = global || self, factory(global.Progression = {}, global.chord, global.core, global.romanNumeral)); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Progression = {}, global.chord, global.core, global.romanNumeral)); }(this, (function (exports, chord, core, romanNumeral) { 'use strict'; /** diff --git a/mercury_ide/code/node_modules/@tonaljs/progression/package.json b/mercury_ide/code/node_modules/@tonaljs/progression/package.json index 200b8c92..600a2635 100644 --- a/mercury_ide/code/node_modules/@tonaljs/progression/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/progression/package.json @@ -1,43 +1,43 @@ { - "_from": "@tonaljs/progression@^3.5.5", - "_id": "@tonaljs/progression@3.5.5", + "_from": "@tonaljs/progression@^3.5.6", + "_id": "@tonaljs/progression@3.6.2", "_inBundle": false, - "_integrity": "sha512-eNPTFpl02SskExyEF9YF69joQOi0zbwu6+WdGpBiOQRRNJmmkiExvEvSopQQuJLZAVghHVqA+vJJfwjVs9ZG9w==", + "_integrity": "sha512-fVHHKVp1VreMMIHLcnBiGOEj44KtRQ/3/f9nYMp9ljYDscnTgPaDPO+m3GpRDHuiOq6jb37jfSDCkAYsM3hKHA==", "_location": "/@tonaljs/progression", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "@tonaljs/progression@^3.5.5", + "raw": "@tonaljs/progression@^3.5.6", "name": "@tonaljs/progression", "escapedName": "@tonaljs%2fprogression", "scope": "@tonaljs", - "rawSpec": "^3.5.5", + "rawSpec": "^3.5.6", "saveSpec": null, - "fetchSpec": "^3.5.5" + "fetchSpec": "^3.5.6" }, "_requiredBy": [ "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/progression/-/progression-3.5.5.tgz", - "_shasum": "bad61bde6ad4d8a45ddb811b0bbf23c02fb85ed2", - "_spec": "@tonaljs/progression@^3.5.5", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_resolved": "https://registry.npmjs.org/@tonaljs/progression/-/progression-3.6.2.tgz", + "_shasum": "f8d8751f20c271483612fdbe5beceaaa91f3bc5f", + "_spec": "@tonaljs/progression@^3.5.6", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/chord": "^3.6.3", - "@tonaljs/core": "^3.5.3", - "@tonaljs/roman-numeral": "^3.5.3" + "@tonaljs/chord": "^3.8.1", + "@tonaljs/core": "^3.5.4", + "@tonaljs/roman-numeral": "^3.5.4" }, "deprecated": false, "description": "Build musical chord progressions", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "f4c1218b87107144f8cfd42295aa2a9910079773", "keywords": [ "chord", "progression", @@ -53,5 +53,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.5" + "version": "3.6.2" } diff --git a/mercury_ide/code/node_modules/@tonaljs/range/package.json b/mercury_ide/code/node_modules/@tonaljs/range/package.json index 37ec2f6f..a1b2908b 100644 --- a/mercury_ide/code/node_modules/@tonaljs/range/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/range/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/range@^3.5.3", - "_id": "@tonaljs/range@3.5.3", + "_id": "@tonaljs/range@3.5.4", "_inBundle": false, - "_integrity": "sha512-isMgF4OKKOajy1UoqYQUXhMZUWVUX7/1aTl3XNp21AJZ5wcESxxUj/UUCBLNEI0pqq6M30AxIiGaUBIHdMbyFg==", + "_integrity": "sha512-02sujp3/dulwZYKb/NJ5zrkoQwigNVg7ChQoAcKhEzPCaYFRAy1eaI+W375DVdoNgpshxy8MOyArdN1gP60nJA==", "_location": "/@tonaljs/range", "_phantomChildren": {}, "_requested": { @@ -19,24 +19,24 @@ "_requiredBy": [ "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/range/-/range-3.5.3.tgz", - "_shasum": "1306f62ecaf10198fe577c9d5c929edf130d1f04", + "_resolved": "https://registry.npmjs.org/@tonaljs/range/-/range-3.5.4.tgz", + "_shasum": "8e9b4a442f40d16576a0fa0bc9cdd552cfe1bc93", "_spec": "@tonaljs/range@^3.5.3", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { "@tonaljs/collection": "^3.5.3", - "@tonaljs/midi": "^3.5.3" + "@tonaljs/midi": "^3.5.4" }, "deprecated": false, "description": "Create (musical) note ranges", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "4af3763c34780d04b577f40367e267423a6e11dc", "keywords": [ "range", "music", @@ -51,5 +51,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.3" + "version": "3.5.4" } diff --git a/mercury_ide/code/node_modules/@tonaljs/roman-numeral/package.json b/mercury_ide/code/node_modules/@tonaljs/roman-numeral/package.json index 8d2fd1eb..875160bc 100644 --- a/mercury_ide/code/node_modules/@tonaljs/roman-numeral/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/roman-numeral/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/roman-numeral@^3.5.3", - "_id": "@tonaljs/roman-numeral@3.5.3", + "_id": "@tonaljs/roman-numeral@3.5.4", "_inBundle": false, - "_integrity": "sha512-lRsjo2Y95+pPGGpbS/SO22bns6revimiDq4EvNGZhJc4ey6JoOTck+Yd0GVnAxwiObgSSYoGk5Em4QXbxkpC7w==", + "_integrity": "sha512-jwN8lTZb0nernJZ45piKsh0E8GeA4Xiq2XR03NpL7oS9KMHyZkHx4Otripiqvfns0aVgvDP4Da6c7FEhPY8zJA==", "_location": "/@tonaljs/roman-numeral", "_phantomChildren": {}, "_requested": { @@ -21,23 +21,23 @@ "/@tonaljs/progression", "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/roman-numeral/-/roman-numeral-3.5.3.tgz", - "_shasum": "b8d8b82c163afed812635f98579b480ef7a004d3", + "_resolved": "https://registry.npmjs.org/@tonaljs/roman-numeral/-/roman-numeral-3.5.4.tgz", + "_shasum": "381cff039729a187cabce0125aac96f768e20ab7", "_spec": "@tonaljs/roman-numeral@^3.5.3", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/core": "^3.5.3" + "@tonaljs/core": "^3.5.4" }, "deprecated": false, "description": "Parse and properties of roman numeral strings", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "4af3763c34780d04b577f40367e267423a6e11dc", "keywords": [ "roman-numeral", "music", @@ -53,5 +53,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.3" + "version": "3.5.4" } diff --git a/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.es.js b/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.es.js index bd842fc0..87315f0c 100644 --- a/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.es.js +++ b/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.es.js @@ -47,7 +47,7 @@ const SCALES = [ ["1P 2m 3M 4A 5P 6m 7M", "double harmonic lydian"], ["1P 2M 3m 4P 5P 6m 7M", "harmonic minor"], [ - "1P 2m 3m 3M 5d 6m 7m", + "1P 2m 3m 4d 5d 6m 7m", "altered", "super locrian", "diminished whole tone", @@ -121,7 +121,12 @@ const SCALES = [ ["1P 2M 3m 4P 5d 6m 6M 7M", "diminished", "whole-half diminished"], ["1P 2M 3M 4P 5d 5P 6M 7M", "ichikosucho"], ["1P 2M 3m 4P 5P 6m 6M 7M", "minor six diminished"], - ["1P 2m 3m 3M 4A 5P 6M 7m", "half-whole diminished", "dominant diminished", "messiaen's mode #2"], + [ + "1P 2m 3m 3M 4A 5P 6M 7m", + "half-whole diminished", + "dominant diminished", + "messiaen's mode #2", + ], ["1P 3m 3M 4P 5P 6M 7m 7M", "kafi raga"], ["1P 2M 3M 4P 4A 5A 6A 7M", "messiaen's mode #6"], // 9-note scales diff --git a/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.es.js.map b/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.es.js.map index 73208933..c9059591 100644 --- a/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.es.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.es.js.map @@ -1 +1 @@ -{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.js b/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.js index 6f7d1378..87b8cfce 100644 --- a/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.js +++ b/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.js @@ -5,18 +5,18 @@ }(this, (function (exports, core, pcset) { 'use strict'; /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 + Copyright (c) Microsoft Corporation. - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var __assign = function() { @@ -76,7 +76,7 @@ ["1P 2m 3M 4A 5P 6m 7M", "double harmonic lydian"], ["1P 2M 3m 4P 5P 6m 7M", "harmonic minor"], [ - "1P 2m 3m 3M 5d 6m 7m", + "1P 2m 3m 4d 5d 6m 7m", "altered", "super locrian", "diminished whole tone", @@ -150,7 +150,12 @@ ["1P 2M 3m 4P 5d 6m 6M 7M", "diminished", "whole-half diminished"], ["1P 2M 3M 4P 5d 5P 6M 7M", "ichikosucho"], ["1P 2M 3m 4P 5P 6m 6M 7M", "minor six diminished"], - ["1P 2m 3m 3M 4A 5P 6M 7m", "half-whole diminished", "dominant diminished", "messiaen's mode #2"], + [ + "1P 2m 3m 3M 4A 5P 6M 7m", + "half-whole diminished", + "dominant diminished", + "messiaen's mode #2", + ], ["1P 3m 3M 4P 5P 6M 7m 7M", "kafi raga"], ["1P 2M 3M 4P 4A 5A 6A 7M", "messiaen's mode #6"], // 9-note scales diff --git a/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.js.map b/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.js.map index 458a8cfa..b50d4c86 100644 --- a/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/scale-type/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/scale-type/package.json b/mercury_ide/code/node_modules/@tonaljs/scale-type/package.json index a88077cc..c816b27f 100644 --- a/mercury_ide/code/node_modules/@tonaljs/scale-type/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/scale-type/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/scale-type@^3.5.4", - "_id": "@tonaljs/scale-type@3.5.4", + "_id": "@tonaljs/scale-type@3.6.0", "_inBundle": false, - "_integrity": "sha512-XLE2RqRlVl+wD8hgd9iKkzYArxrS60422bS0azSY/lLKC+N3Fcg7lncfW5NkbZ4srDs5Dt+qsYmlfvOrYzDOmw==", + "_integrity": "sha512-AN5C33Q1l3pgkBxLZ9gQIz98aG8dQ6iJx/FNvIqdzAR0BPtkIJk8z2lrKeDkSSKPPkykUuycroloJaRp5FuOpw==", "_location": "/@tonaljs/scale-type", "_phantomChildren": {}, "_requested": { @@ -21,24 +21,24 @@ "/@tonaljs/scale", "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/scale-type/-/scale-type-3.5.4.tgz", - "_shasum": "4d9e239231a26937430fa9d609c54e22a36549c0", + "_resolved": "https://registry.npmjs.org/@tonaljs/scale-type/-/scale-type-3.6.0.tgz", + "_shasum": "31421b235510d2c6d74edb66cd1acce8dafaa584", "_spec": "@tonaljs/scale-type@^3.5.4", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/core": "^3.5.3", - "@tonaljs/pcset": "^3.5.3" + "@tonaljs/core": "^3.5.4", + "@tonaljs/pcset": "^3.5.4" }, "deprecated": false, "description": "A dictionary of musical scales", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "a834ce0c104a88273bcf928dc80132206738cb73", "keywords": [ "scale", "dictionary", @@ -54,5 +54,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.4" + "version": "3.6.0" } diff --git a/mercury_ide/code/node_modules/@tonaljs/scale/dist/index.js b/mercury_ide/code/node_modules/@tonaljs/scale/dist/index.js index 4c51cd7c..f1ae2235 100644 --- a/mercury_ide/code/node_modules/@tonaljs/scale/dist/index.js +++ b/mercury_ide/code/node_modules/@tonaljs/scale/dist/index.js @@ -1,22 +1,22 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tonaljs/chord-type'), require('@tonaljs/collection'), require('@tonaljs/core'), require('@tonaljs/note'), require('@tonaljs/pcset'), require('@tonaljs/scale-type')) : typeof define === 'function' && define.amd ? define(['exports', '@tonaljs/chord-type', '@tonaljs/collection', '@tonaljs/core', '@tonaljs/note', '@tonaljs/pcset', '@tonaljs/scale-type'], factory) : - (global = global || self, factory(global.Scale = {}, global.chordType, global.collection, global.core, global.note, global.pcset, global.scaleType)); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Scale = {}, global.chordType, global.collection, global.core, global.note, global.pcset, global.scaleType)); }(this, (function (exports, chordType, collection, core, note, pcset, scaleType) { 'use strict'; /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 + Copyright (c) Microsoft Corporation. - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var __assign = function() { diff --git a/mercury_ide/code/node_modules/@tonaljs/scale/package.json b/mercury_ide/code/node_modules/@tonaljs/scale/package.json index 150de974..55c93c5b 100644 --- a/mercury_ide/code/node_modules/@tonaljs/scale/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/scale/package.json @@ -1,8 +1,8 @@ { "_from": "@tonaljs/scale@^3.5.5", - "_id": "@tonaljs/scale@3.5.5", + "_id": "@tonaljs/scale@3.6.1", "_inBundle": false, - "_integrity": "sha512-QwFZcRB7vHdD2foK9fcMZfbVPioOZdPi7zhSgVayXlzxIqiqgy1itbS/VS3rUtINuLGH01vlXzKrH84+9YxZRQ==", + "_integrity": "sha512-qwSblxPb75lbwgeyS+BzNw8sIp7+MUg3wlDhTc65RQyCZUpgcp9sKjyol0udXjhYkotq9QiH1X5UpAnky5KKJg==", "_location": "/@tonaljs/scale", "_phantomChildren": {}, "_requested": { @@ -19,28 +19,28 @@ "_requiredBy": [ "/@tonaljs/tonal" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/scale/-/scale-3.5.5.tgz", - "_shasum": "e745b489e31f125ce8f0396285b53839ef5ba783", + "_resolved": "https://registry.npmjs.org/@tonaljs/scale/-/scale-3.6.1.tgz", + "_shasum": "75765d502b09330cea0e060422d8f49bbb944847", "_spec": "@tonaljs/scale@^3.5.5", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@tonaljs/tonal", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@tonaljs/tonal", "author": { "name": "danigb@gmail.com" }, "bundleDependencies": false, "dependencies": { - "@tonaljs/chord-type": "^3.5.4", + "@tonaljs/chord-type": "^3.6.1", "@tonaljs/collection": "^3.5.3", - "@tonaljs/core": "^3.5.3", - "@tonaljs/note": "^3.5.3", - "@tonaljs/pcset": "^3.5.3", - "@tonaljs/scale-type": "^3.5.4" + "@tonaljs/core": "^3.5.4", + "@tonaljs/note": "^3.6.0", + "@tonaljs/pcset": "^3.5.4", + "@tonaljs/scale-type": "^3.6.0" }, "deprecated": false, "description": "Musical scales and its relations", "files": [ "dist" ], - "gitHead": "a02257a15167ad854a091fa27b8429d1d0fb00c3", + "gitHead": "f4c1218b87107144f8cfd42295aa2a9910079773", "keywords": [ "scale", "scales", @@ -56,5 +56,5 @@ "access": "public" }, "types": "dist/index.d.ts", - "version": "3.5.5" + "version": "3.6.1" } diff --git a/mercury_ide/code/node_modules/@tonaljs/tonal/browser/tonal.min.js b/mercury_ide/code/node_modules/@tonaljs/tonal/browser/tonal.min.js index 4891b714..12572efd 100644 --- a/mercury_ide/code/node_modules/@tonaljs/tonal/browser/tonal.min.js +++ b/mercury_ide/code/node_modules/@tonaljs/tonal/browser/tonal.min.js @@ -1,2 +1,2 @@ -var Tonal=function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;const t=(t,n)=>Array(Math.abs(n)+1).join(t);function n(t,n,e){return function(...o){return console.warn(`${t} is deprecated. Use ${n}.`),e.apply(this,o)}}function e(t){return null!==t&&"object"==typeof t&&"string"==typeof t.name}function o(t){return null!==t&&"object"==typeof t&&"number"==typeof t.step&&"number"==typeof t.alt}const r=[0,2,4,-1,1,3,5],a=r.map(t=>Math.floor(7*t/12));function m(t){const{step:n,alt:e,oct:o,dir:m=1}=t,i=r[n]+7*e;return void 0===o?[m*i]:[m*i,m*(o-a[n]-4*e)]}const i=[3,0,4,1,5,2,6];function c(t){const[n,e,o]=t,r=i[function(t){const n=(t+1)%7;return n<0?7+n:n}(n)],m=Math.floor((n+1)/7);return void 0===e?{step:r,alt:m,dir:o}:{step:r,alt:m,oct:e+4*m+a[r],dir:o}}const s={empty:!0,name:"",pc:"",acc:""},u=new Map,l=t=>"CDEFGAB".charAt(t),P=n=>n<0?t("b",-n):t("#",n),d=t=>"b"===t[0]?-t.length:t.length;function M(t){const n=u.get(t);if(n)return n;const r="string"==typeof t?function(t){const n=f(t);if(""===n[0]||""!==n[3])return s;const e=n[0],o=n[1],r=n[2],a=(e.charCodeAt(0)+3)%7,i=d(o),c=r.length?+r:void 0,u=m({step:a,alt:i,oct:c}),l=e+o+r,P=e+o,M=(y[a]+i+120)%12,p=void 0===c?-100:c,h=y[a]+i+12*(p+1),b=h>=0&&h<=127?h:null,g=void 0===c?null:440*Math.pow(2,(h-69)/12);return{empty:!1,acc:o,alt:i,chroma:M,coord:u,freq:g,height:h,letter:e,midi:b,name:l,oct:c,pc:P,step:a}}(t):o(t)?M(function(t){const{step:n,alt:e,oct:o}=t,r=l(n);if(!r)return"";const a=r+P(e);return o||0===o?a+o:a}(t)):e(t)?M(t.name):s;return u.set(t,r),r}const p=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/;function f(t){const n=p.exec(t);return[n[1].toUpperCase(),n[2].replace(/x/g,"##"),n[3],n[4]]}function h(t){return M(c(t))}const y=[0,2,4,5,7,9,11];const b={empty:!0,name:"",acc:""},g=new RegExp("^([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})|(AA|A|P|M|m|d|dd)([-+]?\\d+)$");function A(t){const n=g.exec(`${t}`);return null===n?["",""]:n[1]?[n[1],n[2]]:[n[4],n[3]]}const v={};function j(n){return"string"==typeof n?v[n]||(v[n]=function(t){const n=A(t);if(""===n[0])return b;const e=+n[0],o=n[1],r=(Math.abs(e)-1)%7,a="PMMPPMM"[r];if("M"===a&&"P"===o)return b;const i="M"===a?"majorable":"perfectable",c=""+e+o,s=e<0?-1:1,u=8===e||-8===e?e:s*(r+1),l=function(t,n){return"M"===n&&"majorable"===t||"P"===n&&"perfectable"===t?0:"m"===n&&"majorable"===t?-1:/^A+$/.test(n)?n.length:/^d+$/.test(n)?-1*("perfectable"===t?n.length:n.length+1):0}(i,o),P=Math.floor((Math.abs(e)-1)/7),d=s*(I[r]+l+12*P),M=(s*(I[r]+l)%12+12)%12,p=m({step:r,alt:l,oct:P,dir:s});return{empty:!1,name:c,num:e,q:o,step:r,alt:l,dir:s,type:i,simple:u,semitones:d,chroma:M,coord:p,oct:P}}(n)):o(n)?j(function(n){const{step:e,alt:o,oct:r=0,dir:a}=n;if(!a)return"";return(a<0?"-":"")+(e+1+7*r)+function(n,e){return 0===e?"majorable"===n?"M":"P":-1===e&&"majorable"===n?"m":e>0?t("A",e):t("d","perfectable"===n?e:e+1)}("M"==="PMMPPMM"[e]?"majorable":"perfectable",o)}(n)):e(n)?j(n.name):b}const I=[0,2,4,5,7,9,11];function w(t){const[n,e=0]=t;return j(c(7*n+12*e<0?[-n,-e,-1]:[n,e,1]))}function N(t,n){const e=M(t),o=j(n);if(e.empty||o.empty)return"";const r=e.coord,a=o.coord;return h(1===r.length?[r[0]+a[0]]:[r[0]+a[0],r[1]+a[1]]).name}function O(t,n){const e=M(t),o=M(n);if(e.empty||o.empty)return"";const r=e.coord,a=o.coord,m=a[0]-r[0];return w([m,2===r.length&&2===a.length?a[1]-r[1]:-Math.floor(7*m/12)]).name}var x=Object.freeze({__proto__:null,accToAlt:d,altToAcc:P,coordToInterval:w,coordToNote:h,decode:c,deprecate:n,distance:O,encode:m,fillStr:t,interval:j,isNamed:e,isPitch:o,note:M,stepToLetter:l,tokenizeInterval:A,tokenizeNote:f,transpose:N});const T=(t,n)=>Array(n+1).join(t),D=/^(_{1,}|=|\^{1,}|)([abcdefgABCDEFG])([,']*)$/;function V(t){const n=D.exec(t);return n?[n[1],n[2],n[3]]:["","",""]}function S(t){const[n,e,o]=V(t);if(""===e)return"";let r=4;for(let t=0;t96?e.toUpperCase()+a+(r+1):e+a+r}function C(t){const n=M(t);if(n.empty||!n.oct)return"";const{letter:e,acc:o,oct:r}=n;return("b"===o[0]?o.replace(/b/g,"_"):o.replace(/#/g,"^"))+(r>4?e.toLowerCase():e)+(5===r?"":r>4?T("'",r-5):T(",",4-r))}var $={abcToScientificNotation:S,scientificToAbcNotation:C,tokenize:V,transpose:function(t,n){return C(N(S(t),n))},distance:function(t,n){return O(S(t),S(n))}};function q(t){return t.map(t=>M(t)).filter(t=>!t.empty).sort((t,n)=>t.height-n.height).map(t=>t.name)}var k=Object.freeze({__proto__:null,compact:function(t){return t.filter(t=>0===t||t)},permutations:function t(n){return 0===n.length?[[]]:t(n.slice(1)).reduce((t,e)=>t.concat(n.map((t,o)=>{const r=e.slice();return r.splice(o,0,n[0]),r})),[])},range:function(t,n){return t0===n||t!==e[n-1])}});function E(t,n){return t0===t||t)}var z={compact:F,permutations:function t(n){return 0===n.length?[[]]:t(n.slice(1)).reduce((t,e)=>t.concat(n.map((t,o)=>{const r=e.slice();return r.splice(o,0,n[0]),r})),[])},range:E,rotate:_,shuffle:function(t,n=Math.random){let e,o,r=t.length;for(;r;)e=Math.floor(n()*r--),o=t[r],t[r]=t[e],t[e]=o;return t}};const R={empty:!0,name:"",setNum:0,chroma:"000000000000",normalized:"000000000000",intervals:[]},U=t=>Number(t).toString(2),B=t=>parseInt(t,2),G=/^[01]{12}$/;function K(t){return G.test(t)}const L={[R.chroma]:R};function H(t){const n=K(t)?t:"number"==typeof(e=t)&&e>=0&&e<=4095?U(t):Array.isArray(t)?function(t){if(0===t.length)return R.chroma;let n;const e=[0,0,0,0,0,0,0,0,0,0,0,0];for(let o=0;ot&&K(t.chroma))(t)?t.chroma:R.chroma;var e;return L[n]=L[n]||function(t){const n=B(t),e=function(t){const n=t.split("");return n.map((t,e)=>_(e,n).join(""))}(t).map(B).filter(t=>t>=2048).sort()[0],o=U(e),r=W(t);return{empty:!1,name:"",setNum:n,chroma:t,normalized:o,intervals:r}}(n)}const J=n("Pcset.pcset","Pcset.get",H),Q=["1P","2m","2M","3m","3M","4P","5d","5P","6m","6M","7m","7M"];function W(t){const n=[];for(let e=0;e<12;e++)"1"===t.charAt(e)&&n.push(Q[e]);return n}function X(t,n=!0){const e=H(t).chroma.split("");return F(e.map((t,o)=>{const r=_(o,e);return n&&"0"===r[0]?null:r.join("")}))}function Y(t){const n=H(t).setNum;return t=>{const e=H(t).setNum;return n&&n!==e&&(e&n)===e}}function Z(t){const n=H(t).setNum;return t=>{const e=H(t).setNum;return n&&n!==e&&(e|n)===e}}function tt(t){const n=H(t);return t=>{const e=M(t);return n&&!e.empty&&"1"===n.chroma.charAt(e.chroma)}}var nt={get:H,chroma:t=>H(t).chroma,num:t=>H(t).setNum,intervals:t=>H(t).intervals,chromas:function(){return E(2048,4095).map(U)},isSupersetOf:Z,isSubsetOf:Y,isNoteIncludedIn:tt,isEqual:function(t,n){return H(t).setNum===H(n).setNum},filter:function(t){const n=tt(t);return t=>t.filter(n)},modes:X,pcset:J};const et={...R,name:"",quality:"Unknown",intervals:[],aliases:[]};let ot=[],rt={};function at(t){return rt[t]||et}const mt=n("ChordType.chordType","ChordType.get",at);function it(){return ot.slice()}const ct=n("ChordType.entries","ChordType.all",it);function st(t,n,e){const o=function(t){const n=n=>-1!==t.indexOf(n);return n("5A")?"Augmented":n("3M")?"Major":n("5d")?"Diminished":n("3m")?"Minor":"Unknown"}(t),r={...H(t),name:e||"",quality:o,intervals:t,aliases:n};ot.push(r),r.name&&(rt[r.name]=r),rt[r.setNum]=r,rt[r.chroma]=r,r.aliases.forEach(t=>function(t,n){rt[n]=t}(r,t))}[["1P 3M 5P","major","M "],["1P 3M 5P 7M","major seventh","maj7 Δ ma7 M7 Maj7"],["1P 3M 5P 7M 9M","major ninth","maj9 Δ9"],["1P 3M 5P 7M 9M 13M","major thirteenth","maj13 Maj13"],["1P 3M 5P 6M","sixth","6 add6 add13 M6"],["1P 3M 5P 6M 9M","sixth/ninth","6/9 69"],["1P 3M 5P 7M 11A","lydian","maj#4 Δ#4 Δ#11"],["1P 3M 6m 7M","major seventh flat sixth","M7b6"],["1P 3m 5P","minor","m min -"],["1P 3m 5P 7m","minor seventh","m7 min7 mi7 -7"],["1P 3m 5P 7M","minor/major seventh","m/ma7 m/maj7 mM7 m/M7 -Δ7 mΔ"],["1P 3m 5P 6M","minor sixth","m6"],["1P 3m 5P 7m 9M","minor ninth","m9"],["1P 3m 5P 7m 9M 11P","minor eleventh","m11"],["1P 3m 5P 7m 9M 13M","minor thirteenth","m13"],["1P 3m 5d","diminished","dim ° o"],["1P 3m 5d 7d","diminished seventh","dim7 °7 o7"],["1P 3m 5d 7m","half-diminished","m7b5 ø"],["1P 3M 5P 7m","dominant seventh","7 dom"],["1P 3M 5P 7m 9M","dominant ninth","9"],["1P 3M 5P 7m 9M 13M","dominant thirteenth","13"],["1P 3M 5P 7m 11A","lydian dominant seventh","7#11 7#4"],["1P 3M 5P 7m 9m","dominant flat ninth","7b9"],["1P 3M 5P 7m 9A","dominant sharp ninth","7#9"],["1P 3M 7m 9m","altered","alt7"],["1P 4P 5P","suspended fourth","sus4"],["1P 2M 5P","suspended second","sus2"],["1P 4P 5P 7m","suspended fourth seventh","7sus4"],["1P 5P 7m 9M 11P","eleventh","11"],["1P 4P 5P 7m 9m","suspended fourth flat ninth","b9sus phryg"],["1P 5P","fifth","5"],["1P 3M 5A","augmented","aug + +5"],["1P 3M 5A 7M","augmented seventh","maj7#5 maj7+5"],["1P 3M 5P 7M 9M 11A","major sharp eleventh (lydian)","maj9#11 Δ9#11"],["1P 2M 4P 5P","","sus24 sus4add9"],["1P 3M 13m","","Mb6"],["1P 3M 5A 7M 9M","","maj9#5 Maj9#5"],["1P 3M 5A 7m","","7#5 +7 7aug aug7"],["1P 3M 5A 7m 9A","","7#5#9 7alt"],["1P 3M 5A 7m 9M","","9#5 9+"],["1P 3M 5A 7m 9M 11A","","9#5#11"],["1P 3M 5A 7m 9m","","7#5b9"],["1P 3M 5A 7m 9m 11A","","7#5b9#11"],["1P 3M 5A 9A","","+add#9"],["1P 3M 5A 9M","","M#5add9 +add9"],["1P 3M 5P 6M 11A","","M6#11 M6b5 6#11 6b5"],["1P 3M 5P 6M 7M 9M","","M7add13"],["1P 3M 5P 6M 9M 11A","","69#11"],["1P 3M 5P 6m 7m","","7b6"],["1P 3M 5P 7M 9A 11A","","maj7#9#11"],["1P 3M 5P 7M 9M 11A 13M","","M13#11 maj13#11 M13+4 M13#4"],["1P 3M 5P 7M 9m","","M7b9"],["1P 3M 5P 7m 11A 13m","","7#11b13 7b5b13"],["1P 3M 5P 7m 13M","","7add6 67 7add13"],["1P 3M 5P 7m 9A 11A","","7#9#11 7b5#9"],["1P 3M 5P 7m 9A 11A 13M","","13#9#11"],["1P 3M 5P 7m 9A 11A 13m","","7#9#11b13"],["1P 3M 5P 7m 9A 13M","","13#9"],["1P 3M 5P 7m 9A 13m","","7#9b13"],["1P 3M 5P 7m 9M 11A","","9#11 9+4 9#4"],["1P 3M 5P 7m 9M 11A 13M","","13#11 13+4 13#4"],["1P 3M 5P 7m 9M 11A 13m","","9#11b13 9b5b13"],["1P 3M 5P 7m 9m 11A","","7b9#11 7b5b9"],["1P 3M 5P 7m 9m 11A 13M","","13b9#11"],["1P 3M 5P 7m 9m 11A 13m","","7b9b13#11 7b9#11b13 7b5b9b13"],["1P 3M 5P 7m 9m 13M","","13b9"],["1P 3M 5P 7m 9m 13m","","7b9b13"],["1P 3M 5P 7m 9m 9A","","7b9#9"],["1P 3M 5P 9M","","Madd9 2 add9 add2"],["1P 3M 5P 9m","","Maddb9"],["1P 3M 5d","","Mb5"],["1P 3M 5d 6M 7m 9M","","13b5"],["1P 3M 5d 7M","","M7b5"],["1P 3M 5d 7M 9M","","M9b5"],["1P 3M 5d 7m","","7b5"],["1P 3M 5d 7m 9M","","9b5"],["1P 3M 7m","","7no5"],["1P 3M 7m 13m","","7b13"],["1P 3M 7m 9M","","9no5"],["1P 3M 7m 9M 13M","","13no5"],["1P 3M 7m 9M 13m","","9b13"],["1P 3m 4P 5P","","madd4"],["1P 3m 5A","","m#5 m+ mb6"],["1P 3m 5P 6M 9M","","m69"],["1P 3m 5P 6m 7M","","mMaj7b6"],["1P 3m 5P 6m 7M 9M","","mMaj9b6"],["1P 3m 5P 7M 9M","","mMaj9"],["1P 3m 5P 7m 11P","","m7add11 m7add4"],["1P 3m 5P 9M","","madd9"],["1P 3m 5d 6M 7M","","o7M7"],["1P 3m 5d 7M","","oM7"],["1P 3m 6m 7M","","mb6M7"],["1P 3m 6m 7m","","m7#5"],["1P 3m 6m 7m 9M","","m9#5"],["1P 3m 6m 7m 9M 11P","","m11A"],["1P 3m 6m 9m","","mb6b9"],["1P 2M 3m 5d 7m","","m9b5"],["1P 4P 5A 7M","","M7#5sus4"],["1P 4P 5A 7M 9M","","M9#5sus4"],["1P 4P 5A 7m","","7#5sus4"],["1P 4P 5P 7M","","M7sus4"],["1P 4P 5P 7M 9M","","M9sus4"],["1P 4P 5P 7m 9M","","9sus4 9sus"],["1P 4P 5P 7m 9M 13M","","13sus4 13sus"],["1P 4P 5P 7m 9m 13m","","7sus4b9b13 7b9b13sus4"],["1P 4P 7m 10m","","4 quartal"],["1P 5P 7m 9m 11P","","11b9"]].forEach(([t,n,e])=>st(t.split(" "),e.split(" "),n)),ot.sort((t,n)=>t.setNum-n.setNum);var ut={names:function(){return ot.map(t=>t.name).filter(t=>t)},symbols:function(){return ot.map(t=>t.aliases[0]).filter(t=>t)},get:at,all:it,add:st,removeAll:function(){ot=[],rt={}},keys:function(){return Object.keys(rt)},entries:ct,chordType:mt};const lt={weight:0,name:""};const Pt={...R,intervals:[],aliases:[]};let dt=[],Mt={};function pt(){return dt.map(t=>t.name)}function ft(t){return Mt[t]||Pt}const ht=n("ScaleDictionary.scaleType","ScaleType.get",ft);function yt(){return dt.slice()}const bt=n("ScaleDictionary.entries","ScaleType.all",yt);function gt(t,n,e=[]){const o={...H(t),name:n,intervals:t,aliases:e};return dt.push(o),Mt[o.name]=o,Mt[o.setNum]=o,Mt[o.chroma]=o,o.aliases.forEach(t=>function(t,n){Mt[n]=t}(o,t)),o}[["1P 2M 3M 5P 6M","major pentatonic","pentatonic"],["1P 3M 4P 5P 7M","ionian pentatonic"],["1P 3M 4P 5P 7m","mixolydian pentatonic","indian"],["1P 2M 4P 5P 6M","ritusen"],["1P 2M 4P 5P 7m","egyptian"],["1P 3M 4P 5d 7m","neopolitan major pentatonic"],["1P 3m 4P 5P 6m","vietnamese 1"],["1P 2m 3m 5P 6m","pelog"],["1P 2m 4P 5P 6m","kumoijoshi"],["1P 2M 3m 5P 6m","hirajoshi"],["1P 2m 4P 5d 7m","iwato"],["1P 2m 4P 5P 7m","in-sen"],["1P 3M 4A 5P 7M","lydian pentatonic","chinese"],["1P 3m 4P 6m 7m","malkos raga"],["1P 3m 4P 5d 7m","locrian pentatonic","minor seven flat five pentatonic"],["1P 3m 4P 5P 7m","minor pentatonic","vietnamese 2"],["1P 3m 4P 5P 6M","minor six pentatonic"],["1P 2M 3m 5P 6M","flat three pentatonic","kumoi"],["1P 2M 3M 5P 6m","flat six pentatonic"],["1P 2m 3M 5P 6M","scriabin"],["1P 3M 5d 6m 7m","whole tone pentatonic"],["1P 3M 4A 5A 7M","lydian #5P pentatonic"],["1P 3M 4A 5P 7m","lydian dominant pentatonic"],["1P 3m 4P 5P 7M","minor #7M pentatonic"],["1P 3m 4d 5d 7m","super locrian pentatonic"],["1P 2M 3m 4P 5P 7M","minor hexatonic"],["1P 2A 3M 5P 5A 7M","augmented"],["1P 2M 3m 3M 5P 6M","major blues"],["1P 2M 4P 5P 6M 7m","piongio"],["1P 2m 3M 4A 6M 7m","prometheus neopolitan"],["1P 2M 3M 4A 6M 7m","prometheus"],["1P 2m 3M 5d 6m 7m","mystery #1"],["1P 2m 3M 4P 5A 6M","six tone symmetric"],["1P 2M 3M 4A 5A 7m","whole tone","messiaen's mode #1"],["1P 2m 4P 4A 5P 7M","messiaen's mode #5"],["1P 3m 4P 5d 5P 7m","minor blues","blues"],["1P 2M 3M 4P 5d 6m 7m","locrian major","arabian"],["1P 2m 3M 4A 5P 6m 7M","double harmonic lydian"],["1P 2M 3m 4P 5P 6m 7M","harmonic minor"],["1P 2m 3m 3M 5d 6m 7m","altered","super locrian","diminished whole tone","pomeroy"],["1P 2M 3m 4P 5d 6m 7m","locrian #2","half-diminished","aeolian b5"],["1P 2M 3M 4P 5P 6m 7m","mixolydian b6","melodic minor fifth mode","hindu"],["1P 2M 3M 4A 5P 6M 7m","lydian dominant","lydian b7","overtone"],["1P 2M 3M 4A 5P 6M 7M","lydian"],["1P 2M 3M 4A 5A 6M 7M","lydian augmented"],["1P 2m 3m 4P 5P 6M 7m","dorian b2","phrygian #6","melodic minor second mode"],["1P 2M 3m 4P 5P 6M 7M","melodic minor"],["1P 2m 3m 4P 5d 6m 7m","locrian"],["1P 2m 3m 4d 5d 6m 7d","ultralocrian","superlocrian bb7","·superlocrian diminished"],["1P 2m 3m 4P 5d 6M 7m","locrian 6","locrian natural 6","locrian sharp 6"],["1P 2A 3M 4P 5P 5A 7M","augmented heptatonic"],["1P 2M 3m 5d 5P 6M 7m","romanian minor"],["1P 2M 3m 4A 5P 6M 7m","dorian #4"],["1P 2M 3m 4A 5P 6M 7M","lydian diminished"],["1P 2m 3m 4P 5P 6m 7m","phrygian"],["1P 2M 3M 4A 5A 7m 7M","leading whole tone"],["1P 2M 3M 4A 5P 6m 7m","lydian minor"],["1P 2m 3M 4P 5P 6m 7m","phrygian dominant","spanish","phrygian major"],["1P 2m 3m 4P 5P 6m 7M","balinese"],["1P 2m 3m 4P 5P 6M 7M","neopolitan major"],["1P 2M 3m 4P 5P 6m 7m","aeolian","minor"],["1P 2M 3M 4P 5P 6m 7M","harmonic major"],["1P 2m 3M 4P 5P 6m 7M","double harmonic major","gypsy"],["1P 2M 3m 4P 5P 6M 7m","dorian"],["1P 2M 3m 4A 5P 6m 7M","hungarian minor"],["1P 2A 3M 4A 5P 6M 7m","hungarian major"],["1P 2m 3M 4P 5d 6M 7m","oriental"],["1P 2m 3m 3M 4A 5P 7m","flamenco"],["1P 2m 3m 4A 5P 6m 7M","todi raga"],["1P 2M 3M 4P 5P 6M 7m","mixolydian","dominant"],["1P 2m 3M 4P 5d 6m 7M","persian"],["1P 2M 3M 4P 5P 6M 7M","major","ionian"],["1P 2m 3M 5d 6m 7m 7M","enigmatic"],["1P 2M 3M 4P 5A 6M 7M","major augmented","major #5","ionian augmented","ionian #5"],["1P 2A 3M 4A 5P 6M 7M","lydian #9"],["1P 2m 2M 4P 4A 5P 6m 7M","messiaen's mode #4"],["1P 2m 3M 4P 4A 5P 6m 7M","purvi raga"],["1P 2m 3m 3M 4P 5P 6m 7m","spanish heptatonic"],["1P 2M 3M 4P 5P 6M 7m 7M","bebop"],["1P 2M 3m 3M 4P 5P 6M 7m","bebop minor"],["1P 2M 3M 4P 5P 5A 6M 7M","bebop major"],["1P 2m 3m 4P 5d 5P 6m 7m","bebop locrian"],["1P 2M 3m 4P 5P 6m 7m 7M","minor bebop"],["1P 2M 3m 4P 5d 6m 6M 7M","diminished","whole-half diminished"],["1P 2M 3M 4P 5d 5P 6M 7M","ichikosucho"],["1P 2M 3m 4P 5P 6m 6M 7M","minor six diminished"],["1P 2m 3m 3M 4A 5P 6M 7m","half-whole diminished","dominant diminished","messiaen's mode #2"],["1P 3m 3M 4P 5P 6M 7m 7M","kafi raga"],["1P 2M 3M 4P 4A 5A 6A 7M","messiaen's mode #6"],["1P 2M 3m 3M 4P 5d 5P 6M 7m","composite blues"],["1P 2M 3m 3M 4A 5P 6m 7m 7M","messiaen's mode #3"],["1P 2m 2M 3m 4P 4A 5P 6m 6M 7M","messiaen's mode #7"],["1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M","chromatic"]].forEach(([t,n,...e])=>gt(t.split(" "),n,e));var At={names:pt,get:ft,all:yt,add:gt,removeAll:function(){dt=[],Mt={}},keys:function(){return Object.keys(Mt)},entries:bt,scaleType:ht};const vt={empty:!0,name:"",symbol:"",root:"",rootDegree:0,type:"",tonic:null,setNum:NaN,quality:"Unknown",chroma:"",normalized:"",aliases:[],notes:[],intervals:[]},jt=/^(6|64|7|9|11|13)$/;function It(t){const[n,e,o,r]=f(t);return""===n?["",t]:"A"===n&&"ug"===r?["","aug"]:r||"4"!==o&&"5"!==o?jt.test(o)?[n+e,o+r]:[n+e+o,r]:[n+e,o]}function wt(t){if(""===t)return vt;if(Array.isArray(t)&&2===t.length)return Nt(t[1],t[0]);{const[n,e]=It(t),o=Nt(e,n);return o.empty?Nt(t):o}}function Nt(t,n,e){const o=at(t),r=M(n||""),a=M(e||"");if(o.empty||n&&r.empty||e&&a.empty)return vt;const m=O(r.pc,a.pc),i=o.intervals.indexOf(m)+1;if(!a.empty&&!i)return vt;const c=r.empty?[]:o.intervals.map(t=>N(r,t));t=-1!==o.aliases.indexOf(t)?t:o.aliases[0];const s=`${r.empty?"":r.pc}${t}${a.empty?"":"/"+a.pc}`,u=`${n?r.pc+" ":""}${o.name}${e?" over "+a.pc:""}`;return{...o,name:u,symbol:s,type:o.name,root:a.name,rootDegree:i,tonic:r.name,notes:c}}var Ot={getChord:Nt,get:wt,detect:function(t){const n=t.map(t=>M(t).pc).filter(t=>t);return 0===M.length?[]:function(t,n){const e=t[0],o=M(e).chroma,r=(t=>{const n=t.reduce((t,n)=>{const e=M(n).chroma;return void 0!==e&&(t[e]=t[e]||M(n).name),t},{});return t=>n[t]})(t);return X(t,!1).map((t,a)=>{const m=at(t).aliases[0];if(!m)return lt;const i=r(a);return a!==o?{weight:.5*n,name:`${i}${m}/${e}`}:{weight:1*n,name:`${i}${m}`}})}(n,1).filter(t=>t.weight).sort((t,n)=>n.weight-t.weight).map(t=>t.name)},chordScales:function(t){const n=Z(wt(t).chroma);return yt().filter(t=>n(t.chroma)).map(t=>t.name)},extended:function(t){const n=wt(t),e=Z(n.chroma);return it().filter(t=>e(t.chroma)).map(t=>n.tonic+t.aliases[0])},reduced:function(t){const n=wt(t),e=Y(n.chroma);return it().filter(t=>e(t.chroma)).map(t=>n.tonic+t.aliases[0])},tokenize:It,transpose:function(t,n){const[e,o]=It(t);return e?N(e,n)+o:name},chord:n("Chord.chord","Chord.get",wt)};const xt=[];[[.125,"dl",["large","duplex longa","maxima","octuple","octuple whole"]],[.25,"l",["long","longa"]],[.5,"d",["double whole","double","breve"]],[1,"w",["whole","semibreve"]],[2,"h",["half","minim"]],[4,"q",["quarter","crotchet"]],[8,"e",["eighth","quaver"]],[16,"s",["sixteenth","semiquaver"]],[32,"t",["thirty-second","demisemiquaver"]],[64,"sf",["sixty-fourth","hemidemisemiquaver"]],[128,"h",["hundred twenty-eighth"]],[256,"th",["two hundred fifty-sixth"]]].forEach(([t,n,e])=>function(t,n,e){xt.push({empty:!1,dots:"",name:"",value:1/t,fraction:t<1?[1/t,1]:[1,t],shorthand:n,names:e})}(t,n,e));const Tt={empty:!0,name:"",value:0,fraction:[0,0],shorthand:"",dots:"",names:[]};const Dt=/^([^.]+)(\.*)$/;function Vt(t){const[n,e,o]=Dt.exec(t)||[],r=xt.find(t=>t.shorthand===e||t.names.includes(e));if(!r)return Tt;const a=function(t,n){const e=Math.pow(2,n);let o=t[0]*e,r=t[1]*e;const a=o;for(let t=0;t(n.names.forEach(n=>t.push(n)),t),[])},shorthands:function(){return xt.map(t=>t.shorthand)},get:Vt,value:t=>Vt(t).value,fraction:t=>Vt(t).fraction};const Ct=j;const $t=[1,2,2,3,3,4,5,5,6,6,7,7],qt="P m M m M P d P m M m M".split(" ");const kt=O,Et=zt((t,n)=>[t[0]+n[0],t[1]+n[1]]),_t=zt((t,n)=>[t[0]-n[0],t[1]-n[1]]);var Ft={names:function(){return"1P 2M 3M 4P 5P 6m 7m".split(" ")},get:Ct,name:t=>j(t).name,num:t=>j(t).num,semitones:t=>j(t).semitones,quality:t=>j(t).q,fromSemitones:function(t){const n=t<0?-1:1,e=Math.abs(t),o=e%12,r=Math.floor(e/12);return n*($t[o]+7*r)+qt[o]},distance:kt,invert:function(t){const n=j(t);return n.empty?"":j({step:(7-n.step)%7,alt:"perfectable"===n.type?-n.alt:-(n.alt+1),oct:n.oct,dir:n.dir}).name},simplify:function(t){const n=j(t);return n.empty?"":n.simple+n.q},add:Et,addTo:t=>n=>Et(t,n),substract:_t};function zt(t){return(n,e)=>{const o=j(n).coord,r=j(e).coord;if(o&&r){return w(t(o,r)).name}}}function Rt(t){return+t>=0&&+t<=127}function Ut(t){if(Rt(t))return+t;const n=M(t);return n.empty?null:n.midi}const Bt=Math.log(2),Gt=Math.log(440);const Kt="C C# D D# E F F# G G# A A# B".split(" "),Lt="C Db D Eb E F Gb G Ab A Bb B".split(" ");function Ht(t,n={}){t=Math.round(t);const e=(!0===n.sharps?Kt:Lt)[t%12];return n.pitchClass?e:e+(Math.floor(t/12)-1)}var Jt={isMidi:Rt,toMidi:Ut,midiToFreq:function(t,n=440){return Math.pow(2,(t-69)/12)*n},midiToNoteName:Ht,freqToMidi:function(t){const n=12*(Math.log(t)-Gt)/Bt+69;return Math.round(100*n)/100}};const Qt=["C","D","E","F","G","A","B"],Wt=t=>t.name,Xt=t=>t.map(M).filter(t=>!t.empty);const Yt=M;const Zt=N,tn=N,nn=t=>n=>Zt(n,t),en=nn,on=t=>n=>Zt(t,n),rn=on;function an(t,n){const e=Yt(t);if(e.empty)return"";const[o,r]=e.coord;return h(void 0===r?[o+n]:[o+n,r]).name}const mn=an,cn=(t,n)=>t.height-n.height;function sn(t,n){return n=n||cn,Xt(t).sort(n).map(Wt)}function un(t){return sn(t,cn).filter((t,n,e)=>0===n||t!==e[n-1])}const ln=dn(!0),Pn=dn(!1);function dn(t){return n=>{const e=Yt(n);if(e.empty)return"";const o=t?e.alt>0:e.alt<0,r=null===e.midi;return Ht(e.midi||e.chroma,{sharps:o,pitchClass:r})}}var Mn={names:function(t){return void 0===t?Qt.slice():Array.isArray(t)?Xt(t).map(Wt):[]},get:Yt,name:t=>Yt(t).name,pitchClass:t=>Yt(t).pc,accidentals:t=>Yt(t).acc,octave:t=>Yt(t).oct,midi:t=>Yt(t).midi,ascending:cn,descending:(t,n)=>n.height-t.height,sortedNames:sn,sortedUniqNames:un,fromMidi:function(t){return Ht(t)},fromMidiSharps:function(t){return Ht(t,{sharps:!0})},freq:t=>Yt(t).freq,chroma:t=>Yt(t).chroma,transpose:Zt,tr:tn,transposeBy:nn,trBy:en,transposeFrom:on,trFrom:rn,transposeFifths:an,trFifths:mn,simplify:ln,enharmonic:Pn};const pn={empty:!0,name:"",chordType:""},fn={};function hn(t){return"string"==typeof t?fn[t]||(fn[t]=function(t){const[n,e,o,r]=(a=t,bn.exec(a)||["","","",""]);var a;if(!o)return pn;const m=o.toUpperCase(),i=An.indexOf(m),c=d(e);return{empty:!1,name:n,roman:o,interval:j({step:i,alt:c,dir:1}).name,acc:e,chordType:r,alt:c,step:i,major:o===m,oct:0,dir:1}}(t)):"number"==typeof t?hn(An[t]||""):o(t)?hn(P((n=t).alt)+An[n.step]):e(t)?hn(t.name):pn;var n}const yn=n("RomanNumeral.romanNumeral","RomanNumeral.get",hn);const bn=/^(#{1,}|b{1,}|x{1,}|)(IV|I{1,3}|VI{0,2}|iv|i{1,3}|vi{0,2})([^IViv]*)$/;const gn="I II III IV V VI VII",An=gn.split(" "),vn=gn.toLowerCase().split(" ");var jn={names:function(t=!0){return(t?An:vn).slice()},get:hn,romanNumeral:yn};const In=t=>(n,e="")=>n.map((n,o)=>"-"!==n?t[o]+e+n:"");function wn(t,n,e,o){return r=>{const a=t.split(" "),m=a.map(t=>hn(t).interval||""),i=m.map(t=>N(r,t)),c=In(i);return{tonic:r,grades:a,intervals:m,scale:i,chords:c(n.split(" ")),chordsHarmonicFunction:e.split(" "),chordScales:c(o.split(",")," ")}}}const Nn=(t,n)=>{const e=M(t),o=M(n);return e.empty||o.empty?0:o.coord[0]-e.coord[0]},On=wn("I II III IV V VI VII","maj7 m7 m7 maj7 7 m7 m7b5","T SD T SD D T D","major,dorian,phrygian,lydian,mixolydian,minor,locrian"),xn=wn("I II bIII IV V bVI bVII","m7 m7b5 maj7 m7 m7 maj7 7","T SD T SD D SD SD","minor,locrian,major,dorian,phrygian,lydian,mixolydian"),Tn=wn("I II bIII IV V bVI VII","mmaj7 m7b5 +maj7 m7 7 maj7 mo7","T SD T SD D SD D","harmonic minor,locrian 6,major augmented,lydian diminished,phrygian dominant,lydian #9,ultralocrian"),Dn=wn("I II bIII IV V VI VII","m6 m7 +maj7 7 7 m7b5 m7b5","T SD T SD D - -","melodic minor,dorian b2,lydian augmented,lydian dominant,mixolydian b6,locrian #2,altered");var Vn={majorKey:function(t){const n=On(t),e=Nn("C",t),o=In(n.scale);return{...n,type:"major",minorRelative:N(t,"-3m"),alteration:e,keySignature:P(e),secondaryDominants:o("- VI7 VII7 I7 II7 III7 -".split(" ")),secondaryDominantsMinorRelative:o("- IIIm7b5 IV#m7 Vm7 VIm7 VIIm7b5 -".split(" ")),substituteDominants:o("- bIII7 IV7 bV7 bVI7 bVII7 -".split(" ")),substituteDominantsMinorRelative:o("- IIIm7 Im7 IIbm7 VIm7 IVm7 -".split(" "))}},majorTonicFromKeySignature:function(t){return"number"==typeof t?an("C",t):"string"==typeof t&&/^b+|#+$/.test(t)?an("C",d(t)):null},minorKey:function(t){const n=Nn("C",t)-3;return{type:"minor",tonic:t,relativeMajor:N(t,"3m"),alteration:n,keySignature:P(n),natural:xn(t),harmonic:Tn(t),melodic:Dn(t)}}};const Sn={...R,name:"",alt:0,modeNum:NaN,triad:"",seventh:"",aliases:[]},Cn=[[0,2773,0,"ionian","","Maj7","major"],[1,2902,2,"dorian","m","m7"],[2,3418,4,"phrygian","m","m7"],[3,2741,-1,"lydian","","Maj7"],[4,2774,1,"mixolydian","","7"],[5,2906,3,"aeolian","m","m7","minor"],[6,3434,5,"locrian","dim","m7b5"]].map((function(t){const[n,e,o,r,a,m,i]=t,c=i?[i]:[],s=Number(e).toString(2);return{empty:!1,intervals:W(s),modeNum:n,chroma:s,normalized:s,name:r,setNum:e,alt:o,triad:a,seventh:m,aliases:c}})),$n={};function qn(t){return"string"==typeof t?$n[t.toLowerCase()]||Sn:t&&t.name?qn(t.name):Sn}Cn.forEach(t=>{$n[t.name]=t,t.aliases.forEach(n=>{$n[n]=t})});const kn=n("Mode.mode","Mode.get",qn);function En(){return Cn.slice()}var _n={get:qn,names:function(){return Cn.map(t=>t.name)},all:En,entries:n("Mode.mode","Mode.all",En),mode:kn};var Fn={fromRomanNumerals:function(t,n){return n.map(hn).map(n=>N(t,j(n))+n.chordType)},toRomanNumerals:function(t,n){return n.map(n=>{const[e,o]=It(n);return hn(j(O(t,e))).name+o})}};function zn(t){const n=F(t.map(Ut));return t.length&&n.length===t.length?n.reduce((t,n)=>{const e=t[t.length-1];return t.concat(E(e,n).slice(1))},[n[0]]):[]}var Rn={numeric:zn,chromatic:function(t,n){return zn(t).map(t=>Ht(t,n))}};const Un={empty:!0,name:"",type:"",tonic:null,setNum:NaN,chroma:"",normalized:"",aliases:[],notes:[],intervals:[]};function Bn(t){if("string"!=typeof t)return["",""];const n=t.indexOf(" "),e=M(t.substring(0,n));if(e.empty){const n=M(t);return n.empty?["",t]:[n.name,""]}const o=t.substring(e.name.length+1);return[e.name,o.length?o:""]}function Gn(t){const n=Array.isArray(t)?t:Bn(t),e=M(n[0]).name,o=ft(n[1]);if(o.empty)return Un;const r=o.name,a=e?o.intervals.map(t=>N(e,t)):[],m=e?e+" "+r:r;return{...o,name:m,type:r,tonic:e,notes:a}}var Kn={get:Gn,names:pt,extended:function(t){const n=Z(Gn(t).chroma);return yt().filter(t=>n(t.chroma)).map(t=>t.name)},modeNames:function(t){const n=Gn(t);if(n.empty)return[];const e=n.tonic?n.notes:n.intervals;return X(n.chroma).map((t,n)=>{const o=Gn(t).name;return o?[e[n],o]:["",""]}).filter(t=>t[0])},reduced:function(t){const n=Y(Gn(t).chroma);return yt().filter(t=>n(t.chroma)).map(t=>t.name)},scaleChords:function(t){const n=Y(Gn(t).chroma);return it().filter(t=>n(t.chroma)).map(t=>t.aliases[0])},scaleNotes:function(t){const n=t.map(t=>M(t).pc).filter(t=>t),e=n[0],o=un(n);return _(o.indexOf(e),o)},tokenize:Bn,scale:n("Scale.scale","Scale.get",Gn)};const Ln={empty:!0,name:"",upper:void 0,lower:void 0,type:void 0,additive:[]},Hn=["4/4","3/4","2/4","2/2","12/8","9/8","6/8","3/8"];const Jn=/^(\d?\d(?:\+\d)*)\/(\d)$/,Qn=new Map;function Wn(t){if("string"==typeof t){const[n,e,o]=Jn.exec(t)||[];return Wn([e,o])}const[n,e]=t,o=+e;if("number"==typeof n)return[n,o];const r=n.split("+").map(t=>+t);return 1===r.length?[r[0],o]:[r,o]}var Xn={names:function(){return Hn.slice()},parse:Wn,get:function(t){const n=Qn.get(t);if(n)return n;const e=function([t,n]){const e=Array.isArray(t)?t.reduce((t,n)=>t+n,0):t,o=n;if(0===e||0===o)return Ln;const r=Array.isArray(t)?`${t.join("+")}/${n}`:`${t}/${n}`,a=Array.isArray(t)?t:[];return{empty:!1,name:r,type:4===o||2===o?"simple":8===o&&e%3==0?"compound":"irregular",upper:e,lower:o,additive:a}}(Wn(t));return Qn.set(t,e),e}};var Yn,Zn,te=(function(t,n){!function(t,n,e,o,r,a,m,i,c,s,u,l,P,d,M,p,f,h,y,b){n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a,i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c,s=s&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u,l=l&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l,P=P&&Object.prototype.hasOwnProperty.call(P,"default")?P.default:P,d=d&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d,M=M&&Object.prototype.hasOwnProperty.call(M,"default")?M.default:M,p=p&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p,f=f&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f,h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h,y=y&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y,b=b&&Object.prototype.hasOwnProperty.call(b,"default")?b.default:b;var g=m,A=d,v=r,j=y;Object.keys(m).forEach((function(n){"default"!==n&&Object.defineProperty(t,n,{enumerable:!0,get:function(){return m[n]}})})),t.AbcNotation=n,t.Array=e,t.Chord=o,t.ChordType=r,t.Collection=a,t.Core=m,t.DurationValue=i,t.Interval=c,t.Key=s,t.Midi=u,t.Mode=l,t.Note=P,t.Pcset=d,t.Progression=M,t.Range=p,t.RomanNumeral=f,t.Scale=h,t.ScaleType=y,t.TimeSignature=b,t.ChordDictionary=v,t.PcSet=A,t.ScaleDictionary=j,t.Tonal=g,Object.defineProperty(t,"__esModule",{value:!0})}(n,$,k,Ot,ut,z,x,St,Ft,Vn,Jt,_n,Mn,nt,Fn,Rn,jn,Kn,At,Xn)}(Yn={exports:{}},Yn.exports),Yn.exports);return(Zn=te)&&Zn.__esModule&&Object.prototype.hasOwnProperty.call(Zn,"default")?Zn.default:Zn}(); +var Tonal=function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;const t=(t,n)=>Array(Math.abs(n)+1).join(t);function n(t,n,e){return function(...o){return console.warn(`${t} is deprecated. Use ${n}.`),e.apply(this,o)}}function e(t){return null!==t&&"object"==typeof t&&"string"==typeof t.name}function o(t){return null!==t&&"object"==typeof t&&"number"==typeof t.step&&"number"==typeof t.alt}const r=[0,2,4,-1,1,3,5],a=r.map(t=>Math.floor(7*t/12));function m(t){const{step:n,alt:e,oct:o,dir:m=1}=t,i=r[n]+7*e;return void 0===o?[m*i]:[m*i,m*(o-a[n]-4*e)]}const i=[3,0,4,1,5,2,6];function c(t){const[n,e,o]=t,r=i[function(t){const n=(t+1)%7;return n<0?7+n:n}(n)],m=Math.floor((n+1)/7);return void 0===e?{step:r,alt:m,dir:o}:{step:r,alt:m,oct:e+4*m+a[r],dir:o}}const s={empty:!0,name:"",pc:"",acc:""},u=new Map,l=t=>"CDEFGAB".charAt(t),P=n=>n<0?t("b",-n):t("#",n),d=t=>"b"===t[0]?-t.length:t.length;function M(t){const n=u.get(t);if(n)return n;const r="string"==typeof t?function(t){const n=f(t);if(""===n[0]||""!==n[3])return s;const e=n[0],o=n[1],r=n[2],a=(e.charCodeAt(0)+3)%7,i=d(o),c=r.length?+r:void 0,u=m({step:a,alt:i,oct:c}),l=e+o+r,P=e+o,M=(y[a]+i+120)%12,p=void 0===c?-100:c,h=y[a]+i+12*(p+1),b=h>=0&&h<=127?h:null,g=void 0===c?null:440*Math.pow(2,(h-69)/12);return{empty:!1,acc:o,alt:i,chroma:M,coord:u,freq:g,height:h,letter:e,midi:b,name:l,oct:c,pc:P,step:a}}(t):o(t)?M(function(t){const{step:n,alt:e,oct:o}=t,r=l(n);if(!r)return"";const a=r+P(e);return o||0===o?a+o:a}(t)):e(t)?M(t.name):s;return u.set(t,r),r}const p=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/;function f(t){const n=p.exec(t);return[n[1].toUpperCase(),n[2].replace(/x/g,"##"),n[3],n[4]]}function h(t){return M(c(t))}const y=[0,2,4,5,7,9,11];const b={empty:!0,name:"",acc:""},g=new RegExp("^([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})|(AA|A|P|M|m|d|dd)([-+]?\\d+)$");function A(t){const n=g.exec(`${t}`);return null===n?["",""]:n[1]?[n[1],n[2]]:[n[4],n[3]]}const v={};function j(n){return"string"==typeof n?v[n]||(v[n]=function(t){const n=A(t);if(""===n[0])return b;const e=+n[0],o=n[1],r=(Math.abs(e)-1)%7,a="PMMPPMM"[r];if("M"===a&&"P"===o)return b;const i="M"===a?"majorable":"perfectable",c=""+e+o,s=e<0?-1:1,u=8===e||-8===e?e:s*(r+1),l=function(t,n){return"M"===n&&"majorable"===t||"P"===n&&"perfectable"===t?0:"m"===n&&"majorable"===t?-1:/^A+$/.test(n)?n.length:/^d+$/.test(n)?-1*("perfectable"===t?n.length:n.length+1):0}(i,o),P=Math.floor((Math.abs(e)-1)/7),d=s*(I[r]+l+12*P),M=(s*(I[r]+l)%12+12)%12,p=m({step:r,alt:l,oct:P,dir:s});return{empty:!1,name:c,num:e,q:o,step:r,alt:l,dir:s,type:i,simple:u,semitones:d,chroma:M,coord:p,oct:P}}(n)):o(n)?j(function(n){const{step:e,alt:o,oct:r=0,dir:a}=n;if(!a)return"";return(a<0?"-":"")+(e+1+7*r)+function(n,e){return 0===e?"majorable"===n?"M":"P":-1===e&&"majorable"===n?"m":e>0?t("A",e):t("d","perfectable"===n?e:e+1)}("M"==="PMMPPMM"[e]?"majorable":"perfectable",o)}(n)):e(n)?j(n.name):b}const I=[0,2,4,5,7,9,11];function w(t){const[n,e=0]=t;return j(c(7*n+12*e<0?[-n,-e,-1]:[n,e,1]))}function N(t,n){const e=M(t),o=j(n);if(e.empty||o.empty)return"";const r=e.coord,a=o.coord;return h(1===r.length?[r[0]+a[0]]:[r[0]+a[0],r[1]+a[1]]).name}function O(t,n){const e=M(t),o=M(n);if(e.empty||o.empty)return"";const r=e.coord,a=o.coord,m=a[0]-r[0];return w([m,2===r.length&&2===a.length?a[1]-r[1]:-Math.floor(7*m/12)]).name}var x=Object.freeze({__proto__:null,accToAlt:d,altToAcc:P,coordToInterval:w,coordToNote:h,decode:c,deprecate:n,distance:O,encode:m,fillStr:t,interval:j,isNamed:e,isPitch:o,note:M,stepToLetter:l,tokenizeInterval:A,tokenizeNote:f,transpose:N});const T=(t,n)=>Array(n+1).join(t),D=/^(_{1,}|=|\^{1,}|)([abcdefgABCDEFG])([,']*)$/;function V(t){const n=D.exec(t);return n?[n[1],n[2],n[3]]:["","",""]}function S(t){const[n,e,o]=V(t);if(""===e)return"";let r=4;for(let t=0;t96?e.toUpperCase()+a+(r+1):e+a+r}function C(t){const n=M(t);if(n.empty||!n.oct)return"";const{letter:e,acc:o,oct:r}=n;return("b"===o[0]?o.replace(/b/g,"_"):o.replace(/#/g,"^"))+(r>4?e.toLowerCase():e)+(5===r?"":r>4?T("'",r-5):T(",",4-r))}var $={abcToScientificNotation:S,scientificToAbcNotation:C,tokenize:V,transpose:function(t,n){return C(N(S(t),n))},distance:function(t,n){return O(S(t),S(n))}};function q(t){return t.map(t=>M(t)).filter(t=>!t.empty).sort((t,n)=>t.height-n.height).map(t=>t.name)}var k=Object.freeze({__proto__:null,compact:function(t){return t.filter(t=>0===t||t)},permutations:function t(n){return 0===n.length?[[]]:t(n.slice(1)).reduce((t,e)=>t.concat(n.map((t,o)=>{const r=e.slice();return r.splice(o,0,n[0]),r})),[])},range:function(t,n){return t0===n||t!==e[n-1])}});function E(t,n){return t0===t||t)}var z={compact:F,permutations:function t(n){return 0===n.length?[[]]:t(n.slice(1)).reduce((t,e)=>t.concat(n.map((t,o)=>{const r=e.slice();return r.splice(o,0,n[0]),r})),[])},range:E,rotate:_,shuffle:function(t,n=Math.random){let e,o,r=t.length;for(;r;)e=Math.floor(n()*r--),o=t[r],t[r]=t[e],t[e]=o;return t}};const R={empty:!0,name:"",setNum:0,chroma:"000000000000",normalized:"000000000000",intervals:[]},U=t=>Number(t).toString(2),B=t=>parseInt(t,2),G=/^[01]{12}$/;function K(t){return G.test(t)}const L={[R.chroma]:R};function H(t){const n=K(t)?t:"number"==typeof(e=t)&&e>=0&&e<=4095?U(t):Array.isArray(t)?function(t){if(0===t.length)return R.chroma;let n;const e=[0,0,0,0,0,0,0,0,0,0,0,0];for(let o=0;ot&&K(t.chroma))(t)?t.chroma:R.chroma;var e;return L[n]=L[n]||function(t){const n=B(t),e=function(t){const n=t.split("");return n.map((t,e)=>_(e,n).join(""))}(t).map(B).filter(t=>t>=2048).sort()[0],o=U(e),r=W(t);return{empty:!1,name:"",setNum:n,chroma:t,normalized:o,intervals:r}}(n)}const J=n("Pcset.pcset","Pcset.get",H),Q=["1P","2m","2M","3m","3M","4P","5d","5P","6m","6M","7m","7M"];function W(t){const n=[];for(let e=0;e<12;e++)"1"===t.charAt(e)&&n.push(Q[e]);return n}function X(t,n=!0){const e=H(t).chroma.split("");return F(e.map((t,o)=>{const r=_(o,e);return n&&"0"===r[0]?null:r.join("")}))}function Y(t){const n=H(t).setNum;return t=>{const e=H(t).setNum;return n&&n!==e&&(e&n)===e}}function Z(t){const n=H(t).setNum;return t=>{const e=H(t).setNum;return n&&n!==e&&(e|n)===e}}function tt(t){const n=H(t);return t=>{const e=M(t);return n&&!e.empty&&"1"===n.chroma.charAt(e.chroma)}}var nt={get:H,chroma:t=>H(t).chroma,num:t=>H(t).setNum,intervals:t=>H(t).intervals,chromas:function(){return E(2048,4095).map(U)},isSupersetOf:Z,isSubsetOf:Y,isNoteIncludedIn:tt,isEqual:function(t,n){return H(t).setNum===H(n).setNum},filter:function(t){const n=tt(t);return t=>t.filter(n)},modes:X,pcset:J};const et={...R,name:"",quality:"Unknown",intervals:[],aliases:[]};let ot=[],rt={};function at(t){return rt[t]||et}const mt=n("ChordType.chordType","ChordType.get",at);function it(){return ot.slice()}const ct=n("ChordType.entries","ChordType.all",it);function st(t,n,e){const o=function(t){const n=n=>-1!==t.indexOf(n);return n("5A")?"Augmented":n("3M")?"Major":n("5d")?"Diminished":n("3m")?"Minor":"Unknown"}(t),r={...H(t),name:e||"",quality:o,intervals:t,aliases:n};ot.push(r),r.name&&(rt[r.name]=r),rt[r.setNum]=r,rt[r.chroma]=r,r.aliases.forEach(t=>function(t,n){rt[n]=t}(r,t))}[["1P 3M 5P","major","M "],["1P 3M 5P 7M","major seventh","maj7 Δ ma7 M7 Maj7"],["1P 3M 5P 7M 9M","major ninth","maj9 Δ9"],["1P 3M 5P 7M 9M 13M","major thirteenth","maj13 Maj13"],["1P 3M 5P 6M","sixth","6 add6 add13 M6"],["1P 3M 5P 6M 9M","sixth/ninth","6/9 69"],["1P 3M 5P 7M 11A","lydian","maj#4 Δ#4 Δ#11"],["1P 3M 6m 7M","major seventh flat sixth","M7b6"],["1P 3m 5P","minor","m min -"],["1P 3m 5P 7m","minor seventh","m7 min7 mi7 -7"],["1P 3m 5P 7M","minor/major seventh","m/ma7 m/maj7 mM7 m/M7 -Δ7 mΔ"],["1P 3m 5P 6M","minor sixth","m6"],["1P 3m 5P 7m 9M","minor ninth","m9"],["1P 3m 5P 7m 9M 11P","minor eleventh","m11"],["1P 3m 5P 7m 9M 13M","minor thirteenth","m13"],["1P 3m 5d","diminished","dim ° o"],["1P 3m 5d 7d","diminished seventh","dim7 °7 o7"],["1P 3m 5d 7m","half-diminished","m7b5 ø"],["1P 3M 5P 7m","dominant seventh","7 dom"],["1P 3M 5P 7m 9M","dominant ninth","9"],["1P 3M 5P 7m 9M 13M","dominant thirteenth","13"],["1P 3M 5P 7m 11A","lydian dominant seventh","7#11 7#4"],["1P 3M 5P 7m 9m","dominant flat ninth","7b9"],["1P 3M 5P 7m 9A","dominant sharp ninth","7#9"],["1P 3M 7m 9m","altered","alt7"],["1P 4P 5P","suspended fourth","sus4"],["1P 2M 5P","suspended second","sus2"],["1P 4P 5P 7m","suspended fourth seventh","7sus4"],["1P 5P 7m 9M 11P","eleventh","11"],["1P 4P 5P 7m 9m","suspended fourth flat ninth","b9sus phryg"],["1P 5P","fifth","5"],["1P 3M 5A","augmented","aug + +5"],["1P 3M 5A 7M","augmented seventh","maj7#5 maj7+5"],["1P 3M 5P 7M 9M 11A","major sharp eleventh (lydian)","maj9#11 Δ9#11"],["1P 2M 4P 5P","","sus24 sus4add9"],["1P 3M 13m","","Mb6"],["1P 3M 5A 7M 9M","","maj9#5 Maj9#5"],["1P 3M 5A 7m","","7#5 +7 7aug aug7"],["1P 3M 5A 7m 9A","","7#5#9 7alt"],["1P 3M 5A 7m 9M","","9#5 9+"],["1P 3M 5A 7m 9M 11A","","9#5#11"],["1P 3M 5A 7m 9m","","7#5b9"],["1P 3M 5A 7m 9m 11A","","7#5b9#11"],["1P 3M 5A 9A","","+add#9"],["1P 3M 5A 9M","","M#5add9 +add9"],["1P 3M 5P 6M 11A","","M6#11 M6b5 6#11 6b5"],["1P 3M 5P 6M 7M 9M","","M7add13"],["1P 3M 5P 6M 9M 11A","","69#11"],["1P 3M 5P 6m 7m","","7b6"],["1P 3M 5P 7M 9A 11A","","maj7#9#11"],["1P 3M 5P 7M 9M 11A 13M","","M13#11 maj13#11 M13+4 M13#4"],["1P 3M 5P 7M 9m","","M7b9"],["1P 3M 5P 7m 11A 13m","","7#11b13 7b5b13"],["1P 3M 5P 7m 13M","","7add6 67 7add13"],["1P 3M 5P 7m 9A 11A","","7#9#11 7b5#9"],["1P 3M 5P 7m 9A 11A 13M","","13#9#11"],["1P 3M 5P 7m 9A 11A 13m","","7#9#11b13"],["1P 3M 5P 7m 9A 13M","","13#9"],["1P 3M 5P 7m 9A 13m","","7#9b13"],["1P 3M 5P 7m 9M 11A","","9#11 9+4 9#4"],["1P 3M 5P 7m 9M 11A 13M","","13#11 13+4 13#4"],["1P 3M 5P 7m 9M 11A 13m","","9#11b13 9b5b13"],["1P 3M 5P 7m 9m 11A","","7b9#11 7b5b9"],["1P 3M 5P 7m 9m 11A 13M","","13b9#11"],["1P 3M 5P 7m 9m 11A 13m","","7b9b13#11 7b9#11b13 7b5b9b13"],["1P 3M 5P 7m 9m 13M","","13b9"],["1P 3M 5P 7m 9m 13m","","7b9b13"],["1P 3M 5P 7m 9m 9A","","7b9#9"],["1P 3M 5P 9M","","Madd9 2 add9 add2"],["1P 3M 5P 9m","","Maddb9"],["1P 3M 5d","","Mb5"],["1P 3M 5d 6M 7m 9M","","13b5"],["1P 3M 5d 7M","","M7b5"],["1P 3M 5d 7M 9M","","M9b5"],["1P 3M 5d 7m","","7b5"],["1P 3M 5d 7m 9M","","9b5"],["1P 3M 7m","","7no5"],["1P 3M 7m 13m","","7b13"],["1P 3M 7m 9M","","9no5"],["1P 3M 7m 9M 13M","","13no5"],["1P 3M 7m 9M 13m","","9b13"],["1P 3m 4P 5P","","madd4"],["1P 3m 5A","","m#5 m+ mb6"],["1P 3m 5P 6M 9M","","m69"],["1P 3m 5P 6m 7M","","mMaj7b6"],["1P 3m 5P 6m 7M 9M","","mMaj9b6"],["1P 3m 5P 7M 9M","","mMaj9"],["1P 3m 5P 7m 11P","","m7add11 m7add4"],["1P 3m 5P 9M","","madd9"],["1P 3m 5d 6M 7M","","o7M7"],["1P 3m 5d 7M","","oM7"],["1P 3m 6m 7M","","mb6M7"],["1P 3m 6m 7m","","m7#5"],["1P 3m 6m 7m 9M","","m9#5"],["1P 3m 6m 7m 9M 11P","","m11A"],["1P 3m 6m 9m","","mb6b9"],["1P 2M 3m 5d 7m","","m9b5"],["1P 4P 5A 7M","","M7#5sus4"],["1P 4P 5A 7M 9M","","M9#5sus4"],["1P 4P 5A 7m","","7#5sus4"],["1P 4P 5P 7M","","M7sus4"],["1P 4P 5P 7M 9M","","M9sus4"],["1P 4P 5P 7m 9M","","9sus4 9sus"],["1P 4P 5P 7m 9M 13M","","13sus4 13sus"],["1P 4P 5P 7m 9m 13m","","7sus4b9b13 7b9b13sus4"],["1P 4P 7m 10m","","4 quartal"],["1P 5P 7m 9m 11P","","11b9"]].forEach(([t,n,e])=>st(t.split(" "),e.split(" "),n)),ot.sort((t,n)=>t.setNum-n.setNum);var ut={names:function(){return ot.map(t=>t.name).filter(t=>t)},symbols:function(){return ot.map(t=>t.aliases[0]).filter(t=>t)},get:at,all:it,add:st,removeAll:function(){ot=[],rt={}},keys:function(){return Object.keys(rt)},entries:ct,chordType:mt};const lt={weight:0,name:""};const Pt={...R,intervals:[],aliases:[]};let dt=[],Mt={};function pt(){return dt.map(t=>t.name)}function ft(t){return Mt[t]||Pt}const ht=n("ScaleDictionary.scaleType","ScaleType.get",ft);function yt(){return dt.slice()}const bt=n("ScaleDictionary.entries","ScaleType.all",yt);function gt(t,n,e=[]){const o={...H(t),name:n,intervals:t,aliases:e};return dt.push(o),Mt[o.name]=o,Mt[o.setNum]=o,Mt[o.chroma]=o,o.aliases.forEach(t=>function(t,n){Mt[n]=t}(o,t)),o}[["1P 2M 3M 5P 6M","major pentatonic","pentatonic"],["1P 3M 4P 5P 7M","ionian pentatonic"],["1P 3M 4P 5P 7m","mixolydian pentatonic","indian"],["1P 2M 4P 5P 6M","ritusen"],["1P 2M 4P 5P 7m","egyptian"],["1P 3M 4P 5d 7m","neopolitan major pentatonic"],["1P 3m 4P 5P 6m","vietnamese 1"],["1P 2m 3m 5P 6m","pelog"],["1P 2m 4P 5P 6m","kumoijoshi"],["1P 2M 3m 5P 6m","hirajoshi"],["1P 2m 4P 5d 7m","iwato"],["1P 2m 4P 5P 7m","in-sen"],["1P 3M 4A 5P 7M","lydian pentatonic","chinese"],["1P 3m 4P 6m 7m","malkos raga"],["1P 3m 4P 5d 7m","locrian pentatonic","minor seven flat five pentatonic"],["1P 3m 4P 5P 7m","minor pentatonic","vietnamese 2"],["1P 3m 4P 5P 6M","minor six pentatonic"],["1P 2M 3m 5P 6M","flat three pentatonic","kumoi"],["1P 2M 3M 5P 6m","flat six pentatonic"],["1P 2m 3M 5P 6M","scriabin"],["1P 3M 5d 6m 7m","whole tone pentatonic"],["1P 3M 4A 5A 7M","lydian #5P pentatonic"],["1P 3M 4A 5P 7m","lydian dominant pentatonic"],["1P 3m 4P 5P 7M","minor #7M pentatonic"],["1P 3m 4d 5d 7m","super locrian pentatonic"],["1P 2M 3m 4P 5P 7M","minor hexatonic"],["1P 2A 3M 5P 5A 7M","augmented"],["1P 2M 3m 3M 5P 6M","major blues"],["1P 2M 4P 5P 6M 7m","piongio"],["1P 2m 3M 4A 6M 7m","prometheus neopolitan"],["1P 2M 3M 4A 6M 7m","prometheus"],["1P 2m 3M 5d 6m 7m","mystery #1"],["1P 2m 3M 4P 5A 6M","six tone symmetric"],["1P 2M 3M 4A 5A 7m","whole tone","messiaen's mode #1"],["1P 2m 4P 4A 5P 7M","messiaen's mode #5"],["1P 3m 4P 5d 5P 7m","minor blues","blues"],["1P 2M 3M 4P 5d 6m 7m","locrian major","arabian"],["1P 2m 3M 4A 5P 6m 7M","double harmonic lydian"],["1P 2M 3m 4P 5P 6m 7M","harmonic minor"],["1P 2m 3m 3M 5d 6m 7m","altered","super locrian","diminished whole tone","pomeroy"],["1P 2M 3m 4P 5d 6m 7m","locrian #2","half-diminished","aeolian b5"],["1P 2M 3M 4P 5P 6m 7m","mixolydian b6","melodic minor fifth mode","hindu"],["1P 2M 3M 4A 5P 6M 7m","lydian dominant","lydian b7","overtone"],["1P 2M 3M 4A 5P 6M 7M","lydian"],["1P 2M 3M 4A 5A 6M 7M","lydian augmented"],["1P 2m 3m 4P 5P 6M 7m","dorian b2","phrygian #6","melodic minor second mode"],["1P 2M 3m 4P 5P 6M 7M","melodic minor"],["1P 2m 3m 4P 5d 6m 7m","locrian"],["1P 2m 3m 4d 5d 6m 7d","ultralocrian","superlocrian bb7","·superlocrian diminished"],["1P 2m 3m 4P 5d 6M 7m","locrian 6","locrian natural 6","locrian sharp 6"],["1P 2A 3M 4P 5P 5A 7M","augmented heptatonic"],["1P 2M 3m 5d 5P 6M 7m","romanian minor"],["1P 2M 3m 4A 5P 6M 7m","dorian #4"],["1P 2M 3m 4A 5P 6M 7M","lydian diminished"],["1P 2m 3m 4P 5P 6m 7m","phrygian"],["1P 2M 3M 4A 5A 7m 7M","leading whole tone"],["1P 2M 3M 4A 5P 6m 7m","lydian minor"],["1P 2m 3M 4P 5P 6m 7m","phrygian dominant","spanish","phrygian major"],["1P 2m 3m 4P 5P 6m 7M","balinese"],["1P 2m 3m 4P 5P 6M 7M","neopolitan major"],["1P 2M 3m 4P 5P 6m 7m","aeolian","minor"],["1P 2M 3M 4P 5P 6m 7M","harmonic major"],["1P 2m 3M 4P 5P 6m 7M","double harmonic major","gypsy"],["1P 2M 3m 4P 5P 6M 7m","dorian"],["1P 2M 3m 4A 5P 6m 7M","hungarian minor"],["1P 2A 3M 4A 5P 6M 7m","hungarian major"],["1P 2m 3M 4P 5d 6M 7m","oriental"],["1P 2m 3m 3M 4A 5P 7m","flamenco"],["1P 2m 3m 4A 5P 6m 7M","todi raga"],["1P 2M 3M 4P 5P 6M 7m","mixolydian","dominant"],["1P 2m 3M 4P 5d 6m 7M","persian"],["1P 2M 3M 4P 5P 6M 7M","major","ionian"],["1P 2m 3M 5d 6m 7m 7M","enigmatic"],["1P 2M 3M 4P 5A 6M 7M","major augmented","major #5","ionian augmented","ionian #5"],["1P 2A 3M 4A 5P 6M 7M","lydian #9"],["1P 2m 2M 4P 4A 5P 6m 7M","messiaen's mode #4"],["1P 2m 3M 4P 4A 5P 6m 7M","purvi raga"],["1P 2m 3m 3M 4P 5P 6m 7m","spanish heptatonic"],["1P 2M 3M 4P 5P 6M 7m 7M","bebop"],["1P 2M 3m 3M 4P 5P 6M 7m","bebop minor"],["1P 2M 3M 4P 5P 5A 6M 7M","bebop major"],["1P 2m 3m 4P 5d 5P 6m 7m","bebop locrian"],["1P 2M 3m 4P 5P 6m 7m 7M","minor bebop"],["1P 2M 3m 4P 5d 6m 6M 7M","diminished","whole-half diminished"],["1P 2M 3M 4P 5d 5P 6M 7M","ichikosucho"],["1P 2M 3m 4P 5P 6m 6M 7M","minor six diminished"],["1P 2m 3m 3M 4A 5P 6M 7m","half-whole diminished","dominant diminished","messiaen's mode #2"],["1P 3m 3M 4P 5P 6M 7m 7M","kafi raga"],["1P 2M 3M 4P 4A 5A 6A 7M","messiaen's mode #6"],["1P 2M 3m 3M 4P 5d 5P 6M 7m","composite blues"],["1P 2M 3m 3M 4A 5P 6m 7m 7M","messiaen's mode #3"],["1P 2m 2M 3m 4P 4A 5P 6m 6M 7M","messiaen's mode #7"],["1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M","chromatic"]].forEach(([t,n,...e])=>gt(t.split(" "),n,e));var At={names:pt,get:ft,all:yt,add:gt,removeAll:function(){dt=[],Mt={}},keys:function(){return Object.keys(Mt)},entries:bt,scaleType:ht};const vt={empty:!0,name:"",symbol:"",root:"",rootDegree:0,type:"",tonic:null,setNum:NaN,quality:"Unknown",chroma:"",normalized:"",aliases:[],notes:[],intervals:[]},jt=/^(6|64|7|9|11|13)$/;function It(t){const[n,e,o,r]=f(t);return""===n?["",t]:"A"===n&&"ug"===r?["","aug"]:r||"4"!==o&&"5"!==o?jt.test(o)?[n+e,o+r]:[n+e+o,r]:[n+e,o]}function wt(t){if(""===t)return vt;if(Array.isArray(t)&&2===t.length)return Nt(t[1],t[0]);{const[n,e]=It(t),o=Nt(e,n);return o.empty?Nt(t):o}}function Nt(t,n,e){const o=at(t),r=M(n||""),a=M(e||"");if(o.empty||n&&r.empty||e&&a.empty)return vt;const m=O(r.pc,a.pc),i=o.intervals.indexOf(m)+1;if(!a.empty&&!i)return vt;const c=r.empty?[]:o.intervals.map(t=>N(r,t));t=-1!==o.aliases.indexOf(t)?t:o.aliases[0];const s=`${r.empty?"":r.pc}${t}${a.empty?"":"/"+a.pc}`,u=`${n?r.pc+" ":""}${o.name}${e?" over "+a.pc:""}`;return{...o,name:u,symbol:s,type:o.name,root:a.name,rootDegree:i,tonic:r.name,notes:c}}var Ot={getChord:Nt,get:wt,detect:function(t){const n=t.map(t=>M(t).pc).filter(t=>t);return 0===M.length?[]:function(t,n){const e=t[0],o=M(e).chroma,r=(t=>{const n=t.reduce((t,n)=>{const e=M(n).chroma;return void 0!==e&&(t[e]=t[e]||M(n).name),t},{});return t=>n[t]})(t);return X(t,!1).map((t,a)=>{const m=at(t).aliases[0];if(!m)return lt;const i=r(a);return a!==o?{weight:.5*n,name:`${i}${m}/${e}`}:{weight:1*n,name:`${i}${m}`}})}(n,1).filter(t=>t.weight).sort((t,n)=>n.weight-t.weight).map(t=>t.name)},chordScales:function(t){const n=Z(wt(t).chroma);return yt().filter(t=>n(t.chroma)).map(t=>t.name)},extended:function(t){const n=wt(t),e=Z(n.chroma);return it().filter(t=>e(t.chroma)).map(t=>n.tonic+t.aliases[0])},reduced:function(t){const n=wt(t),e=Y(n.chroma);return it().filter(t=>e(t.chroma)).map(t=>n.tonic+t.aliases[0])},tokenize:It,transpose:function(t,n){const[e,o]=It(t);return e?N(e,n)+o:t},chord:n("Chord.chord","Chord.get",wt)};const xt=[];[[.125,"dl",["large","duplex longa","maxima","octuple","octuple whole"]],[.25,"l",["long","longa"]],[.5,"d",["double whole","double","breve"]],[1,"w",["whole","semibreve"]],[2,"h",["half","minim"]],[4,"q",["quarter","crotchet"]],[8,"e",["eighth","quaver"]],[16,"s",["sixteenth","semiquaver"]],[32,"t",["thirty-second","demisemiquaver"]],[64,"sf",["sixty-fourth","hemidemisemiquaver"]],[128,"h",["hundred twenty-eighth"]],[256,"th",["two hundred fifty-sixth"]]].forEach(([t,n,e])=>function(t,n,e){xt.push({empty:!1,dots:"",name:"",value:1/t,fraction:t<1?[1/t,1]:[1,t],shorthand:n,names:e})}(t,n,e));const Tt={empty:!0,name:"",value:0,fraction:[0,0],shorthand:"",dots:"",names:[]};const Dt=/^([^.]+)(\.*)$/;function Vt(t){const[n,e,o]=Dt.exec(t)||[],r=xt.find(t=>t.shorthand===e||t.names.includes(e));if(!r)return Tt;const a=function(t,n){const e=Math.pow(2,n);let o=t[0]*e,r=t[1]*e;const a=o;for(let t=0;t(n.names.forEach(n=>t.push(n)),t),[])},shorthands:function(){return xt.map(t=>t.shorthand)},get:Vt,value:t=>Vt(t).value,fraction:t=>Vt(t).fraction};const Ct=j;const $t=[1,2,2,3,3,4,5,5,6,6,7,7],qt="P m M m M P d P m M m M".split(" ");const kt=O,Et=zt((t,n)=>[t[0]+n[0],t[1]+n[1]]),_t=zt((t,n)=>[t[0]-n[0],t[1]-n[1]]);var Ft={names:function(){return"1P 2M 3M 4P 5P 6m 7m".split(" ")},get:Ct,name:t=>j(t).name,num:t=>j(t).num,semitones:t=>j(t).semitones,quality:t=>j(t).q,fromSemitones:function(t){const n=t<0?-1:1,e=Math.abs(t),o=e%12,r=Math.floor(e/12);return n*($t[o]+7*r)+qt[o]},distance:kt,invert:function(t){const n=j(t);return n.empty?"":j({step:(7-n.step)%7,alt:"perfectable"===n.type?-n.alt:-(n.alt+1),oct:n.oct,dir:n.dir}).name},simplify:function(t){const n=j(t);return n.empty?"":n.simple+n.q},add:Et,addTo:t=>n=>Et(t,n),substract:_t};function zt(t){return(n,e)=>{const o=j(n).coord,r=j(e).coord;if(o&&r){return w(t(o,r)).name}}}function Rt(t){return+t>=0&&+t<=127}function Ut(t){if(Rt(t))return+t;const n=M(t);return n.empty?null:n.midi}const Bt=Math.log(2),Gt=Math.log(440);const Kt="C C# D D# E F F# G G# A A# B".split(" "),Lt="C Db D Eb E F Gb G Ab A Bb B".split(" ");function Ht(t,n={}){t=Math.round(t);const e=(!0===n.sharps?Kt:Lt)[t%12];return n.pitchClass?e:e+(Math.floor(t/12)-1)}var Jt={isMidi:Rt,toMidi:Ut,midiToFreq:function(t,n=440){return Math.pow(2,(t-69)/12)*n},midiToNoteName:Ht,freqToMidi:function(t){const n=12*(Math.log(t)-Gt)/Bt+69;return Math.round(100*n)/100}};const Qt=["C","D","E","F","G","A","B"],Wt=t=>t.name,Xt=t=>t.map(M).filter(t=>!t.empty);const Yt=M;const Zt=N,tn=N,nn=t=>n=>Zt(n,t),en=nn,on=t=>n=>Zt(t,n),rn=on;function an(t,n){const e=Yt(t);if(e.empty)return"";const[o,r]=e.coord;return h(void 0===r?[o+n]:[o+n,r]).name}const mn=an,cn=(t,n)=>t.height-n.height;function sn(t,n){return n=n||cn,Xt(t).sort(n).map(Wt)}function un(t){return sn(t,cn).filter((t,n,e)=>0===n||t!==e[n-1])}const ln=dn(!0),Pn=dn(!1);function dn(t){return n=>{const e=Yt(n);if(e.empty)return"";const o=t?e.alt>0:e.alt<0,r=null===e.midi;return Ht(e.midi||e.chroma,{sharps:o,pitchClass:r})}}var Mn={names:function(t){return void 0===t?Qt.slice():Array.isArray(t)?Xt(t).map(Wt):[]},get:Yt,name:t=>Yt(t).name,pitchClass:t=>Yt(t).pc,accidentals:t=>Yt(t).acc,octave:t=>Yt(t).oct,midi:t=>Yt(t).midi,ascending:cn,descending:(t,n)=>n.height-t.height,sortedNames:sn,sortedUniqNames:un,fromMidi:function(t){return Ht(t)},fromMidiSharps:function(t){return Ht(t,{sharps:!0})},freq:t=>Yt(t).freq,chroma:t=>Yt(t).chroma,transpose:Zt,tr:tn,transposeBy:nn,trBy:en,transposeFrom:on,trFrom:rn,transposeFifths:an,trFifths:mn,simplify:ln,enharmonic:Pn};const pn={empty:!0,name:"",chordType:""},fn={};function hn(t){return"string"==typeof t?fn[t]||(fn[t]=function(t){const[n,e,o,r]=(a=t,bn.exec(a)||["","","",""]);var a;if(!o)return pn;const m=o.toUpperCase(),i=An.indexOf(m),c=d(e);return{empty:!1,name:n,roman:o,interval:j({step:i,alt:c,dir:1}).name,acc:e,chordType:r,alt:c,step:i,major:o===m,oct:0,dir:1}}(t)):"number"==typeof t?hn(An[t]||""):o(t)?hn(P((n=t).alt)+An[n.step]):e(t)?hn(t.name):pn;var n}const yn=n("RomanNumeral.romanNumeral","RomanNumeral.get",hn);const bn=/^(#{1,}|b{1,}|x{1,}|)(IV|I{1,3}|VI{0,2}|iv|i{1,3}|vi{0,2})([^IViv]*)$/;const gn="I II III IV V VI VII",An=gn.split(" "),vn=gn.toLowerCase().split(" ");var jn={names:function(t=!0){return(t?An:vn).slice()},get:hn,romanNumeral:yn};const In=t=>(n,e="")=>n.map((n,o)=>"-"!==n?t[o]+e+n:"");function wn(t,n,e,o){return r=>{const a=t.split(" "),m=a.map(t=>hn(t).interval||""),i=m.map(t=>N(r,t)),c=In(i);return{tonic:r,grades:a,intervals:m,scale:i,chords:c(n.split(" ")),chordsHarmonicFunction:e.split(" "),chordScales:c(o.split(",")," ")}}}const Nn=(t,n)=>{const e=M(t),o=M(n);return e.empty||o.empty?0:o.coord[0]-e.coord[0]},On=wn("I II III IV V VI VII","maj7 m7 m7 maj7 7 m7 m7b5","T SD T SD D T D","major,dorian,phrygian,lydian,mixolydian,minor,locrian"),xn=wn("I II bIII IV V bVI bVII","m7 m7b5 maj7 m7 m7 maj7 7","T SD T SD D SD SD","minor,locrian,major,dorian,phrygian,lydian,mixolydian"),Tn=wn("I II bIII IV V bVI VII","mmaj7 m7b5 +maj7 m7 7 maj7 mo7","T SD T SD D SD D","harmonic minor,locrian 6,major augmented,lydian diminished,phrygian dominant,lydian #9,ultralocrian"),Dn=wn("I II bIII IV V VI VII","m6 m7 +maj7 7 7 m7b5 m7b5","T SD T SD D - -","melodic minor,dorian b2,lydian augmented,lydian dominant,mixolydian b6,locrian #2,altered");var Vn={majorKey:function(t){const n=On(t),e=Nn("C",t),o=In(n.scale);return{...n,type:"major",minorRelative:N(t,"-3m"),alteration:e,keySignature:P(e),secondaryDominants:o("- VI7 VII7 I7 II7 III7 -".split(" ")),secondaryDominantsMinorRelative:o("- IIIm7b5 IV#m7 Vm7 VIm7 VIIm7b5 -".split(" ")),substituteDominants:o("- bIII7 IV7 bV7 bVI7 bVII7 -".split(" ")),substituteDominantsMinorRelative:o("- IIIm7 Im7 IIbm7 VIm7 IVm7 -".split(" "))}},majorTonicFromKeySignature:function(t){return"number"==typeof t?an("C",t):"string"==typeof t&&/^b+|#+$/.test(t)?an("C",d(t)):null},minorKey:function(t){const n=Nn("C",t)-3;return{type:"minor",tonic:t,relativeMajor:N(t,"3m"),alteration:n,keySignature:P(n),natural:xn(t),harmonic:Tn(t),melodic:Dn(t)}}};const Sn={...R,name:"",alt:0,modeNum:NaN,triad:"",seventh:"",aliases:[]},Cn=[[0,2773,0,"ionian","","Maj7","major"],[1,2902,2,"dorian","m","m7"],[2,3418,4,"phrygian","m","m7"],[3,2741,-1,"lydian","","Maj7"],[4,2774,1,"mixolydian","","7"],[5,2906,3,"aeolian","m","m7","minor"],[6,3434,5,"locrian","dim","m7b5"]].map((function(t){const[n,e,o,r,a,m,i]=t,c=i?[i]:[],s=Number(e).toString(2);return{empty:!1,intervals:W(s),modeNum:n,chroma:s,normalized:s,name:r,setNum:e,alt:o,triad:a,seventh:m,aliases:c}})),$n={};function qn(t){return"string"==typeof t?$n[t.toLowerCase()]||Sn:t&&t.name?qn(t.name):Sn}Cn.forEach(t=>{$n[t.name]=t,t.aliases.forEach(n=>{$n[n]=t})});const kn=n("Mode.mode","Mode.get",qn);function En(){return Cn.slice()}var _n={get:qn,names:function(){return Cn.map(t=>t.name)},all:En,entries:n("Mode.mode","Mode.all",En),mode:kn};var Fn={fromRomanNumerals:function(t,n){return n.map(hn).map(n=>N(t,j(n))+n.chordType)},toRomanNumerals:function(t,n){return n.map(n=>{const[e,o]=It(n);return hn(j(O(t,e))).name+o})}};function zn(t){const n=F(t.map(Ut));return t.length&&n.length===t.length?n.reduce((t,n)=>{const e=t[t.length-1];return t.concat(E(e,n).slice(1))},[n[0]]):[]}var Rn={numeric:zn,chromatic:function(t,n){return zn(t).map(t=>Ht(t,n))}};const Un={empty:!0,name:"",type:"",tonic:null,setNum:NaN,chroma:"",normalized:"",aliases:[],notes:[],intervals:[]};function Bn(t){if("string"!=typeof t)return["",""];const n=t.indexOf(" "),e=M(t.substring(0,n));if(e.empty){const n=M(t);return n.empty?["",t]:[n.name,""]}const o=t.substring(e.name.length+1);return[e.name,o.length?o:""]}function Gn(t){const n=Array.isArray(t)?t:Bn(t),e=M(n[0]).name,o=ft(n[1]);if(o.empty)return Un;const r=o.name,a=e?o.intervals.map(t=>N(e,t)):[],m=e?e+" "+r:r;return{...o,name:m,type:r,tonic:e,notes:a}}var Kn={get:Gn,names:pt,extended:function(t){const n=Z(Gn(t).chroma);return yt().filter(t=>n(t.chroma)).map(t=>t.name)},modeNames:function(t){const n=Gn(t);if(n.empty)return[];const e=n.tonic?n.notes:n.intervals;return X(n.chroma).map((t,n)=>{const o=Gn(t).name;return o?[e[n],o]:["",""]}).filter(t=>t[0])},reduced:function(t){const n=Y(Gn(t).chroma);return yt().filter(t=>n(t.chroma)).map(t=>t.name)},scaleChords:function(t){const n=Y(Gn(t).chroma);return it().filter(t=>n(t.chroma)).map(t=>t.aliases[0])},scaleNotes:function(t){const n=t.map(t=>M(t).pc).filter(t=>t),e=n[0],o=un(n);return _(o.indexOf(e),o)},tokenize:Bn,scale:n("Scale.scale","Scale.get",Gn)};const Ln={empty:!0,name:"",upper:void 0,lower:void 0,type:void 0,additive:[]},Hn=["4/4","3/4","2/4","2/2","12/8","9/8","6/8","3/8"];const Jn=/^(\d?\d(?:\+\d)*)\/(\d)$/,Qn=new Map;function Wn(t){if("string"==typeof t){const[n,e,o]=Jn.exec(t)||[];return Wn([e,o])}const[n,e]=t,o=+e;if("number"==typeof n)return[n,o];const r=n.split("+").map(t=>+t);return 1===r.length?[r[0],o]:[r,o]}var Xn={names:function(){return Hn.slice()},parse:Wn,get:function(t){const n=Qn.get(t);if(n)return n;const e=function([t,n]){const e=Array.isArray(t)?t.reduce((t,n)=>t+n,0):t,o=n;if(0===e||0===o)return Ln;const r=Array.isArray(t)?`${t.join("+")}/${n}`:`${t}/${n}`,a=Array.isArray(t)?t:[];return{empty:!1,name:r,type:4===o||2===o?"simple":8===o&&e%3==0?"compound":"irregular",upper:e,lower:o,additive:a}}(Wn(t));return Qn.set(t,e),e}};var Yn,Zn,te=(function(t,n){!function(t,n,e,o,r,a,m,i,c,s,u,l,P,d,M,p,f,h,y,b){n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a,i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c,s=s&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u,l=l&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l,P=P&&Object.prototype.hasOwnProperty.call(P,"default")?P.default:P,d=d&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d,M=M&&Object.prototype.hasOwnProperty.call(M,"default")?M.default:M,p=p&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p,f=f&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f,h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h,y=y&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y,b=b&&Object.prototype.hasOwnProperty.call(b,"default")?b.default:b;var g=m,A=d,v=r,j=y;Object.keys(m).forEach((function(n){"default"!==n&&Object.defineProperty(t,n,{enumerable:!0,get:function(){return m[n]}})})),t.AbcNotation=n,t.Array=e,t.Chord=o,t.ChordType=r,t.Collection=a,t.Core=m,t.DurationValue=i,t.Interval=c,t.Key=s,t.Midi=u,t.Mode=l,t.Note=P,t.Pcset=d,t.Progression=M,t.Range=p,t.RomanNumeral=f,t.Scale=h,t.ScaleType=y,t.TimeSignature=b,t.ChordDictionary=v,t.PcSet=A,t.ScaleDictionary=j,t.Tonal=g,Object.defineProperty(t,"__esModule",{value:!0})}(n,$,k,Ot,ut,z,x,St,Ft,Vn,Jt,_n,Mn,nt,Fn,Rn,jn,Kn,At,Xn)}(Yn={exports:{}},Yn.exports),Yn.exports);return(Zn=te)&&Zn.__esModule&&Object.prototype.hasOwnProperty.call(Zn,"default")?Zn.default:Zn}(); //# sourceMappingURL=tonal.min.js.map diff --git a/mercury_ide/code/node_modules/@tonaljs/tonal/browser/tonal.min.js.map b/mercury_ide/code/node_modules/@tonaljs/tonal/browser/tonal.min.js.map index a3b7413a..517fc0df 100644 --- a/mercury_ide/code/node_modules/@tonaljs/tonal/browser/tonal.min.js.map +++ b/mercury_ide/code/node_modules/@tonaljs/tonal/browser/tonal.min.js.map @@ -1 +1 @@ -{"version":3,"file":"tonal.min.js","sources":["../../core/dist/index.es.js","../../abc-notation/dist/index.es.js","../../array/dist/index.es.js","../../collection/dist/index.es.js","../../pcset/dist/index.es.js","../../chord-type/dist/index.es.js","../../chord-detect/dist/index.es.js","../../scale-type/dist/index.es.js","../../chord/dist/index.es.js","../../duration-value/dist/index.es.js","../../interval/dist/index.es.js","../../midi/dist/index.es.js","../../note/dist/index.es.js","../../roman-numeral/dist/index.es.js","../../key/dist/index.es.js","../../mode/dist/index.es.js","../../progression/dist/index.es.js","../../range/dist/index.es.js","../../scale/dist/index.es.js","../../time-signature/dist/index.es.js","../dist/index.js"],"sourcesContent":["/**\r\n * Fill a string with a repeated character\r\n *\r\n * @param character\r\n * @param repetition\r\n */\r\nconst fillStr = (s, n) => Array(Math.abs(n) + 1).join(s);\r\nfunction deprecate(original, alternative, fn) {\r\n return function (...args) {\r\n // tslint:disable-next-line\r\n console.warn(`${original} is deprecated. Use ${alternative}.`);\r\n return fn.apply(this, args);\r\n };\r\n}\n\nfunction isNamed(src) {\r\n return src !== null && typeof src === \"object\" && typeof src.name === \"string\"\r\n ? true\r\n : false;\r\n}\n\nfunction isPitch(pitch) {\r\n return pitch !== null &&\r\n typeof pitch === \"object\" &&\r\n typeof pitch.step === \"number\" &&\r\n typeof pitch.alt === \"number\"\r\n ? true\r\n : false;\r\n}\r\n// The number of fifths of [C, D, E, F, G, A, B]\r\nconst FIFTHS = [0, 2, 4, -1, 1, 3, 5];\r\n// The number of octaves it span each step\r\nconst STEPS_TO_OCTS = FIFTHS.map((fifths) => Math.floor((fifths * 7) / 12));\r\nfunction encode(pitch) {\r\n const { step, alt, oct, dir = 1 } = pitch;\r\n const f = FIFTHS[step] + 7 * alt;\r\n if (oct === undefined) {\r\n return [dir * f];\r\n }\r\n const o = oct - STEPS_TO_OCTS[step] - 4 * alt;\r\n return [dir * f, dir * o];\r\n}\r\n// We need to get the steps from fifths\r\n// Fifths for CDEFGAB are [ 0, 2, 4, -1, 1, 3, 5 ]\r\n// We add 1 to fifths to avoid negative numbers, so:\r\n// for [\"F\", \"C\", \"G\", \"D\", \"A\", \"E\", \"B\"] we have:\r\nconst FIFTHS_TO_STEPS = [3, 0, 4, 1, 5, 2, 6];\r\nfunction decode(coord) {\r\n const [f, o, dir] = coord;\r\n const step = FIFTHS_TO_STEPS[unaltered(f)];\r\n const alt = Math.floor((f + 1) / 7);\r\n if (o === undefined) {\r\n return { step, alt, dir };\r\n }\r\n const oct = o + 4 * alt + STEPS_TO_OCTS[step];\r\n return { step, alt, oct, dir };\r\n}\r\n// Return the number of fifths as if it were unaltered\r\nfunction unaltered(f) {\r\n const i = (f + 1) % 7;\r\n return i < 0 ? 7 + i : i;\r\n}\n\nconst NoNote = { empty: true, name: \"\", pc: \"\", acc: \"\" };\r\nconst cache = new Map();\r\nconst stepToLetter = (step) => \"CDEFGAB\".charAt(step);\r\nconst altToAcc = (alt) => alt < 0 ? fillStr(\"b\", -alt) : fillStr(\"#\", alt);\r\nconst accToAlt = (acc) => acc[0] === \"b\" ? -acc.length : acc.length;\r\n/**\r\n * Given a note literal (a note name or a note object), returns the Note object\r\n * @example\r\n * note('Bb4') // => { name: \"Bb4\", midi: 70, chroma: 10, ... }\r\n */\r\nfunction note(src) {\r\n const cached = cache.get(src);\r\n if (cached) {\r\n return cached;\r\n }\r\n const value = typeof src === \"string\"\r\n ? parse(src)\r\n : isPitch(src)\r\n ? note(pitchName(src))\r\n : isNamed(src)\r\n ? note(src.name)\r\n : NoNote;\r\n cache.set(src, value);\r\n return value;\r\n}\r\nconst REGEX = /^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\\d*)\\s*(.*)$/;\r\n/**\r\n * @private\r\n */\r\nfunction tokenizeNote(str) {\r\n const m = REGEX.exec(str);\r\n return [m[1].toUpperCase(), m[2].replace(/x/g, \"##\"), m[3], m[4]];\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction coordToNote(noteCoord) {\r\n return note(decode(noteCoord));\r\n}\r\nconst SEMI = [0, 2, 4, 5, 7, 9, 11];\r\nfunction parse(noteName) {\r\n const tokens = tokenizeNote(noteName);\r\n if (tokens[0] === \"\" || tokens[3] !== \"\") {\r\n return NoNote;\r\n }\r\n const letter = tokens[0];\r\n const acc = tokens[1];\r\n const octStr = tokens[2];\r\n const step = (letter.charCodeAt(0) + 3) % 7;\r\n const alt = accToAlt(acc);\r\n const oct = octStr.length ? +octStr : undefined;\r\n const coord = encode({ step, alt, oct });\r\n const name = letter + acc + octStr;\r\n const pc = letter + acc;\r\n const chroma = (SEMI[step] + alt + 120) % 12;\r\n const o = oct === undefined ? -100 : oct;\r\n const height = SEMI[step] + alt + 12 * (o + 1);\r\n const midi = height >= 0 && height <= 127 ? height : null;\r\n const freq = oct === undefined ? null : Math.pow(2, (height - 69) / 12) * 440;\r\n return {\r\n empty: false,\r\n acc,\r\n alt,\r\n chroma,\r\n coord,\r\n freq,\r\n height,\r\n letter,\r\n midi,\r\n name,\r\n oct,\r\n pc,\r\n step,\r\n };\r\n}\r\nfunction pitchName(props) {\r\n const { step, alt, oct } = props;\r\n const letter = stepToLetter(step);\r\n if (!letter) {\r\n return \"\";\r\n }\r\n const pc = letter + altToAcc(alt);\r\n return oct || oct === 0 ? pc + oct : pc;\r\n}\n\nconst NoInterval = { empty: true, name: \"\", acc: \"\" };\r\n// shorthand tonal notation (with quality after number)\r\nconst INTERVAL_TONAL_REGEX = \"([-+]?\\\\d+)(d{1,4}|m|M|P|A{1,4})\";\r\n// standard shorthand notation (with quality before number)\r\nconst INTERVAL_SHORTHAND_REGEX = \"(AA|A|P|M|m|d|dd)([-+]?\\\\d+)\";\r\nconst REGEX$1 = new RegExp(\"^\" + INTERVAL_TONAL_REGEX + \"|\" + INTERVAL_SHORTHAND_REGEX + \"$\");\r\n/**\r\n * @private\r\n */\r\nfunction tokenizeInterval(str) {\r\n const m = REGEX$1.exec(`${str}`);\r\n if (m === null) {\r\n return [\"\", \"\"];\r\n }\r\n return m[1] ? [m[1], m[2]] : [m[4], m[3]];\r\n}\r\nconst cache$1 = {};\r\n/**\r\n * Get interval properties. It returns an object with:\r\n *\r\n * - name: the interval name\r\n * - num: the interval number\r\n * - type: 'perfectable' or 'majorable'\r\n * - q: the interval quality (d, m, M, A)\r\n * - dir: interval direction (1 ascending, -1 descending)\r\n * - simple: the simplified number\r\n * - semitones: the size in semitones\r\n * - chroma: the interval chroma\r\n *\r\n * @param {string} interval - the interval name\r\n * @return {Object} the interval properties\r\n *\r\n * @example\r\n * import { interval } from '@tonaljs/core'\r\n * interval('P5').semitones // => 7\r\n * interval('m3').type // => 'majorable'\r\n */\r\nfunction interval(src) {\r\n return typeof src === \"string\"\r\n ? cache$1[src] || (cache$1[src] = parse$1(src))\r\n : isPitch(src)\r\n ? interval(pitchName$1(src))\r\n : isNamed(src)\r\n ? interval(src.name)\r\n : NoInterval;\r\n}\r\nconst SIZES = [0, 2, 4, 5, 7, 9, 11];\r\nconst TYPES = \"PMMPPMM\";\r\nfunction parse$1(str) {\r\n const tokens = tokenizeInterval(str);\r\n if (tokens[0] === \"\") {\r\n return NoInterval;\r\n }\r\n const num = +tokens[0];\r\n const q = tokens[1];\r\n const step = (Math.abs(num) - 1) % 7;\r\n const t = TYPES[step];\r\n if (t === \"M\" && q === \"P\") {\r\n return NoInterval;\r\n }\r\n const type = t === \"M\" ? \"majorable\" : \"perfectable\";\r\n const name = \"\" + num + q;\r\n const dir = num < 0 ? -1 : 1;\r\n const simple = num === 8 || num === -8 ? num : dir * (step + 1);\r\n const alt = qToAlt(type, q);\r\n const oct = Math.floor((Math.abs(num) - 1) / 7);\r\n const semitones = dir * (SIZES[step] + alt + 12 * oct);\r\n const chroma = (((dir * (SIZES[step] + alt)) % 12) + 12) % 12;\r\n const coord = encode({ step, alt, oct, dir });\r\n return {\r\n empty: false,\r\n name,\r\n num,\r\n q,\r\n step,\r\n alt,\r\n dir,\r\n type,\r\n simple,\r\n semitones,\r\n chroma,\r\n coord,\r\n oct,\r\n };\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction coordToInterval(coord) {\r\n const [f, o = 0] = coord;\r\n const isDescending = f * 7 + o * 12 < 0;\r\n const ivl = isDescending ? [-f, -o, -1] : [f, o, 1];\r\n return interval(decode(ivl));\r\n}\r\nfunction qToAlt(type, q) {\r\n return (q === \"M\" && type === \"majorable\") ||\r\n (q === \"P\" && type === \"perfectable\")\r\n ? 0\r\n : q === \"m\" && type === \"majorable\"\r\n ? -1\r\n : /^A+$/.test(q)\r\n ? q.length\r\n : /^d+$/.test(q)\r\n ? -1 * (type === \"perfectable\" ? q.length : q.length + 1)\r\n : 0;\r\n}\r\n// return the interval name of a pitch\r\nfunction pitchName$1(props) {\r\n const { step, alt, oct = 0, dir } = props;\r\n if (!dir) {\r\n return \"\";\r\n }\r\n const num = step + 1 + 7 * oct;\r\n const d = dir < 0 ? \"-\" : \"\";\r\n const type = TYPES[step] === \"M\" ? \"majorable\" : \"perfectable\";\r\n const name = d + num + altToQ(type, alt);\r\n return name;\r\n}\r\nfunction altToQ(type, alt) {\r\n if (alt === 0) {\r\n return type === \"majorable\" ? \"M\" : \"P\";\r\n }\r\n else if (alt === -1 && type === \"majorable\") {\r\n return \"m\";\r\n }\r\n else if (alt > 0) {\r\n return fillStr(\"A\", alt);\r\n }\r\n else {\r\n return fillStr(\"d\", type === \"perfectable\" ? alt : alt + 1);\r\n }\r\n}\n\n/**\r\n * Transpose a note by an interval.\r\n *\r\n * @param {string} note - the note or note name\r\n * @param {string} interval - the interval or interval name\r\n * @return {string} the transposed note name or empty string if not valid notes\r\n * @example\r\n * import { tranpose } from \"@tonaljs/core\"\r\n * transpose(\"d3\", \"3M\") // => \"F#3\"\r\n * transpose(\"D\", \"3M\") // => \"F#\"\r\n * [\"C\", \"D\", \"E\", \"F\", \"G\"].map(pc => transpose(pc, \"M3)) // => [\"E\", \"F#\", \"G#\", \"A\", \"B\"]\r\n */\r\nfunction transpose(noteName, intervalName) {\r\n const note$1 = note(noteName);\r\n const interval$1 = interval(intervalName);\r\n if (note$1.empty || interval$1.empty) {\r\n return \"\";\r\n }\r\n const noteCoord = note$1.coord;\r\n const intervalCoord = interval$1.coord;\r\n const tr = noteCoord.length === 1\r\n ? [noteCoord[0] + intervalCoord[0]]\r\n : [noteCoord[0] + intervalCoord[0], noteCoord[1] + intervalCoord[1]];\r\n return coordToNote(tr).name;\r\n}\r\n/**\r\n * Find the interval distance between two notes or coord classes.\r\n *\r\n * To find distance between coord classes, both notes must be coord classes and\r\n * the interval is always ascending\r\n *\r\n * @param {Note|string} from - the note or note name to calculate distance from\r\n * @param {Note|string} to - the note or note name to calculate distance to\r\n * @return {string} the interval name or empty string if not valid notes\r\n *\r\n */\r\nfunction distance(fromNote, toNote) {\r\n const from = note(fromNote);\r\n const to = note(toNote);\r\n if (from.empty || to.empty) {\r\n return \"\";\r\n }\r\n const fcoord = from.coord;\r\n const tcoord = to.coord;\r\n const fifths = tcoord[0] - fcoord[0];\r\n const octs = fcoord.length === 2 && tcoord.length === 2\r\n ? tcoord[1] - fcoord[1]\r\n : -Math.floor((fifths * 7) / 12);\r\n return coordToInterval([fifths, octs]).name;\r\n}\n\nexport { accToAlt, altToAcc, coordToInterval, coordToNote, decode, deprecate, distance, encode, fillStr, interval, isNamed, isPitch, note, stepToLetter, tokenizeInterval, tokenizeNote, transpose };\n//# sourceMappingURL=index.es.js.map\n","import { note, transpose as transpose$1, distance as distance$1 } from '@tonaljs/core';\n\nconst fillStr = (character, times) => Array(times + 1).join(character);\r\nconst REGEX = /^(_{1,}|=|\\^{1,}|)([abcdefgABCDEFG])([,']*)$/;\r\nfunction tokenize(str) {\r\n const m = REGEX.exec(str);\r\n if (!m) {\r\n return [\"\", \"\", \"\"];\r\n }\r\n return [m[1], m[2], m[3]];\r\n}\r\n/**\r\n * Convert a (string) note in ABC notation into a (string) note in scientific notation\r\n *\r\n * @example\r\n * abcToScientificNotation(\"c\") // => \"C5\"\r\n */\r\nfunction abcToScientificNotation(str) {\r\n const [acc, letter, oct] = tokenize(str);\r\n if (letter === \"\") {\r\n return \"\";\r\n }\r\n let o = 4;\r\n for (let i = 0; i < oct.length; i++) {\r\n o += oct.charAt(i) === \",\" ? -1 : 1;\r\n }\r\n const a = acc[0] === \"_\"\r\n ? acc.replace(/_/g, \"b\")\r\n : acc[0] === \"^\"\r\n ? acc.replace(/\\^/g, \"#\")\r\n : \"\";\r\n return letter.charCodeAt(0) > 96\r\n ? letter.toUpperCase() + a + (o + 1)\r\n : letter + a + o;\r\n}\r\n/**\r\n * Convert a (string) note in scientific notation into a (string) note in ABC notation\r\n *\r\n * @example\r\n * scientificToAbcNotation(\"C#4\") // => \"^C\"\r\n */\r\nfunction scientificToAbcNotation(str) {\r\n const n = note(str);\r\n if (n.empty || !n.oct) {\r\n return \"\";\r\n }\r\n const { letter, acc, oct } = n;\r\n const a = acc[0] === \"b\" ? acc.replace(/b/g, \"_\") : acc.replace(/#/g, \"^\");\r\n const l = oct > 4 ? letter.toLowerCase() : letter;\r\n const o = oct === 5 ? \"\" : oct > 4 ? fillStr(\"'\", oct - 5) : fillStr(\",\", 4 - oct);\r\n return a + l + o;\r\n}\r\nfunction transpose(note, interval) {\r\n return scientificToAbcNotation(transpose$1(abcToScientificNotation(note), interval));\r\n}\r\nfunction distance(from, to) {\r\n return distance$1(abcToScientificNotation(from), abcToScientificNotation(to));\r\n}\r\nvar index = {\r\n abcToScientificNotation,\r\n scientificToAbcNotation,\r\n tokenize,\r\n transpose,\r\n distance,\r\n};\n\nexport default index;\nexport { abcToScientificNotation, distance, scientificToAbcNotation, tokenize, transpose };\n//# sourceMappingURL=index.es.js.map\n","import { note } from '@tonaljs/core';\n\n// ascending range\r\nfunction ascR(b, n) {\r\n const a = [];\r\n // tslint:disable-next-line:curly\r\n for (; n--; a[n] = n + b)\r\n ;\r\n return a;\r\n}\r\n// descending range\r\nfunction descR(b, n) {\r\n const a = [];\r\n // tslint:disable-next-line:curly\r\n for (; n--; a[n] = b - n)\r\n ;\r\n return a;\r\n}\r\n/**\r\n * Creates a numeric range\r\n *\r\n * @param {number} from\r\n * @param {number} to\r\n * @return {Array}\r\n *\r\n * @example\r\n * range(-2, 2) // => [-2, -1, 0, 1, 2]\r\n * range(2, -2) // => [2, 1, 0, -1, -2]\r\n */\r\nfunction range(from, to) {\r\n return from < to ? ascR(from, to - from + 1) : descR(from, from - to + 1);\r\n}\r\n/**\r\n * Rotates a list a number of times. It\"s completly agnostic about the\r\n * contents of the list.\r\n *\r\n * @param {Integer} times - the number of rotations\r\n * @param {Array} array\r\n * @return {Array} the rotated array\r\n *\r\n * @example\r\n * rotate(1, [1, 2, 3]) // => [2, 3, 1]\r\n */\r\nfunction rotate(times, arr) {\r\n const len = arr.length;\r\n const n = ((times % len) + len) % len;\r\n return arr.slice(n, len).concat(arr.slice(0, n));\r\n}\r\n/**\r\n * Return a copy of the array with the null values removed\r\n * @function\r\n * @param {Array} array\r\n * @return {Array}\r\n *\r\n * @example\r\n * compact([\"a\", \"b\", null, \"c\"]) // => [\"a\", \"b\", \"c\"]\r\n */\r\nfunction compact(arr) {\r\n return arr.filter((n) => n === 0 || n);\r\n}\r\n/**\r\n * Sort an array of notes in ascending order. Pitch classes are listed\r\n * before notes. Any string that is not a note is removed.\r\n *\r\n * @param {string[]} notes\r\n * @return {string[]} sorted array of notes\r\n *\r\n * @example\r\n * sortedNoteNames(['c2', 'c5', 'c1', 'c0', 'c6', 'c'])\r\n * // => ['C', 'C0', 'C1', 'C2', 'C5', 'C6']\r\n * sortedNoteNames(['c', 'F', 'G', 'a', 'b', 'h', 'J'])\r\n * // => ['C', 'F', 'G', 'A', 'B']\r\n */\r\nfunction sortedNoteNames(notes) {\r\n const valid = notes.map((n) => note(n)).filter((n) => !n.empty);\r\n return valid.sort((a, b) => a.height - b.height).map((n) => n.name);\r\n}\r\n/**\r\n * Get sorted notes with duplicates removed. Pitch classes are listed\r\n * before notes.\r\n *\r\n * @function\r\n * @param {string[]} array\r\n * @return {string[]} unique sorted notes\r\n *\r\n * @example\r\n * Array.sortedUniqNoteNames(['a', 'b', 'c2', '1p', 'p2', 'c2', 'b', 'c', 'c3' ])\r\n * // => [ 'C', 'A', 'B', 'C2', 'C3' ]\r\n */\r\nfunction sortedUniqNoteNames(arr) {\r\n return sortedNoteNames(arr).filter((n, i, a) => i === 0 || n !== a[i - 1]);\r\n}\r\n/**\r\n * Randomizes the order of the specified array in-place, using the Fisher–Yates shuffle.\r\n *\r\n * @function\r\n * @param {Array} array\r\n * @return {Array} the array shuffled\r\n *\r\n * @example\r\n * shuffle([\"C\", \"D\", \"E\", \"F\"]) // => [...]\r\n */\r\nfunction shuffle(arr, rnd = Math.random) {\r\n let i;\r\n let t;\r\n let m = arr.length;\r\n while (m) {\r\n i = Math.floor(rnd() * m--);\r\n t = arr[m];\r\n arr[m] = arr[i];\r\n arr[i] = t;\r\n }\r\n return arr;\r\n}\r\n/**\r\n * Get all permutations of an array\r\n *\r\n * @param {Array} array - the array\r\n * @return {Array} an array with all the permutations\r\n * @example\r\n * permutations([\"a\", \"b\", \"c\"])) // =>\r\n * [\r\n * [\"a\", \"b\", \"c\"],\r\n * [\"b\", \"a\", \"c\"],\r\n * [\"b\", \"c\", \"a\"],\r\n * [\"a\", \"c\", \"b\"],\r\n * [\"c\", \"a\", \"b\"],\r\n * [\"c\", \"b\", \"a\"]\r\n * ]\r\n */\r\nfunction permutations(arr) {\r\n if (arr.length === 0) {\r\n return [[]];\r\n }\r\n return permutations(arr.slice(1)).reduce((acc, perm) => {\r\n return acc.concat(arr.map((e, pos) => {\r\n const newPerm = perm.slice();\r\n newPerm.splice(pos, 0, arr[0]);\r\n return newPerm;\r\n }));\r\n }, []);\r\n}\n\nexport { compact, permutations, range, rotate, shuffle, sortedNoteNames, sortedUniqNoteNames };\n//# sourceMappingURL=index.es.js.map\n","// ascending range\r\nfunction ascR(b, n) {\r\n const a = [];\r\n // tslint:disable-next-line:curly\r\n for (; n--; a[n] = n + b)\r\n ;\r\n return a;\r\n}\r\n// descending range\r\nfunction descR(b, n) {\r\n const a = [];\r\n // tslint:disable-next-line:curly\r\n for (; n--; a[n] = b - n)\r\n ;\r\n return a;\r\n}\r\n/**\r\n * Creates a numeric range\r\n *\r\n * @param {number} from\r\n * @param {number} to\r\n * @return {Array}\r\n *\r\n * @example\r\n * range(-2, 2) // => [-2, -1, 0, 1, 2]\r\n * range(2, -2) // => [2, 1, 0, -1, -2]\r\n */\r\nfunction range(from, to) {\r\n return from < to ? ascR(from, to - from + 1) : descR(from, from - to + 1);\r\n}\r\n/**\r\n * Rotates a list a number of times. It\"s completly agnostic about the\r\n * contents of the list.\r\n *\r\n * @param {Integer} times - the number of rotations\r\n * @param {Array} collection\r\n * @return {Array} the rotated collection\r\n *\r\n * @example\r\n * rotate(1, [1, 2, 3]) // => [2, 3, 1]\r\n */\r\nfunction rotate(times, arr) {\r\n const len = arr.length;\r\n const n = ((times % len) + len) % len;\r\n return arr.slice(n, len).concat(arr.slice(0, n));\r\n}\r\n/**\r\n * Return a copy of the collection with the null values removed\r\n * @function\r\n * @param {Array} collection\r\n * @return {Array}\r\n *\r\n * @example\r\n * compact([\"a\", \"b\", null, \"c\"]) // => [\"a\", \"b\", \"c\"]\r\n */\r\nfunction compact(arr) {\r\n return arr.filter((n) => n === 0 || n);\r\n}\r\n/**\r\n * Randomizes the order of the specified collection in-place, using the Fisher–Yates shuffle.\r\n *\r\n * @function\r\n * @param {Array} collection\r\n * @return {Array} the collection shuffled\r\n *\r\n * @example\r\n * shuffle([\"C\", \"D\", \"E\", \"F\"]) // => [...]\r\n */\r\nfunction shuffle(arr, rnd = Math.random) {\r\n let i;\r\n let t;\r\n let m = arr.length;\r\n while (m) {\r\n i = Math.floor(rnd() * m--);\r\n t = arr[m];\r\n arr[m] = arr[i];\r\n arr[i] = t;\r\n }\r\n return arr;\r\n}\r\n/**\r\n * Get all permutations of an collection\r\n *\r\n * @param {Array} collection - the collection\r\n * @return {Array} an collection with all the permutations\r\n * @example\r\n * permutations([\"a\", \"b\", \"c\"])) // =>\r\n * [\r\n * [\"a\", \"b\", \"c\"],\r\n * [\"b\", \"a\", \"c\"],\r\n * [\"b\", \"c\", \"a\"],\r\n * [\"a\", \"c\", \"b\"],\r\n * [\"c\", \"a\", \"b\"],\r\n * [\"c\", \"b\", \"a\"]\r\n * ]\r\n */\r\nfunction permutations(arr) {\r\n if (arr.length === 0) {\r\n return [[]];\r\n }\r\n return permutations(arr.slice(1)).reduce((acc, perm) => {\r\n return acc.concat(arr.map((e, pos) => {\r\n const newPerm = perm.slice();\r\n newPerm.splice(pos, 0, arr[0]);\r\n return newPerm;\r\n }));\r\n }, []);\r\n}\r\nvar index = {\r\n compact,\r\n permutations,\r\n range,\r\n rotate,\r\n shuffle,\r\n};\n\nexport default index;\nexport { compact, permutations, range, rotate, shuffle };\n//# sourceMappingURL=index.es.js.map\n","import { range, compact, rotate } from '@tonaljs/collection';\nimport { deprecate, note, interval } from '@tonaljs/core';\n\nconst EmptyPcset = {\r\n empty: true,\r\n name: \"\",\r\n setNum: 0,\r\n chroma: \"000000000000\",\r\n normalized: \"000000000000\",\r\n intervals: [],\r\n};\r\n// UTILITIES\r\nconst setNumToChroma = (num) => Number(num).toString(2);\r\nconst chromaToNumber = (chroma) => parseInt(chroma, 2);\r\nconst REGEX = /^[01]{12}$/;\r\nfunction isChroma(set) {\r\n return REGEX.test(set);\r\n}\r\nconst isPcsetNum = (set) => typeof set === \"number\" && set >= 0 && set <= 4095;\r\nconst isPcset = (set) => set && isChroma(set.chroma);\r\nconst cache = { [EmptyPcset.chroma]: EmptyPcset };\r\n/**\r\n * Get the pitch class set of a collection of notes or set number or chroma\r\n */\r\nfunction get(src) {\r\n const chroma = isChroma(src)\r\n ? src\r\n : isPcsetNum(src)\r\n ? setNumToChroma(src)\r\n : Array.isArray(src)\r\n ? listToChroma(src)\r\n : isPcset(src)\r\n ? src.chroma\r\n : EmptyPcset.chroma;\r\n return (cache[chroma] = cache[chroma] || chromaToPcset(chroma));\r\n}\r\n/**\r\n * Use Pcset.properties\r\n * @function\r\n * @deprecated\r\n */\r\nconst pcset = deprecate(\"Pcset.pcset\", \"Pcset.get\", get);\r\n/**\r\n * Get pitch class set chroma\r\n * @function\r\n * @example\r\n * Pcset.chroma([\"c\", \"d\", \"e\"]); //=> \"101010000000\"\r\n */\r\nconst chroma = (set) => get(set).chroma;\r\n/**\r\n * Get intervals (from C) of a set\r\n * @function\r\n * @example\r\n * Pcset.intervals([\"c\", \"d\", \"e\"]); //=>\r\n */\r\nconst intervals = (set) => get(set).intervals;\r\n/**\r\n * Get pitch class set number\r\n * @function\r\n * @example\r\n * Pcset.num([\"c\", \"d\", \"e\"]); //=> 2192\r\n */\r\nconst num = (set) => get(set).setNum;\r\nconst IVLS = [\r\n \"1P\",\r\n \"2m\",\r\n \"2M\",\r\n \"3m\",\r\n \"3M\",\r\n \"4P\",\r\n \"5d\",\r\n \"5P\",\r\n \"6m\",\r\n \"6M\",\r\n \"7m\",\r\n \"7M\",\r\n];\r\n/**\r\n * @private\r\n * Get the intervals of a pcset *starting from C*\r\n * @param {Set} set - the pitch class set\r\n * @return {IntervalName[]} an array of interval names or an empty array\r\n * if not a valid pitch class set\r\n */\r\nfunction chromaToIntervals(chroma) {\r\n const intervals = [];\r\n for (let i = 0; i < 12; i++) {\r\n // tslint:disable-next-line:curly\r\n if (chroma.charAt(i) === \"1\")\r\n intervals.push(IVLS[i]);\r\n }\r\n return intervals;\r\n}\r\n/**\r\n * Get a list of all possible pitch class sets (all possible chromas) *having\r\n * C as root*. There are 2048 different chromas. If you want them with another\r\n * note you have to transpose it\r\n *\r\n * @see http://allthescales.org/\r\n * @return {Array} an array of possible chromas from '10000000000' to '11111111111'\r\n */\r\nfunction chromas() {\r\n return range(2048, 4095).map(setNumToChroma);\r\n}\r\n/**\r\n * Given a a list of notes or a pcset chroma, produce the rotations\r\n * of the chroma discarding the ones that starts with \"0\"\r\n *\r\n * This is used, for example, to get all the modes of a scale.\r\n *\r\n * @param {Array|string} set - the list of notes or pitchChr of the set\r\n * @param {boolean} normalize - (Optional, true by default) remove all\r\n * the rotations that starts with \"0\"\r\n * @return {Array} an array with all the modes of the chroma\r\n *\r\n * @example\r\n * Pcset.modes([\"C\", \"D\", \"E\"]).map(Pcset.intervals)\r\n */\r\nfunction modes(set, normalize = true) {\r\n const pcs = get(set);\r\n const binary = pcs.chroma.split(\"\");\r\n return compact(binary.map((_, i) => {\r\n const r = rotate(i, binary);\r\n return normalize && r[0] === \"0\" ? null : r.join(\"\");\r\n }));\r\n}\r\n/**\r\n * Test if two pitch class sets are numentical\r\n *\r\n * @param {Array|string} set1 - one of the pitch class sets\r\n * @param {Array|string} set2 - the other pitch class set\r\n * @return {boolean} true if they are equal\r\n * @example\r\n * Pcset.isEqual([\"c2\", \"d3\"], [\"c5\", \"d2\"]) // => true\r\n */\r\nfunction isEqual(s1, s2) {\r\n return get(s1).setNum === get(s2).setNum;\r\n}\r\n/**\r\n * Create a function that test if a collection of notes is a\r\n * subset of a given set\r\n *\r\n * The function is curryfied.\r\n *\r\n * @param {PcsetChroma|NoteName[]} set - the superset to test against (chroma or\r\n * list of notes)\r\n * @return{function(PcsetChroma|NoteNames[]): boolean} a function accepting a set\r\n * to test against (chroma or list of notes)\r\n * @example\r\n * const inCMajor = Pcset.isSubsetOf([\"C\", \"E\", \"G\"])\r\n * inCMajor([\"e6\", \"c4\"]) // => true\r\n * inCMajor([\"e6\", \"c4\", \"d3\"]) // => false\r\n */\r\nfunction isSubsetOf(set) {\r\n const s = get(set).setNum;\r\n return (notes) => {\r\n const o = get(notes).setNum;\r\n // tslint:disable-next-line: no-bitwise\r\n return s && s !== o && (o & s) === o;\r\n };\r\n}\r\n/**\r\n * Create a function that test if a collection of notes is a\r\n * superset of a given set (it contains all notes and at least one more)\r\n *\r\n * @param {Set} set - an array of notes or a chroma set string to test against\r\n * @return {(subset: Set): boolean} a function that given a set\r\n * returns true if is a subset of the first one\r\n * @example\r\n * const extendsCMajor = Pcset.isSupersetOf([\"C\", \"E\", \"G\"])\r\n * extendsCMajor([\"e6\", \"a\", \"c4\", \"g2\"]) // => true\r\n * extendsCMajor([\"c6\", \"e4\", \"g3\"]) // => false\r\n */\r\nfunction isSupersetOf(set) {\r\n const s = get(set).setNum;\r\n return (notes) => {\r\n const o = get(notes).setNum;\r\n // tslint:disable-next-line: no-bitwise\r\n return s && s !== o && (o | s) === o;\r\n };\r\n}\r\n/**\r\n * Test if a given pitch class set includes a note\r\n *\r\n * @param {Array} set - the base set to test against\r\n * @param {string} note - the note to test\r\n * @return {boolean} true if the note is included in the pcset\r\n *\r\n * Can be partially applied\r\n *\r\n * @example\r\n * const isNoteInCMajor = isNoteIncludedIn(['C', 'E', 'G'])\r\n * isNoteInCMajor('C4') // => true\r\n * isNoteInCMajor('C#4') // => false\r\n */\r\nfunction isNoteIncludedIn(set) {\r\n const s = get(set);\r\n return (noteName) => {\r\n const n = note(noteName);\r\n return s && !n.empty && s.chroma.charAt(n.chroma) === \"1\";\r\n };\r\n}\r\n/** @deprecated use: isNoteIncludedIn */\r\nconst includes = isNoteIncludedIn;\r\n/**\r\n * Filter a list with a pitch class set\r\n *\r\n * @param {Array|string} set - the pitch class set notes\r\n * @param {Array|string} notes - the note list to be filtered\r\n * @return {Array} the filtered notes\r\n *\r\n * @example\r\n * Pcset.filter([\"C\", \"D\", \"E\"], [\"c2\", \"c#2\", \"d2\", \"c3\", \"c#3\", \"d3\"]) // => [ \"c2\", \"d2\", \"c3\", \"d3\" ])\r\n * Pcset.filter([\"C2\"], [\"c2\", \"c#2\", \"d2\", \"c3\", \"c#3\", \"d3\"]) // => [ \"c2\", \"c3\" ])\r\n */\r\nfunction filter(set) {\r\n const isIncluded = isNoteIncludedIn(set);\r\n return (notes) => {\r\n return notes.filter(isIncluded);\r\n };\r\n}\r\nvar index = {\r\n get,\r\n chroma,\r\n num,\r\n intervals,\r\n chromas,\r\n isSupersetOf,\r\n isSubsetOf,\r\n isNoteIncludedIn,\r\n isEqual,\r\n filter,\r\n modes,\r\n // deprecated\r\n pcset,\r\n};\r\n//// PRIVATE ////\r\nfunction chromaRotations(chroma) {\r\n const binary = chroma.split(\"\");\r\n return binary.map((_, i) => rotate(i, binary).join(\"\"));\r\n}\r\nfunction chromaToPcset(chroma) {\r\n const setNum = chromaToNumber(chroma);\r\n const normalizedNum = chromaRotations(chroma)\r\n .map(chromaToNumber)\r\n .filter((n) => n >= 2048)\r\n .sort()[0];\r\n const normalized = setNumToChroma(normalizedNum);\r\n const intervals = chromaToIntervals(chroma);\r\n return {\r\n empty: false,\r\n name: \"\",\r\n setNum,\r\n chroma,\r\n normalized,\r\n intervals,\r\n };\r\n}\r\nfunction listToChroma(set) {\r\n if (set.length === 0) {\r\n return EmptyPcset.chroma;\r\n }\r\n let pitch;\r\n const binary = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\r\n // tslint:disable-next-line:prefer-for-of\r\n for (let i = 0; i < set.length; i++) {\r\n pitch = note(set[i]);\r\n // tslint:disable-next-line: curly\r\n if (pitch.empty)\r\n pitch = interval(set[i]);\r\n // tslint:disable-next-line: curly\r\n if (!pitch.empty)\r\n binary[pitch.chroma] = 1;\r\n }\r\n return binary.join(\"\");\r\n}\n\nexport default index;\nexport { EmptyPcset, chromaToIntervals, chromas, filter, get, includes, isEqual, isNoteIncludedIn, isSubsetOf, isSupersetOf, modes, pcset };\n//# sourceMappingURL=index.es.js.map\n","import { deprecate } from '@tonaljs/core';\nimport { get as get$1, EmptyPcset } from '@tonaljs/pcset';\n\n/**\r\n * @private\r\n * Chord List\r\n * Source: https://en.wikibooks.org/wiki/Music_Theory/Complete_List_of_Chord_Patterns\r\n * Format: [\"intervals\", \"full name\", \"abrv1 abrv2\"]\r\n */\r\nconst CHORDS = [\r\n // ==Major==\r\n [\"1P 3M 5P\", \"major\", \"M \"],\r\n [\"1P 3M 5P 7M\", \"major seventh\", \"maj7 Δ ma7 M7 Maj7\"],\r\n [\"1P 3M 5P 7M 9M\", \"major ninth\", \"maj9 Δ9\"],\r\n [\"1P 3M 5P 7M 9M 13M\", \"major thirteenth\", \"maj13 Maj13\"],\r\n [\"1P 3M 5P 6M\", \"sixth\", \"6 add6 add13 M6\"],\r\n [\"1P 3M 5P 6M 9M\", \"sixth/ninth\", \"6/9 69\"],\r\n [\"1P 3M 5P 7M 11A\", \"lydian\", \"maj#4 Δ#4 Δ#11\"],\r\n [\"1P 3M 6m 7M\", \"major seventh flat sixth\", \"M7b6\"],\r\n // ==Minor==\r\n // '''Normal'''\r\n [\"1P 3m 5P\", \"minor\", \"m min -\"],\r\n [\"1P 3m 5P 7m\", \"minor seventh\", \"m7 min7 mi7 -7\"],\r\n [\"1P 3m 5P 7M\", \"minor/major seventh\", \"m/ma7 m/maj7 mM7 m/M7 -Δ7 mΔ\"],\r\n [\"1P 3m 5P 6M\", \"minor sixth\", \"m6\"],\r\n [\"1P 3m 5P 7m 9M\", \"minor ninth\", \"m9\"],\r\n [\"1P 3m 5P 7m 9M 11P\", \"minor eleventh\", \"m11\"],\r\n [\"1P 3m 5P 7m 9M 13M\", \"minor thirteenth\", \"m13\"],\r\n // '''Diminished'''\r\n [\"1P 3m 5d\", \"diminished\", \"dim ° o\"],\r\n [\"1P 3m 5d 7d\", \"diminished seventh\", \"dim7 °7 o7\"],\r\n [\"1P 3m 5d 7m\", \"half-diminished\", \"m7b5 ø\"],\r\n // ==Dominant/Seventh==\r\n // '''Normal'''\r\n [\"1P 3M 5P 7m\", \"dominant seventh\", \"7 dom\"],\r\n [\"1P 3M 5P 7m 9M\", \"dominant ninth\", \"9\"],\r\n [\"1P 3M 5P 7m 9M 13M\", \"dominant thirteenth\", \"13\"],\r\n [\"1P 3M 5P 7m 11A\", \"lydian dominant seventh\", \"7#11 7#4\"],\r\n // '''Altered'''\r\n [\"1P 3M 5P 7m 9m\", \"dominant flat ninth\", \"7b9\"],\r\n [\"1P 3M 5P 7m 9A\", \"dominant sharp ninth\", \"7#9\"],\r\n [\"1P 3M 7m 9m\", \"altered\", \"alt7\"],\r\n // '''Suspended'''\r\n [\"1P 4P 5P\", \"suspended fourth\", \"sus4\"],\r\n [\"1P 2M 5P\", \"suspended second\", \"sus2\"],\r\n [\"1P 4P 5P 7m\", \"suspended fourth seventh\", \"7sus4\"],\r\n [\"1P 5P 7m 9M 11P\", \"eleventh\", \"11\"],\r\n [\"1P 4P 5P 7m 9m\", \"suspended fourth flat ninth\", \"b9sus phryg\"],\r\n // ==Other==\r\n [\"1P 5P\", \"fifth\", \"5\"],\r\n [\"1P 3M 5A\", \"augmented\", \"aug + +5\"],\r\n [\"1P 3M 5A 7M\", \"augmented seventh\", \"maj7#5 maj7+5\"],\r\n [\"1P 3M 5P 7M 9M 11A\", \"major sharp eleventh (lydian)\", \"maj9#11 Δ9#11\"],\r\n // ==Legacy==\r\n [\"1P 2M 4P 5P\", \"\", \"sus24 sus4add9\"],\r\n [\"1P 3M 13m\", \"\", \"Mb6\"],\r\n [\"1P 3M 5A 7M 9M\", \"\", \"maj9#5 Maj9#5\"],\r\n [\"1P 3M 5A 7m\", \"\", \"7#5 +7 7aug aug7\"],\r\n [\"1P 3M 5A 7m 9A\", \"\", \"7#5#9 7alt\"],\r\n [\"1P 3M 5A 7m 9M\", \"\", \"9#5 9+\"],\r\n [\"1P 3M 5A 7m 9M 11A\", \"\", \"9#5#11\"],\r\n [\"1P 3M 5A 7m 9m\", \"\", \"7#5b9\"],\r\n [\"1P 3M 5A 7m 9m 11A\", \"\", \"7#5b9#11\"],\r\n [\"1P 3M 5A 9A\", \"\", \"+add#9\"],\r\n [\"1P 3M 5A 9M\", \"\", \"M#5add9 +add9\"],\r\n [\"1P 3M 5P 6M 11A\", \"\", \"M6#11 M6b5 6#11 6b5\"],\r\n [\"1P 3M 5P 6M 7M 9M\", \"\", \"M7add13\"],\r\n [\"1P 3M 5P 6M 9M 11A\", \"\", \"69#11\"],\r\n [\"1P 3M 5P 6m 7m\", \"\", \"7b6\"],\r\n [\"1P 3M 5P 7M 9A 11A\", \"\", \"maj7#9#11\"],\r\n [\"1P 3M 5P 7M 9M 11A 13M\", \"\", \"M13#11 maj13#11 M13+4 M13#4\"],\r\n [\"1P 3M 5P 7M 9m\", \"\", \"M7b9\"],\r\n [\"1P 3M 5P 7m 11A 13m\", \"\", \"7#11b13 7b5b13\"],\r\n [\"1P 3M 5P 7m 13M\", \"\", \"7add6 67 7add13\"],\r\n [\"1P 3M 5P 7m 9A 11A\", \"\", \"7#9#11 7b5#9\"],\r\n [\"1P 3M 5P 7m 9A 11A 13M\", \"\", \"13#9#11\"],\r\n [\"1P 3M 5P 7m 9A 11A 13m\", \"\", \"7#9#11b13\"],\r\n [\"1P 3M 5P 7m 9A 13M\", \"\", \"13#9\"],\r\n [\"1P 3M 5P 7m 9A 13m\", \"\", \"7#9b13\"],\r\n [\"1P 3M 5P 7m 9M 11A\", \"\", \"9#11 9+4 9#4\"],\r\n [\"1P 3M 5P 7m 9M 11A 13M\", \"\", \"13#11 13+4 13#4\"],\r\n [\"1P 3M 5P 7m 9M 11A 13m\", \"\", \"9#11b13 9b5b13\"],\r\n [\"1P 3M 5P 7m 9m 11A\", \"\", \"7b9#11 7b5b9\"],\r\n [\"1P 3M 5P 7m 9m 11A 13M\", \"\", \"13b9#11\"],\r\n [\"1P 3M 5P 7m 9m 11A 13m\", \"\", \"7b9b13#11 7b9#11b13 7b5b9b13\"],\r\n [\"1P 3M 5P 7m 9m 13M\", \"\", \"13b9\"],\r\n [\"1P 3M 5P 7m 9m 13m\", \"\", \"7b9b13\"],\r\n [\"1P 3M 5P 7m 9m 9A\", \"\", \"7b9#9\"],\r\n [\"1P 3M 5P 9M\", \"\", \"Madd9 2 add9 add2\"],\r\n [\"1P 3M 5P 9m\", \"\", \"Maddb9\"],\r\n [\"1P 3M 5d\", \"\", \"Mb5\"],\r\n [\"1P 3M 5d 6M 7m 9M\", \"\", \"13b5\"],\r\n [\"1P 3M 5d 7M\", \"\", \"M7b5\"],\r\n [\"1P 3M 5d 7M 9M\", \"\", \"M9b5\"],\r\n [\"1P 3M 5d 7m\", \"\", \"7b5\"],\r\n [\"1P 3M 5d 7m 9M\", \"\", \"9b5\"],\r\n [\"1P 3M 7m\", \"\", \"7no5\"],\r\n [\"1P 3M 7m 13m\", \"\", \"7b13\"],\r\n [\"1P 3M 7m 9M\", \"\", \"9no5\"],\r\n [\"1P 3M 7m 9M 13M\", \"\", \"13no5\"],\r\n [\"1P 3M 7m 9M 13m\", \"\", \"9b13\"],\r\n [\"1P 3m 4P 5P\", \"\", \"madd4\"],\r\n [\"1P 3m 5A\", \"\", \"m#5 m+ mb6\"],\r\n [\"1P 3m 5P 6M 9M\", \"\", \"m69\"],\r\n [\"1P 3m 5P 6m 7M\", \"\", \"mMaj7b6\"],\r\n [\"1P 3m 5P 6m 7M 9M\", \"\", \"mMaj9b6\"],\r\n [\"1P 3m 5P 7M 9M\", \"\", \"mMaj9\"],\r\n [\"1P 3m 5P 7m 11P\", \"\", \"m7add11 m7add4\"],\r\n [\"1P 3m 5P 9M\", \"\", \"madd9\"],\r\n [\"1P 3m 5d 6M 7M\", \"\", \"o7M7\"],\r\n [\"1P 3m 5d 7M\", \"\", \"oM7\"],\r\n [\"1P 3m 6m 7M\", \"\", \"mb6M7\"],\r\n [\"1P 3m 6m 7m\", \"\", \"m7#5\"],\r\n [\"1P 3m 6m 7m 9M\", \"\", \"m9#5\"],\r\n [\"1P 3m 6m 7m 9M 11P\", \"\", \"m11A\"],\r\n [\"1P 3m 6m 9m\", \"\", \"mb6b9\"],\r\n [\"1P 2M 3m 5d 7m\", \"\", \"m9b5\"],\r\n [\"1P 4P 5A 7M\", \"\", \"M7#5sus4\"],\r\n [\"1P 4P 5A 7M 9M\", \"\", \"M9#5sus4\"],\r\n [\"1P 4P 5A 7m\", \"\", \"7#5sus4\"],\r\n [\"1P 4P 5P 7M\", \"\", \"M7sus4\"],\r\n [\"1P 4P 5P 7M 9M\", \"\", \"M9sus4\"],\r\n [\"1P 4P 5P 7m 9M\", \"\", \"9sus4 9sus\"],\r\n [\"1P 4P 5P 7m 9M 13M\", \"\", \"13sus4 13sus\"],\r\n [\"1P 4P 5P 7m 9m 13m\", \"\", \"7sus4b9b13 7b9b13sus4\"],\r\n [\"1P 4P 7m 10m\", \"\", \"4 quartal\"],\r\n [\"1P 5P 7m 9m 11P\", \"\", \"11b9\"],\r\n];\n\nconst NoChordType = {\r\n ...EmptyPcset,\r\n name: \"\",\r\n quality: \"Unknown\",\r\n intervals: [],\r\n aliases: [],\r\n};\r\nlet dictionary = [];\r\nlet index = {};\r\n/**\r\n * Given a chord name or chroma, return the chord properties\r\n * @param {string} source - chord name or pitch class set chroma\r\n * @example\r\n * import { get } from 'tonaljs/chord-type'\r\n * get('major') // => { name: 'major', ... }\r\n */\r\nfunction get(type) {\r\n return index[type] || NoChordType;\r\n}\r\nconst chordType = deprecate(\"ChordType.chordType\", \"ChordType.get\", get);\r\n/**\r\n * Get all chord (long) names\r\n */\r\nfunction names() {\r\n return dictionary.map((chord) => chord.name).filter((x) => x);\r\n}\r\n/**\r\n * Get all chord symbols\r\n */\r\nfunction symbols() {\r\n return dictionary.map((chord) => chord.aliases[0]).filter((x) => x);\r\n}\r\n/**\r\n * Keys used to reference chord types\r\n */\r\nfunction keys() {\r\n return Object.keys(index);\r\n}\r\n/**\r\n * Return a list of all chord types\r\n */\r\nfunction all() {\r\n return dictionary.slice();\r\n}\r\nconst entries = deprecate(\"ChordType.entries\", \"ChordType.all\", all);\r\n/**\r\n * Clear the dictionary\r\n */\r\nfunction removeAll() {\r\n dictionary = [];\r\n index = {};\r\n}\r\n/**\r\n * Add a chord to the dictionary.\r\n * @param intervals\r\n * @param aliases\r\n * @param [fullName]\r\n */\r\nfunction add(intervals, aliases, fullName) {\r\n const quality = getQuality(intervals);\r\n const chord = {\r\n ...get$1(intervals),\r\n name: fullName || \"\",\r\n quality,\r\n intervals,\r\n aliases,\r\n };\r\n dictionary.push(chord);\r\n if (chord.name) {\r\n index[chord.name] = chord;\r\n }\r\n index[chord.setNum] = chord;\r\n index[chord.chroma] = chord;\r\n chord.aliases.forEach((alias) => addAlias(chord, alias));\r\n}\r\nfunction addAlias(chord, alias) {\r\n index[alias] = chord;\r\n}\r\nfunction getQuality(intervals) {\r\n const has = (interval) => intervals.indexOf(interval) !== -1;\r\n return has(\"5A\")\r\n ? \"Augmented\"\r\n : has(\"3M\")\r\n ? \"Major\"\r\n : has(\"5d\")\r\n ? \"Diminished\"\r\n : has(\"3m\")\r\n ? \"Minor\"\r\n : \"Unknown\";\r\n}\r\nCHORDS.forEach(([ivls, fullName, names]) => add(ivls.split(\" \"), names.split(\" \"), fullName));\r\ndictionary.sort((a, b) => a.setNum - b.setNum);\r\nvar index$1 = {\r\n names,\r\n symbols,\r\n get,\r\n all,\r\n add,\r\n removeAll,\r\n keys,\r\n // deprecated\r\n entries,\r\n chordType,\r\n};\n\nexport default index$1;\nexport { add, addAlias, all, chordType, entries, get, keys, names, removeAll, symbols };\n//# sourceMappingURL=index.es.js.map\n","import { get } from '@tonaljs/chord-type';\nimport { note } from '@tonaljs/core';\nimport { modes } from '@tonaljs/pcset';\n\nconst NotFound = { weight: 0, name: \"\" };\r\nconst namedSet = (notes) => {\r\n const pcToName = notes.reduce((record, n) => {\r\n const chroma = note(n).chroma;\r\n if (chroma !== undefined) {\r\n record[chroma] = record[chroma] || note(n).name;\r\n }\r\n return record;\r\n }, {});\r\n return (chroma) => pcToName[chroma];\r\n};\r\nfunction detect(source) {\r\n const notes = source.map((n) => note(n).pc).filter((x) => x);\r\n if (note.length === 0) {\r\n return [];\r\n }\r\n const found = findExactMatches(notes, 1);\r\n return found\r\n .filter((chord) => chord.weight)\r\n .sort((a, b) => b.weight - a.weight)\r\n .map((chord) => chord.name);\r\n}\r\nfunction findExactMatches(notes, weight) {\r\n const tonic = notes[0];\r\n const tonicChroma = note(tonic).chroma;\r\n const noteName = namedSet(notes);\r\n const allModes = modes(notes, false);\r\n const found = allModes.map((mode, chroma) => {\r\n const chordName = get(mode).aliases[0];\r\n if (!chordName) {\r\n return NotFound;\r\n }\r\n const baseNote = noteName(chroma);\r\n const isInversion = chroma !== tonicChroma;\r\n if (isInversion) {\r\n return { weight: 0.5 * weight, name: `${baseNote}${chordName}/${tonic}` };\r\n }\r\n else {\r\n return { weight: 1 * weight, name: `${baseNote}${chordName}` };\r\n }\r\n });\r\n return found;\r\n}\r\nvar index = { detect };\n\nexport default index;\nexport { detect };\n//# sourceMappingURL=index.es.js.map\n","import { deprecate } from '@tonaljs/core';\nimport { EmptyPcset, get as get$1 } from '@tonaljs/pcset';\n\n// SCALES\r\n// Format: [\"intervals\", \"name\", \"alias1\", \"alias2\", ...]\r\nconst SCALES = [\r\n // 5-note scales\r\n [\"1P 2M 3M 5P 6M\", \"major pentatonic\", \"pentatonic\"],\r\n [\"1P 3M 4P 5P 7M\", \"ionian pentatonic\"],\r\n [\"1P 3M 4P 5P 7m\", \"mixolydian pentatonic\", \"indian\"],\r\n [\"1P 2M 4P 5P 6M\", \"ritusen\"],\r\n [\"1P 2M 4P 5P 7m\", \"egyptian\"],\r\n [\"1P 3M 4P 5d 7m\", \"neopolitan major pentatonic\"],\r\n [\"1P 3m 4P 5P 6m\", \"vietnamese 1\"],\r\n [\"1P 2m 3m 5P 6m\", \"pelog\"],\r\n [\"1P 2m 4P 5P 6m\", \"kumoijoshi\"],\r\n [\"1P 2M 3m 5P 6m\", \"hirajoshi\"],\r\n [\"1P 2m 4P 5d 7m\", \"iwato\"],\r\n [\"1P 2m 4P 5P 7m\", \"in-sen\"],\r\n [\"1P 3M 4A 5P 7M\", \"lydian pentatonic\", \"chinese\"],\r\n [\"1P 3m 4P 6m 7m\", \"malkos raga\"],\r\n [\"1P 3m 4P 5d 7m\", \"locrian pentatonic\", \"minor seven flat five pentatonic\"],\r\n [\"1P 3m 4P 5P 7m\", \"minor pentatonic\", \"vietnamese 2\"],\r\n [\"1P 3m 4P 5P 6M\", \"minor six pentatonic\"],\r\n [\"1P 2M 3m 5P 6M\", \"flat three pentatonic\", \"kumoi\"],\r\n [\"1P 2M 3M 5P 6m\", \"flat six pentatonic\"],\r\n [\"1P 2m 3M 5P 6M\", \"scriabin\"],\r\n [\"1P 3M 5d 6m 7m\", \"whole tone pentatonic\"],\r\n [\"1P 3M 4A 5A 7M\", \"lydian #5P pentatonic\"],\r\n [\"1P 3M 4A 5P 7m\", \"lydian dominant pentatonic\"],\r\n [\"1P 3m 4P 5P 7M\", \"minor #7M pentatonic\"],\r\n [\"1P 3m 4d 5d 7m\", \"super locrian pentatonic\"],\r\n // 6-note scales\r\n [\"1P 2M 3m 4P 5P 7M\", \"minor hexatonic\"],\r\n [\"1P 2A 3M 5P 5A 7M\", \"augmented\"],\r\n [\"1P 2M 3m 3M 5P 6M\", \"major blues\"],\r\n [\"1P 2M 4P 5P 6M 7m\", \"piongio\"],\r\n [\"1P 2m 3M 4A 6M 7m\", \"prometheus neopolitan\"],\r\n [\"1P 2M 3M 4A 6M 7m\", \"prometheus\"],\r\n [\"1P 2m 3M 5d 6m 7m\", \"mystery #1\"],\r\n [\"1P 2m 3M 4P 5A 6M\", \"six tone symmetric\"],\r\n [\"1P 2M 3M 4A 5A 7m\", \"whole tone\", \"messiaen's mode #1\"],\r\n [\"1P 2m 4P 4A 5P 7M\", \"messiaen's mode #5\"],\r\n [\"1P 3m 4P 5d 5P 7m\", \"minor blues\", \"blues\"],\r\n // 7-note scales\r\n [\"1P 2M 3M 4P 5d 6m 7m\", \"locrian major\", \"arabian\"],\r\n [\"1P 2m 3M 4A 5P 6m 7M\", \"double harmonic lydian\"],\r\n [\"1P 2M 3m 4P 5P 6m 7M\", \"harmonic minor\"],\r\n [\r\n \"1P 2m 3m 3M 5d 6m 7m\",\r\n \"altered\",\r\n \"super locrian\",\r\n \"diminished whole tone\",\r\n \"pomeroy\",\r\n ],\r\n [\"1P 2M 3m 4P 5d 6m 7m\", \"locrian #2\", \"half-diminished\", \"aeolian b5\"],\r\n [\r\n \"1P 2M 3M 4P 5P 6m 7m\",\r\n \"mixolydian b6\",\r\n \"melodic minor fifth mode\",\r\n \"hindu\",\r\n ],\r\n [\"1P 2M 3M 4A 5P 6M 7m\", \"lydian dominant\", \"lydian b7\", \"overtone\"],\r\n [\"1P 2M 3M 4A 5P 6M 7M\", \"lydian\"],\r\n [\"1P 2M 3M 4A 5A 6M 7M\", \"lydian augmented\"],\r\n [\r\n \"1P 2m 3m 4P 5P 6M 7m\",\r\n \"dorian b2\",\r\n \"phrygian #6\",\r\n \"melodic minor second mode\",\r\n ],\r\n [\"1P 2M 3m 4P 5P 6M 7M\", \"melodic minor\"],\r\n [\"1P 2m 3m 4P 5d 6m 7m\", \"locrian\"],\r\n [\r\n \"1P 2m 3m 4d 5d 6m 7d\",\r\n \"ultralocrian\",\r\n \"superlocrian bb7\",\r\n \"·superlocrian diminished\",\r\n ],\r\n [\"1P 2m 3m 4P 5d 6M 7m\", \"locrian 6\", \"locrian natural 6\", \"locrian sharp 6\"],\r\n [\"1P 2A 3M 4P 5P 5A 7M\", \"augmented heptatonic\"],\r\n [\"1P 2M 3m 5d 5P 6M 7m\", \"romanian minor\"],\r\n [\"1P 2M 3m 4A 5P 6M 7m\", \"dorian #4\"],\r\n [\"1P 2M 3m 4A 5P 6M 7M\", \"lydian diminished\"],\r\n [\"1P 2m 3m 4P 5P 6m 7m\", \"phrygian\"],\r\n [\"1P 2M 3M 4A 5A 7m 7M\", \"leading whole tone\"],\r\n [\"1P 2M 3M 4A 5P 6m 7m\", \"lydian minor\"],\r\n [\"1P 2m 3M 4P 5P 6m 7m\", \"phrygian dominant\", \"spanish\", \"phrygian major\"],\r\n [\"1P 2m 3m 4P 5P 6m 7M\", \"balinese\"],\r\n [\"1P 2m 3m 4P 5P 6M 7M\", \"neopolitan major\"],\r\n [\"1P 2M 3m 4P 5P 6m 7m\", \"aeolian\", \"minor\"],\r\n [\"1P 2M 3M 4P 5P 6m 7M\", \"harmonic major\"],\r\n [\"1P 2m 3M 4P 5P 6m 7M\", \"double harmonic major\", \"gypsy\"],\r\n [\"1P 2M 3m 4P 5P 6M 7m\", \"dorian\"],\r\n [\"1P 2M 3m 4A 5P 6m 7M\", \"hungarian minor\"],\r\n [\"1P 2A 3M 4A 5P 6M 7m\", \"hungarian major\"],\r\n [\"1P 2m 3M 4P 5d 6M 7m\", \"oriental\"],\r\n [\"1P 2m 3m 3M 4A 5P 7m\", \"flamenco\"],\r\n [\"1P 2m 3m 4A 5P 6m 7M\", \"todi raga\"],\r\n [\"1P 2M 3M 4P 5P 6M 7m\", \"mixolydian\", \"dominant\"],\r\n [\"1P 2m 3M 4P 5d 6m 7M\", \"persian\"],\r\n [\"1P 2M 3M 4P 5P 6M 7M\", \"major\", \"ionian\"],\r\n [\"1P 2m 3M 5d 6m 7m 7M\", \"enigmatic\"],\r\n [\r\n \"1P 2M 3M 4P 5A 6M 7M\",\r\n \"major augmented\",\r\n \"major #5\",\r\n \"ionian augmented\",\r\n \"ionian #5\",\r\n ],\r\n [\"1P 2A 3M 4A 5P 6M 7M\", \"lydian #9\"],\r\n // 8-note scales\r\n [\"1P 2m 2M 4P 4A 5P 6m 7M\", \"messiaen's mode #4\"],\r\n [\"1P 2m 3M 4P 4A 5P 6m 7M\", \"purvi raga\"],\r\n [\"1P 2m 3m 3M 4P 5P 6m 7m\", \"spanish heptatonic\"],\r\n [\"1P 2M 3M 4P 5P 6M 7m 7M\", \"bebop\"],\r\n [\"1P 2M 3m 3M 4P 5P 6M 7m\", \"bebop minor\"],\r\n [\"1P 2M 3M 4P 5P 5A 6M 7M\", \"bebop major\"],\r\n [\"1P 2m 3m 4P 5d 5P 6m 7m\", \"bebop locrian\"],\r\n [\"1P 2M 3m 4P 5P 6m 7m 7M\", \"minor bebop\"],\r\n [\"1P 2M 3m 4P 5d 6m 6M 7M\", \"diminished\", \"whole-half diminished\"],\r\n [\"1P 2M 3M 4P 5d 5P 6M 7M\", \"ichikosucho\"],\r\n [\"1P 2M 3m 4P 5P 6m 6M 7M\", \"minor six diminished\"],\r\n [\"1P 2m 3m 3M 4A 5P 6M 7m\", \"half-whole diminished\", \"dominant diminished\", \"messiaen's mode #2\"],\r\n [\"1P 3m 3M 4P 5P 6M 7m 7M\", \"kafi raga\"],\r\n [\"1P 2M 3M 4P 4A 5A 6A 7M\", \"messiaen's mode #6\"],\r\n // 9-note scales\r\n [\"1P 2M 3m 3M 4P 5d 5P 6M 7m\", \"composite blues\"],\r\n [\"1P 2M 3m 3M 4A 5P 6m 7m 7M\", \"messiaen's mode #3\"],\r\n // 10-note scales\r\n [\"1P 2m 2M 3m 4P 4A 5P 6m 6M 7M\", \"messiaen's mode #7\"],\r\n // 12-note scales\r\n [\"1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M\", \"chromatic\"],\r\n];\n\nconst NoScaleType = {\r\n ...EmptyPcset,\r\n intervals: [],\r\n aliases: [],\r\n};\r\nlet dictionary = [];\r\nlet index = {};\r\nfunction names() {\r\n return dictionary.map((scale) => scale.name);\r\n}\r\n/**\r\n * Given a scale name or chroma, return the scale properties\r\n *\r\n * @param {string} type - scale name or pitch class set chroma\r\n * @example\r\n * import { get } from 'tonaljs/scale-type'\r\n * get('major') // => { name: 'major', ... }\r\n */\r\nfunction get(type) {\r\n return index[type] || NoScaleType;\r\n}\r\nconst scaleType = deprecate(\"ScaleDictionary.scaleType\", \"ScaleType.get\", get);\r\n/**\r\n * Return a list of all scale types\r\n */\r\nfunction all() {\r\n return dictionary.slice();\r\n}\r\nconst entries = deprecate(\"ScaleDictionary.entries\", \"ScaleType.all\", all);\r\n/**\r\n * Keys used to reference scale types\r\n */\r\nfunction keys() {\r\n return Object.keys(index);\r\n}\r\n/**\r\n * Clear the dictionary\r\n */\r\nfunction removeAll() {\r\n dictionary = [];\r\n index = {};\r\n}\r\n/**\r\n * Add a scale into dictionary\r\n * @param intervals\r\n * @param name\r\n * @param aliases\r\n */\r\nfunction add(intervals, name, aliases = []) {\r\n const scale = { ...get$1(intervals), name, intervals, aliases };\r\n dictionary.push(scale);\r\n index[scale.name] = scale;\r\n index[scale.setNum] = scale;\r\n index[scale.chroma] = scale;\r\n scale.aliases.forEach((alias) => addAlias(scale, alias));\r\n return scale;\r\n}\r\nfunction addAlias(scale, alias) {\r\n index[alias] = scale;\r\n}\r\nSCALES.forEach(([ivls, name, ...aliases]) => add(ivls.split(\" \"), name, aliases));\r\nvar index$1 = {\r\n names,\r\n get,\r\n all,\r\n add,\r\n removeAll,\r\n keys,\r\n // deprecated\r\n entries,\r\n scaleType,\r\n};\n\nexport default index$1;\nexport { NoScaleType, add, addAlias, all, entries, get, keys, names, removeAll, scaleType };\n//# sourceMappingURL=index.es.js.map\n","import { detect } from '@tonaljs/chord-detect';\nexport { detect } from '@tonaljs/chord-detect';\nimport { get as get$1, all as all$1 } from '@tonaljs/chord-type';\nimport { tokenizeNote, note, distance, transpose as transpose$1, deprecate } from '@tonaljs/core';\nimport { isSupersetOf, isSubsetOf } from '@tonaljs/pcset';\nimport { all } from '@tonaljs/scale-type';\n\nconst NoChord = {\r\n empty: true,\r\n name: \"\",\r\n symbol: \"\",\r\n root: \"\",\r\n rootDegree: 0,\r\n type: \"\",\r\n tonic: null,\r\n setNum: NaN,\r\n quality: \"Unknown\",\r\n chroma: \"\",\r\n normalized: \"\",\r\n aliases: [],\r\n notes: [],\r\n intervals: [],\r\n};\r\n// 6, 64, 7, 9, 11 and 13 are consider part of the chord\r\n// (see https://github.com/danigb/tonal/issues/55)\r\nconst NUM_TYPES = /^(6|64|7|9|11|13)$/;\r\n/**\r\n * Tokenize a chord name. It returns an array with the tonic and chord type\r\n * If not tonic is found, all the name is considered the chord name.\r\n *\r\n * This function does NOT check if the chord type exists or not. It only tries\r\n * to split the tonic and chord type.\r\n *\r\n * @function\r\n * @param {string} name - the chord name\r\n * @return {Array} an array with [tonic, type]\r\n * @example\r\n * tokenize(\"Cmaj7\") // => [ \"C\", \"maj7\" ]\r\n * tokenize(\"C7\") // => [ \"C\", \"7\" ]\r\n * tokenize(\"mMaj7\") // => [ null, \"mMaj7\" ]\r\n * tokenize(\"Cnonsense\") // => [ null, \"nonsense\" ]\r\n */\r\nfunction tokenize(name) {\r\n const [letter, acc, oct, type] = tokenizeNote(name);\r\n if (letter === \"\") {\r\n return [\"\", name];\r\n }\r\n // aug is augmented (see https://github.com/danigb/tonal/issues/55)\r\n if (letter === \"A\" && type === \"ug\") {\r\n return [\"\", \"aug\"];\r\n }\r\n // see: https://github.com/tonaljs/tonal/issues/70\r\n if (!type && (oct === \"4\" || oct === \"5\")) {\r\n return [letter + acc, oct];\r\n }\r\n if (NUM_TYPES.test(oct)) {\r\n return [letter + acc, oct + type];\r\n }\r\n else {\r\n return [letter + acc + oct, type];\r\n }\r\n}\r\n/**\r\n * Get a Chord from a chord name.\r\n */\r\nfunction get(src) {\r\n if (src === \"\") {\r\n return NoChord;\r\n }\r\n if (Array.isArray(src) && src.length === 2) {\r\n return getChord(src[1], src[0]);\r\n }\r\n else {\r\n const [tonic, type] = tokenize(src);\r\n const chord = getChord(type, tonic);\r\n return chord.empty ? getChord(src) : chord;\r\n }\r\n}\r\n/**\r\n * Get chord properties\r\n *\r\n * @param typeName - the chord type name\r\n * @param [tonic] - Optional tonic\r\n * @param [root] - Optional root (requires a tonic)\r\n */\r\nfunction getChord(typeName, optionalTonic, optionalRoot) {\r\n const type = get$1(typeName);\r\n const tonic = note(optionalTonic || \"\");\r\n const root = note(optionalRoot || \"\");\r\n if (type.empty ||\r\n (optionalTonic && tonic.empty) ||\r\n (optionalRoot && root.empty)) {\r\n return NoChord;\r\n }\r\n const rootInterval = distance(tonic.pc, root.pc);\r\n const rootDegree = type.intervals.indexOf(rootInterval) + 1;\r\n if (!root.empty && !rootDegree) {\r\n return NoChord;\r\n }\r\n const notes = tonic.empty\r\n ? []\r\n : type.intervals.map((i) => transpose$1(tonic, i));\r\n typeName = type.aliases.indexOf(typeName) !== -1 ? typeName : type.aliases[0];\r\n const symbol = `${tonic.empty ? \"\" : tonic.pc}${typeName}${root.empty ? \"\" : \"/\" + root.pc}`;\r\n const name = `${optionalTonic ? tonic.pc + \" \" : \"\"}${type.name}${optionalRoot ? \" over \" + root.pc : \"\"}`;\r\n return {\r\n ...type,\r\n name,\r\n symbol,\r\n type: type.name,\r\n root: root.name,\r\n rootDegree,\r\n tonic: tonic.name,\r\n notes,\r\n };\r\n}\r\nconst chord = deprecate(\"Chord.chord\", \"Chord.get\", get);\r\n/**\r\n * Transpose a chord name\r\n *\r\n * @param {string} chordName - the chord name\r\n * @return {string} the transposed chord\r\n *\r\n * @example\r\n * transpose('Dm7', 'P4') // => 'Gm7\r\n */\r\nfunction transpose(chordName, interval) {\r\n const [tonic, type] = tokenize(chordName);\r\n if (!tonic) {\r\n return name;\r\n }\r\n return transpose$1(tonic, interval) + type;\r\n}\r\n/**\r\n * Get all scales where the given chord fits\r\n *\r\n * @example\r\n * chordScales('C7b9')\r\n * // => [\"phrygian dominant\", \"flamenco\", \"spanish heptatonic\", \"half-whole diminished\", \"chromatic\"]\r\n */\r\nfunction chordScales(name) {\r\n const s = get(name);\r\n const isChordIncluded = isSupersetOf(s.chroma);\r\n return all()\r\n .filter((scale) => isChordIncluded(scale.chroma))\r\n .map((scale) => scale.name);\r\n}\r\n/**\r\n * Get all chords names that are a superset of the given one\r\n * (has the same notes and at least one more)\r\n *\r\n * @function\r\n * @example\r\n * extended(\"CMaj7\")\r\n * // => [ 'Cmaj#4', 'Cmaj7#9#11', 'Cmaj9', 'CM7add13', 'Cmaj13', 'Cmaj9#11', 'CM13#11', 'CM7b9' ]\r\n */\r\nfunction extended(chordName) {\r\n const s = get(chordName);\r\n const isSuperset = isSupersetOf(s.chroma);\r\n return all$1()\r\n .filter((chord) => isSuperset(chord.chroma))\r\n .map((chord) => s.tonic + chord.aliases[0]);\r\n}\r\n/**\r\n * Find all chords names that are a subset of the given one\r\n * (has less notes but all from the given chord)\r\n *\r\n * @example\r\n */\r\nfunction reduced(chordName) {\r\n const s = get(chordName);\r\n const isSubset = isSubsetOf(s.chroma);\r\n return all$1()\r\n .filter((chord) => isSubset(chord.chroma))\r\n .map((chord) => s.tonic + chord.aliases[0]);\r\n}\r\nvar index = {\r\n getChord,\r\n get,\r\n detect,\r\n chordScales,\r\n extended,\r\n reduced,\r\n tokenize,\r\n transpose,\r\n // deprecate\r\n chord,\r\n};\n\nexport default index;\nexport { chord, chordScales, extended, get, getChord, reduced, tokenize, transpose };\n//# sourceMappingURL=index.es.js.map\n","// source: https://en.wikipedia.org/wiki/Note_value\r\nconst DATA = [\r\n [\r\n 0.125,\r\n \"dl\",\r\n [\"large\", \"duplex longa\", \"maxima\", \"octuple\", \"octuple whole\"],\r\n ],\r\n [0.25, \"l\", [\"long\", \"longa\"]],\r\n [0.5, \"d\", [\"double whole\", \"double\", \"breve\"]],\r\n [1, \"w\", [\"whole\", \"semibreve\"]],\r\n [2, \"h\", [\"half\", \"minim\"]],\r\n [4, \"q\", [\"quarter\", \"crotchet\"]],\r\n [8, \"e\", [\"eighth\", \"quaver\"]],\r\n [16, \"s\", [\"sixteenth\", \"semiquaver\"]],\r\n [32, \"t\", [\"thirty-second\", \"demisemiquaver\"]],\r\n [64, \"sf\", [\"sixty-fourth\", \"hemidemisemiquaver\"]],\r\n [128, \"h\", [\"hundred twenty-eighth\"]],\r\n [256, \"th\", [\"two hundred fifty-sixth\"]],\r\n];\n\nconst VALUES = [];\r\nDATA.forEach(([denominator, shorthand, names]) => add(denominator, shorthand, names));\r\nconst NoDuration = {\r\n empty: true,\r\n name: \"\",\r\n value: 0,\r\n fraction: [0, 0],\r\n shorthand: \"\",\r\n dots: \"\",\r\n names: [],\r\n};\r\nfunction names() {\r\n return VALUES.reduce((names, duration) => {\r\n duration.names.forEach((name) => names.push(name));\r\n return names;\r\n }, []);\r\n}\r\nfunction shorthands() {\r\n return VALUES.map((dur) => dur.shorthand);\r\n}\r\nconst REGEX = /^([^.]+)(\\.*)$/;\r\nfunction get(name) {\r\n const [_, simple, dots] = REGEX.exec(name) || [];\r\n const base = VALUES.find((dur) => dur.shorthand === simple || dur.names.includes(simple));\r\n if (!base) {\r\n return NoDuration;\r\n }\r\n const fraction = calcDots(base.fraction, dots.length);\r\n const value = fraction[0] / fraction[1];\r\n return { ...base, name, dots, value, fraction };\r\n}\r\nconst value = (name) => get(name).value;\r\nconst fraction = (name) => get(name).fraction;\r\nvar index = { names, shorthands, get, value, fraction };\r\n//// PRIVATE ////\r\nfunction add(denominator, shorthand, names) {\r\n VALUES.push({\r\n empty: false,\r\n dots: \"\",\r\n name: \"\",\r\n value: 1 / denominator,\r\n fraction: denominator < 1 ? [1 / denominator, 1] : [1, denominator],\r\n shorthand,\r\n names,\r\n });\r\n}\r\nfunction calcDots(fraction, dots) {\r\n const pow = Math.pow(2, dots);\r\n let numerator = fraction[0] * pow;\r\n let denominator = fraction[1] * pow;\r\n const base = numerator;\r\n // add fractions\r\n for (let i = 0; i < dots; i++) {\r\n numerator += base / Math.pow(2, i + 1);\r\n }\r\n // simplify\r\n while (numerator % 2 === 0 && denominator % 2 === 0) {\r\n numerator /= 2;\r\n denominator /= 2;\r\n }\r\n return [numerator, denominator];\r\n}\n\nexport default index;\nexport { fraction, get, names, shorthands, value };\n//# sourceMappingURL=index.es.js.map\n","import { interval, distance as distance$1, coordToInterval } from '@tonaljs/core';\n\n/**\r\n * Get the natural list of names\r\n */\r\nfunction names() {\r\n return \"1P 2M 3M 4P 5P 6m 7m\".split(\" \");\r\n}\r\n/**\r\n * Get properties of an interval\r\n *\r\n * @function\r\n * @example\r\n * Interval.get('P4') // => {\"alt\": 0, \"dir\": 1, \"name\": \"4P\", \"num\": 4, \"oct\": 0, \"q\": \"P\", \"semitones\": 5, \"simple\": 4, \"step\": 3, \"type\": \"perfectable\"}\r\n */\r\nconst get = interval;\r\n/**\r\n * Get name of an interval\r\n *\r\n * @function\r\n * @example\r\n * Interval.name('4P') // => \"4P\"\r\n * Interval.name('P4') // => \"4P\"\r\n * Interval.name('C4') // => \"\"\r\n */\r\nconst name = (name) => interval(name).name;\r\n/**\r\n * Get semitones of an interval\r\n * @function\r\n * @example\r\n * Interval.semitones('P4') // => 5\r\n */\r\nconst semitones = (name) => interval(name).semitones;\r\n/**\r\n * Get quality of an interval\r\n * @function\r\n * @example\r\n * Interval.quality('P4') // => \"P\"\r\n */\r\nconst quality = (name) => interval(name).q;\r\n/**\r\n * Get number of an interval\r\n * @function\r\n * @example\r\n * Interval.num('P4') // => 4\r\n */\r\nconst num = (name) => interval(name).num;\r\n/**\r\n * Get the simplified version of an interval.\r\n *\r\n * @function\r\n * @param {string} interval - the interval to simplify\r\n * @return {string} the simplified interval\r\n *\r\n * @example\r\n * Interval.simplify(\"9M\") // => \"2M\"\r\n * Interval.simplify(\"2M\") // => \"2M\"\r\n * Interval.simplify(\"-2M\") // => \"7m\"\r\n * [\"8P\", \"9M\", \"10M\", \"11P\", \"12P\", \"13M\", \"14M\", \"15P\"].map(Interval.simplify)\r\n * // => [ \"8P\", \"2M\", \"3M\", \"4P\", \"5P\", \"6M\", \"7M\", \"8P\" ]\r\n */\r\nfunction simplify(name) {\r\n const i = interval(name);\r\n return i.empty ? \"\" : i.simple + i.q;\r\n}\r\n/**\r\n * Get the inversion (https://en.wikipedia.org/wiki/Inversion_(music)#Intervals)\r\n * of an interval.\r\n *\r\n * @function\r\n * @param {string} interval - the interval to invert in interval shorthand\r\n * notation or interval array notation\r\n * @return {string} the inverted interval\r\n *\r\n * @example\r\n * Interval.invert(\"3m\") // => \"6M\"\r\n * Interval.invert(\"2M\") // => \"7m\"\r\n */\r\nfunction invert(name) {\r\n const i = interval(name);\r\n if (i.empty) {\r\n return \"\";\r\n }\r\n const step = (7 - i.step) % 7;\r\n const alt = i.type === \"perfectable\" ? -i.alt : -(i.alt + 1);\r\n return interval({ step, alt, oct: i.oct, dir: i.dir }).name;\r\n}\r\n// interval numbers\r\nconst IN = [1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7];\r\n// interval qualities\r\nconst IQ = \"P m M m M P d P m M m M\".split(\" \");\r\n/**\r\n * Get interval name from semitones number. Since there are several interval\r\n * names for the same number, the name it's arbitrary, but deterministic.\r\n *\r\n * @param {Integer} num - the number of semitones (can be negative)\r\n * @return {string} the interval name\r\n * @example\r\n * Interval.fromSemitones(7) // => \"5P\"\r\n * Interval.fromSemitones(-7) // => \"-5P\"\r\n */\r\nfunction fromSemitones(semitones) {\r\n const d = semitones < 0 ? -1 : 1;\r\n const n = Math.abs(semitones);\r\n const c = n % 12;\r\n const o = Math.floor(n / 12);\r\n return d * (IN[c] + 7 * o) + IQ[c];\r\n}\r\n/**\r\n * Find interval between two notes\r\n *\r\n * @example\r\n * Interval.distance(\"C4\", \"G4\"); // => \"5P\"\r\n */\r\nconst distance = distance$1;\r\n/**\r\n * Adds two intervals\r\n *\r\n * @function\r\n * @param {string} interval1\r\n * @param {string} interval2\r\n * @return {string} the added interval name\r\n * @example\r\n * Interval.add(\"3m\", \"5P\") // => \"7m\"\r\n */\r\nconst add = combinator((a, b) => [a[0] + b[0], a[1] + b[1]]);\r\n/**\r\n * Returns a function that adds an interval\r\n *\r\n * @function\r\n * @example\r\n * ['1P', '2M', '3M'].map(Interval.addTo('5P')) // => [\"5P\", \"6M\", \"7M\"]\r\n */\r\nconst addTo = (interval) => (other) => add(interval, other);\r\n/**\r\n * Subtracts two intervals\r\n *\r\n * @function\r\n * @param {string} minuendInterval\r\n * @param {string} subtrahendInterval\r\n * @return {string} the substracted interval name\r\n * @example\r\n * Interval.substract('5P', '3M') // => '3m'\r\n * Interval.substract('3M', '5P') // => '-3m'\r\n */\r\nconst substract = combinator((a, b) => [a[0] - b[0], a[1] - b[1]]);\r\nvar index = {\r\n names,\r\n get,\r\n name,\r\n num,\r\n semitones,\r\n quality,\r\n fromSemitones,\r\n distance,\r\n invert,\r\n simplify,\r\n add,\r\n addTo,\r\n substract,\r\n};\r\nfunction combinator(fn) {\r\n return (a, b) => {\r\n const coordA = interval(a).coord;\r\n const coordB = interval(b).coord;\r\n if (coordA && coordB) {\r\n const coord = fn(coordA, coordB);\r\n return coordToInterval(coord).name;\r\n }\r\n };\r\n}\n\nexport default index;\nexport { add, addTo, distance, fromSemitones, get, invert, name, names, num, quality, semitones, simplify, substract };\n//# sourceMappingURL=index.es.js.map\n","import { note } from '@tonaljs/core';\n\nfunction isMidi(arg) {\r\n return +arg >= 0 && +arg <= 127;\r\n}\r\n/**\r\n * Get the note midi number (a number between 0 and 127)\r\n *\r\n * It returns undefined if not valid note name\r\n *\r\n * @function\r\n * @param {string|number} note - the note name or midi number\r\n * @return {Integer} the midi number or undefined if not valid note\r\n * @example\r\n * import { toMidi } from '@tonaljs/midi'\r\n * toMidi(\"C4\") // => 60\r\n * toMidi(60) // => 60\r\n * toMidi('60') // => 60\r\n */\r\nfunction toMidi(note$1) {\r\n if (isMidi(note$1)) {\r\n return +note$1;\r\n }\r\n const n = note(note$1);\r\n return n.empty ? null : n.midi;\r\n}\r\n/**\r\n * Get the frequency in hertzs from midi number\r\n *\r\n * @param {number} midi - the note midi number\r\n * @param {number} [tuning = 440] - A4 tuning frequency in Hz (440 by default)\r\n * @return {number} the frequency or null if not valid note midi\r\n * @example\r\n * import { midiToFreq} from '@tonaljs/midi'\r\n * midiToFreq(69) // => 440\r\n */\r\nfunction midiToFreq(midi, tuning = 440) {\r\n return Math.pow(2, (midi - 69) / 12) * tuning;\r\n}\r\nconst L2 = Math.log(2);\r\nconst L440 = Math.log(440);\r\n/**\r\n * Get the midi number from a frequency in hertz. The midi number can\r\n * contain decimals (with two digits precission)\r\n *\r\n * @param {number} frequency\r\n * @return {number}\r\n * @example\r\n * import { freqToMidi} from '@tonaljs/midi'\r\n * freqToMidi(220)); //=> 57\r\n * freqToMidi(261.62)); //=> 60\r\n * freqToMidi(261)); //=> 59.96\r\n */\r\nfunction freqToMidi(freq) {\r\n const v = (12 * (Math.log(freq) - L440)) / L2 + 69;\r\n return Math.round(v * 100) / 100;\r\n}\r\nconst SHARPS = \"C C# D D# E F F# G G# A A# B\".split(\" \");\r\nconst FLATS = \"C Db D Eb E F Gb G Ab A Bb B\".split(\" \");\r\n/**\r\n * Given a midi number, returns a note name. The altered notes will have\r\n * flats unless explicitly set with the optional `useSharps` parameter.\r\n *\r\n * @function\r\n * @param {number} midi - the midi note number\r\n * @param {Object} options = default: `{ sharps: false, pitchClass: false }`\r\n * @param {boolean} useSharps - (Optional) set to true to use sharps instead of flats\r\n * @return {string} the note name\r\n * @example\r\n * import { midiToNoteName } from '@tonaljs/midi'\r\n * midiToNoteName(61) // => \"Db4\"\r\n * midiToNoteName(61, { pitchClass: true }) // => \"Db\"\r\n * midiToNoteName(61, { sharps: true }) // => \"C#4\"\r\n * midiToNoteName(61, { pitchClass: true, sharps: true }) // => \"C#\"\r\n * // it rounds to nearest note\r\n * midiToNoteName(61.7) // => \"D4\"\r\n */\r\nfunction midiToNoteName(midi, options = {}) {\r\n midi = Math.round(midi);\r\n const pcs = options.sharps === true ? SHARPS : FLATS;\r\n const pc = pcs[midi % 12];\r\n if (options.pitchClass) {\r\n return pc;\r\n }\r\n const o = Math.floor(midi / 12) - 1;\r\n return pc + o;\r\n}\r\nvar index = { isMidi, toMidi, midiToFreq, midiToNoteName, freqToMidi };\n\nexport default index;\nexport { freqToMidi, isMidi, midiToFreq, midiToNoteName, toMidi };\n//# sourceMappingURL=index.es.js.map\n","import { note, transpose as transpose$1, coordToNote } from '@tonaljs/core';\nimport { midiToNoteName } from '@tonaljs/midi';\n\nconst NAMES = [\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"];\r\nconst toName = (n) => n.name;\r\nconst onlyNotes = (array) => array.map(note).filter((n) => !n.empty);\r\n/**\r\n * Return the natural note names without octave\r\n * @function\r\n * @example\r\n * Note.names(); // => [\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"]\r\n */\r\nfunction names(array) {\r\n if (array === undefined) {\r\n return NAMES.slice();\r\n }\r\n else if (!Array.isArray(array)) {\r\n return [];\r\n }\r\n else {\r\n return onlyNotes(array).map(toName);\r\n }\r\n}\r\n/**\r\n * Get a note from a note name\r\n *\r\n * @function\r\n * @example\r\n * Note.get('Bb4') // => { name: \"Bb4\", midi: 70, chroma: 10, ... }\r\n */\r\nconst get = note;\r\n/**\r\n * Get the note name\r\n * @function\r\n */\r\nconst name = (note) => get(note).name;\r\n/**\r\n * Get the note pitch class name\r\n * @function\r\n */\r\nconst pitchClass = (note) => get(note).pc;\r\n/**\r\n * Get the note accidentals\r\n * @function\r\n */\r\nconst accidentals = (note) => get(note).acc;\r\n/**\r\n * Get the note octave\r\n * @function\r\n */\r\nconst octave = (note) => get(note).oct;\r\n/**\r\n * Get the note midi\r\n * @function\r\n */\r\nconst midi = (note) => get(note).midi;\r\n/**\r\n * Get the note midi\r\n * @function\r\n */\r\nconst freq = (note) => get(note).freq;\r\n/**\r\n * Get the note chroma\r\n * @function\r\n */\r\nconst chroma = (note) => get(note).chroma;\r\n/**\r\n * Given a midi number, returns a note name. Uses flats for altered notes.\r\n *\r\n * @function\r\n * @param {number} midi - the midi note number\r\n * @return {string} the note name\r\n * @example\r\n * Note.fromMidi(61) // => \"Db4\"\r\n * Note.fromMidi(61.7) // => \"D4\"\r\n */\r\nfunction fromMidi(midi) {\r\n return midiToNoteName(midi);\r\n}\r\n/**\r\n * Given a midi number, returns a note name. Uses flats for altered notes.\r\n *\r\n * @function\r\n * @param {number} midi - the midi note number\r\n * @return {string} the note name\r\n * @example\r\n * Note.fromMidiSharps(61) // => \"C#4\"\r\n */\r\nfunction fromMidiSharps(midi) {\r\n return midiToNoteName(midi, { sharps: true });\r\n}\r\n/**\r\n * Transpose a note by an interval\r\n */\r\nconst transpose = transpose$1;\r\nconst tr = transpose$1;\r\n/**\r\n * Transpose by an interval.\r\n * @function\r\n * @param {string} interval\r\n * @return {function} a function that transposes by the given interval\r\n * @example\r\n * [\"C\", \"D\", \"E\"].map(Note.transposeBy(\"5P\"));\r\n * // => [\"G\", \"A\", \"B\"]\r\n */\r\nconst transposeBy = (interval) => (note) => transpose(note, interval);\r\nconst trBy = transposeBy;\r\n/**\r\n * Transpose from a note\r\n * @function\r\n * @param {string} note\r\n * @return {function} a function that transposes the the note by an interval\r\n * [\"1P\", \"3M\", \"5P\"].map(Note.transposeFrom(\"C\"));\r\n * // => [\"C\", \"E\", \"G\"]\r\n */\r\nconst transposeFrom = (note) => (interval) => transpose(note, interval);\r\nconst trFrom = transposeFrom;\r\n/**\r\n * Transpose a note by a number of perfect fifths.\r\n *\r\n * @function\r\n * @param {string} note - the note name\r\n * @param {number} fifhts - the number of fifths\r\n * @return {string} the transposed note name\r\n *\r\n * @example\r\n * import { transposeFifths } from \"@tonaljs/note\"\r\n * transposeFifths(\"G4\", 1) // => \"D\"\r\n * [0, 1, 2, 3, 4].map(fifths => transposeFifths(\"C\", fifths)) // => [\"C\", \"G\", \"D\", \"A\", \"E\"]\r\n */\r\nfunction transposeFifths(noteName, fifths) {\r\n const note = get(noteName);\r\n if (note.empty) {\r\n return \"\";\r\n }\r\n const [nFifths, nOcts] = note.coord;\r\n const transposed = nOcts === undefined\r\n ? coordToNote([nFifths + fifths])\r\n : coordToNote([nFifths + fifths, nOcts]);\r\n return transposed.name;\r\n}\r\nconst trFifths = transposeFifths;\r\nconst ascending = (a, b) => a.height - b.height;\r\nconst descending = (a, b) => b.height - a.height;\r\nfunction sortedNames(notes, comparator) {\r\n comparator = comparator || ascending;\r\n return onlyNotes(notes).sort(comparator).map(toName);\r\n}\r\nfunction sortedUniqNames(notes) {\r\n return sortedNames(notes, ascending).filter((n, i, a) => i === 0 || n !== a[i - 1]);\r\n}\r\n/**\r\n * Simplify a note\r\n *\r\n * @function\r\n * @param {string} note - the note to be simplified\r\n * - sameAccType: default true. Use same kind of accidentals that source\r\n * @return {string} the simplified note or '' if not valid note\r\n * @example\r\n * simplify(\"C##\") // => \"D\"\r\n * simplify(\"C###\") // => \"D#\"\r\n * simplify(\"C###\")\r\n * simplify(\"B#4\") // => \"C5\"\r\n */\r\nconst simplify = nameBuilder(true);\r\n/**\r\n * Get enharmonic of a note\r\n *\r\n * @function\r\n * @param {string} note\r\n * @return {string} the enharmonic note or '' if not valid note\r\n * @example\r\n * Note.enharmonic(\"Db\") // => \"C#\"\r\n * Note.enharmonic(\"C\") // => \"C\"\r\n */\r\nconst enharmonic = nameBuilder(false);\r\nfunction nameBuilder(sameAccidentals) {\r\n return (noteName) => {\r\n const note = get(noteName);\r\n if (note.empty) {\r\n return \"\";\r\n }\r\n const sharps = sameAccidentals ? note.alt > 0 : note.alt < 0;\r\n const pitchClass = note.midi === null;\r\n return midiToNoteName(note.midi || note.chroma, { sharps, pitchClass });\r\n };\r\n}\r\nvar index = {\r\n names,\r\n get,\r\n name,\r\n pitchClass,\r\n accidentals,\r\n octave,\r\n midi,\r\n ascending,\r\n descending,\r\n sortedNames,\r\n sortedUniqNames,\r\n fromMidi,\r\n fromMidiSharps,\r\n freq,\r\n chroma,\r\n transpose,\r\n tr,\r\n transposeBy,\r\n trBy,\r\n transposeFrom,\r\n trFrom,\r\n transposeFifths,\r\n trFifths,\r\n simplify,\r\n enharmonic,\r\n};\n\nexport default index;\nexport { accidentals, ascending, chroma, descending, enharmonic, freq, fromMidi, fromMidiSharps, get, midi, name, names, octave, pitchClass, simplify, sortedNames, sortedUniqNames, tr, trBy, trFifths, trFrom, transpose, transposeBy, transposeFifths, transposeFrom };\n//# sourceMappingURL=index.es.js.map\n","import { isPitch, altToAcc, isNamed, deprecate, accToAlt, interval } from '@tonaljs/core';\n\nconst NoRomanNumeral = { empty: true, name: \"\", chordType: \"\" };\r\nconst cache = {};\r\n/**\r\n * Get properties of a roman numeral string\r\n *\r\n * @function\r\n * @param {string} - the roman numeral string (can have type, like: Imaj7)\r\n * @return {Object} - the roman numeral properties\r\n * @param {string} name - the roman numeral (tonic)\r\n * @param {string} type - the chord type\r\n * @param {string} num - the number (1 = I, 2 = II...)\r\n * @param {boolean} major - major or not\r\n *\r\n * @example\r\n * romanNumeral(\"VIIb5\") // => { name: \"VII\", type: \"b5\", num: 7, major: true }\r\n */\r\nfunction get(src) {\r\n return typeof src === \"string\"\r\n ? cache[src] || (cache[src] = parse(src))\r\n : typeof src === \"number\"\r\n ? get(NAMES[src] || \"\")\r\n : isPitch(src)\r\n ? fromPitch(src)\r\n : isNamed(src)\r\n ? get(src.name)\r\n : NoRomanNumeral;\r\n}\r\nconst romanNumeral = deprecate(\"RomanNumeral.romanNumeral\", \"RomanNumeral.get\", get);\r\n/**\r\n * Get roman numeral names\r\n *\r\n * @function\r\n * @param {boolean} [isMajor=true]\r\n * @return {Array}\r\n *\r\n * @example\r\n * names() // => [\"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\"]\r\n */\r\nfunction names(major = true) {\r\n return (major ? NAMES : NAMES_MINOR).slice();\r\n}\r\nfunction fromPitch(pitch) {\r\n return get(altToAcc(pitch.alt) + NAMES[pitch.step]);\r\n}\r\nconst REGEX = /^(#{1,}|b{1,}|x{1,}|)(IV|I{1,3}|VI{0,2}|iv|i{1,3}|vi{0,2})([^IViv]*)$/;\r\nfunction tokenize(str) {\r\n return (REGEX.exec(str) || [\"\", \"\", \"\", \"\"]);\r\n}\r\nconst ROMANS = \"I II III IV V VI VII\";\r\nconst NAMES = ROMANS.split(\" \");\r\nconst NAMES_MINOR = ROMANS.toLowerCase().split(\" \");\r\nfunction parse(src) {\r\n const [name, acc, roman, chordType] = tokenize(src);\r\n if (!roman) {\r\n return NoRomanNumeral;\r\n }\r\n const upperRoman = roman.toUpperCase();\r\n const step = NAMES.indexOf(upperRoman);\r\n const alt = accToAlt(acc);\r\n const dir = 1;\r\n return {\r\n empty: false,\r\n name,\r\n roman,\r\n interval: interval({ step, alt, dir }).name,\r\n acc,\r\n chordType,\r\n alt,\r\n step,\r\n major: roman === upperRoman,\r\n oct: 0,\r\n dir,\r\n };\r\n}\r\nvar index = {\r\n names,\r\n get,\r\n // deprecated\r\n romanNumeral,\r\n};\n\nexport default index;\nexport { get, names, tokenize };\n//# sourceMappingURL=index.es.js.map\n","import { transpose, altToAcc, accToAlt, note } from '@tonaljs/core';\nimport { transposeFifths } from '@tonaljs/note';\nimport { get } from '@tonaljs/roman-numeral';\n\nconst mapToScale = (scale) => (symbols, sep = \"\") => symbols.map((symbol, index) => symbol !== \"-\" ? scale[index] + sep + symbol : \"\");\r\nfunction keyScale(gradesLiteral, chordsLiteral, hfLiteral, chordScalesLiteral) {\r\n return (tonic) => {\r\n const grades = gradesLiteral.split(\" \");\r\n const intervals = grades.map((gr) => get(gr).interval || \"\");\r\n const scale = intervals.map((interval) => transpose(tonic, interval));\r\n const map = mapToScale(scale);\r\n return {\r\n tonic,\r\n grades,\r\n intervals,\r\n scale,\r\n chords: map(chordsLiteral.split(\" \")),\r\n chordsHarmonicFunction: hfLiteral.split(\" \"),\r\n chordScales: map(chordScalesLiteral.split(\",\"), \" \"),\r\n };\r\n };\r\n}\r\nconst distInFifths = (from, to) => {\r\n const f = note(from);\r\n const t = note(to);\r\n return f.empty || t.empty ? 0 : t.coord[0] - f.coord[0];\r\n};\r\nconst MajorScale = keyScale(\"I II III IV V VI VII\", \"maj7 m7 m7 maj7 7 m7 m7b5\", \"T SD T SD D T D\", \"major,dorian,phrygian,lydian,mixolydian,minor,locrian\");\r\nconst NaturalScale = keyScale(\"I II bIII IV V bVI bVII\", \"m7 m7b5 maj7 m7 m7 maj7 7\", \"T SD T SD D SD SD\", \"minor,locrian,major,dorian,phrygian,lydian,mixolydian\");\r\nconst HarmonicScale = keyScale(\"I II bIII IV V bVI VII\", \"mmaj7 m7b5 +maj7 m7 7 maj7 mo7\", \"T SD T SD D SD D\", \"harmonic minor,locrian 6,major augmented,lydian diminished,phrygian dominant,lydian #9,ultralocrian\");\r\nconst MelodicScale = keyScale(\"I II bIII IV V VI VII\", \"m6 m7 +maj7 7 7 m7b5 m7b5\", \"T SD T SD D - -\", \"melodic minor,dorian b2,lydian augmented,lydian dominant,mixolydian b6,locrian #2,altered\");\r\n/**\r\n * Get a major key properties in a given tonic\r\n * @param tonic\r\n */\r\nfunction majorKey(tonic) {\r\n const keyScale = MajorScale(tonic);\r\n const alteration = distInFifths(\"C\", tonic);\r\n const map = mapToScale(keyScale.scale);\r\n return {\r\n ...keyScale,\r\n type: \"major\",\r\n minorRelative: transpose(tonic, \"-3m\"),\r\n alteration,\r\n keySignature: altToAcc(alteration),\r\n secondaryDominants: map(\"- VI7 VII7 I7 II7 III7 -\".split(\" \")),\r\n secondaryDominantsMinorRelative: map(\"- IIIm7b5 IV#m7 Vm7 VIm7 VIIm7b5 -\".split(\" \")),\r\n substituteDominants: map(\"- bIII7 IV7 bV7 bVI7 bVII7 -\".split(\" \")),\r\n substituteDominantsMinorRelative: map(\"- IIIm7 Im7 IIbm7 VIm7 IVm7 -\".split(\" \")),\r\n };\r\n}\r\n/**\r\n * Get minor key properties in a given tonic\r\n * @param tonic\r\n */\r\nfunction minorKey(tonic) {\r\n const alteration = distInFifths(\"C\", tonic) - 3;\r\n return {\r\n type: \"minor\",\r\n tonic,\r\n relativeMajor: transpose(tonic, \"3m\"),\r\n alteration,\r\n keySignature: altToAcc(alteration),\r\n natural: NaturalScale(tonic),\r\n harmonic: HarmonicScale(tonic),\r\n melodic: MelodicScale(tonic),\r\n };\r\n}\r\n/**\r\n * Given a key signature, returns the tonic of the major key\r\n * @param sigature\r\n * @example\r\n * majorTonicFromKeySignature('###') // => 'A'\r\n */\r\nfunction majorTonicFromKeySignature(sig) {\r\n if (typeof sig === \"number\") {\r\n return transposeFifths(\"C\", sig);\r\n }\r\n else if (typeof sig === \"string\" && /^b+|#+$/.test(sig)) {\r\n return transposeFifths(\"C\", accToAlt(sig));\r\n }\r\n return null;\r\n}\r\nvar index = { majorKey, majorTonicFromKeySignature, minorKey };\n\nexport default index;\nexport { majorKey, majorTonicFromKeySignature, minorKey };\n//# sourceMappingURL=index.es.js.map\n","import { deprecate } from '@tonaljs/core';\nimport { chromaToIntervals, EmptyPcset } from '@tonaljs/pcset';\n\nconst DATA = [\r\n [0, 2773, 0, \"ionian\", \"\", \"Maj7\", \"major\"],\r\n [1, 2902, 2, \"dorian\", \"m\", \"m7\"],\r\n [2, 3418, 4, \"phrygian\", \"m\", \"m7\"],\r\n [3, 2741, -1, \"lydian\", \"\", \"Maj7\"],\r\n [4, 2774, 1, \"mixolydian\", \"\", \"7\"],\r\n [5, 2906, 3, \"aeolian\", \"m\", \"m7\", \"minor\"],\r\n [6, 3434, 5, \"locrian\", \"dim\", \"m7b5\"],\r\n];\n\nconst NoMode = {\r\n ...EmptyPcset,\r\n name: \"\",\r\n alt: 0,\r\n modeNum: NaN,\r\n triad: \"\",\r\n seventh: \"\",\r\n aliases: [],\r\n};\r\nconst modes = DATA.map(toMode);\r\nconst index = {};\r\nmodes.forEach((mode) => {\r\n index[mode.name] = mode;\r\n mode.aliases.forEach((alias) => {\r\n index[alias] = mode;\r\n });\r\n});\r\n/**\r\n * Get a Mode by it's name\r\n *\r\n * @example\r\n * get('dorian')\r\n * // =>\r\n * // {\r\n * // intervals: [ '1P', '2M', '3m', '4P', '5P', '6M', '7m' ],\r\n * // modeNum: 1,\r\n * // chroma: '101101010110',\r\n * // normalized: '101101010110',\r\n * // name: 'dorian',\r\n * // setNum: 2902,\r\n * // alt: 2,\r\n * // triad: 'm',\r\n * // seventh: 'm7',\r\n * // aliases: []\r\n * // }\r\n */\r\nfunction get(name) {\r\n return typeof name === \"string\"\r\n ? index[name.toLowerCase()] || NoMode\r\n : name && name.name\r\n ? get(name.name)\r\n : NoMode;\r\n}\r\nconst mode = deprecate(\"Mode.mode\", \"Mode.get\", get);\r\n/**\r\n * Get a list of all modes\r\n */\r\nfunction all() {\r\n return modes.slice();\r\n}\r\nconst entries = deprecate(\"Mode.mode\", \"Mode.all\", all);\r\n/**\r\n * Get a list of all mode names\r\n */\r\nfunction names() {\r\n return modes.map((mode) => mode.name);\r\n}\r\nfunction toMode(mode) {\r\n const [modeNum, setNum, alt, name, triad, seventh, alias] = mode;\r\n const aliases = alias ? [alias] : [];\r\n const chroma = Number(setNum).toString(2);\r\n const intervals = chromaToIntervals(chroma);\r\n return {\r\n empty: false,\r\n intervals,\r\n modeNum,\r\n chroma,\r\n normalized: chroma,\r\n name,\r\n setNum,\r\n alt,\r\n triad,\r\n seventh,\r\n aliases,\r\n };\r\n}\r\nvar index$1 = {\r\n get,\r\n names,\r\n all,\r\n // deprecated\r\n entries,\r\n mode,\r\n};\n\nexport default index$1;\nexport { all, entries, get, mode, names };\n//# sourceMappingURL=index.es.js.map\n","import { tokenize } from '@tonaljs/chord';\nimport { transpose, interval, distance } from '@tonaljs/core';\nimport { get } from '@tonaljs/roman-numeral';\n\n/**\r\n * Given a tonic and a chord list expressed with roman numeral notation\r\n * returns the progression expressed with leadsheet chords symbols notation\r\n * @example\r\n * fromRomanNumerals(\"C\", [\"I\", \"IIm7\", \"V7\"]);\r\n * // => [\"C\", \"Dm7\", \"G7\"]\r\n */\r\nfunction fromRomanNumerals(tonic, chords) {\r\n const romanNumerals = chords.map(get);\r\n return romanNumerals.map((rn) => transpose(tonic, interval(rn)) + rn.chordType);\r\n}\r\n/**\r\n * Given a tonic and a chord list with leadsheet symbols notation,\r\n * return the chord list with roman numeral notation\r\n * @example\r\n * toRomanNumerals(\"C\", [\"CMaj7\", \"Dm7\", \"G7\"]);\r\n * // => [\"IMaj7\", \"IIm7\", \"V7\"]\r\n */\r\nfunction toRomanNumerals(tonic, chords) {\r\n return chords.map((chord) => {\r\n const [note, chordType] = tokenize(chord);\r\n const intervalName = distance(tonic, note);\r\n const roman = get(interval(intervalName));\r\n return roman.name + chordType;\r\n });\r\n}\r\nvar index = { fromRomanNumerals, toRomanNumerals };\n\nexport default index;\nexport { fromRomanNumerals, toRomanNumerals };\n//# sourceMappingURL=index.es.js.map\n","import { compact, range } from '@tonaljs/collection';\nimport { toMidi, midiToNoteName } from '@tonaljs/midi';\n\n/**\r\n * Create a numeric range. You supply a list of notes or numbers and it will\r\n * be connected to create complex ranges.\r\n *\r\n * @param {Array} array - the list of notes or numbers used\r\n * @return {Array} an array of numbers or empty array if not valid parameters\r\n *\r\n * @example\r\n * numeric([\"C5\", \"C4\"]) // => [ 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60 ]\r\n * // it works midi notes\r\n * numeric([10, 5]) // => [ 10, 9, 8, 7, 6, 5 ]\r\n * // complex range\r\n * numeric([\"C4\", \"E4\", \"Bb3\"]) // => [60, 61, 62, 63, 64, 63, 62, 61, 60, 59, 58]\r\n */\r\nfunction numeric(notes) {\r\n const midi = compact(notes.map(toMidi));\r\n if (!notes.length || midi.length !== notes.length) {\r\n // there is no valid notes\r\n return [];\r\n }\r\n return midi.reduce((result, note) => {\r\n const last = result[result.length - 1];\r\n return result.concat(range(last, note).slice(1));\r\n }, [midi[0]]);\r\n}\r\n/**\r\n * Create a range of chromatic notes. The altered notes will use flats.\r\n *\r\n * @function\r\n * @param {String|Array} list - the list of notes or midi note numbers\r\n * @return {Array} an array of note names\r\n *\r\n * @example\r\n * Range.chromatic(\"C2 E2 D2\") // => [\"C2\", \"Db2\", \"D2\", \"Eb2\", \"E2\", \"Eb2\", \"D2\"]\r\n * // with sharps\r\n * Range.chromatic(\"C2 C3\", true) // => [ \"C2\", \"C#2\", \"D2\", \"D#2\", \"E2\", \"F2\", \"F#2\", \"G2\", \"G#2\", \"A2\", \"A#2\", \"B2\", \"C3\" ]\r\n */\r\nfunction chromatic(notes, options) {\r\n return numeric(notes).map((midi) => midiToNoteName(midi, options));\r\n}\r\nvar index = { numeric, chromatic };\n\nexport default index;\nexport { chromatic, numeric };\n//# sourceMappingURL=index.es.js.map\n","import { all } from '@tonaljs/chord-type';\nimport { rotate } from '@tonaljs/collection';\nimport { note, transpose, deprecate } from '@tonaljs/core';\nimport { sortedUniqNames } from '@tonaljs/note';\nimport { isSubsetOf, isSupersetOf, modes } from '@tonaljs/pcset';\nimport { names as names$1, get as get$1, all as all$1 } from '@tonaljs/scale-type';\n\n/**\r\n * References:\r\n * - https://www.researchgate.net/publication/327567188_An_Algorithm_for_Spelling_the_Pitches_of_Any_Musical_Scale\r\n * @module scale\r\n */\r\nconst NoScale = {\r\n empty: true,\r\n name: \"\",\r\n type: \"\",\r\n tonic: null,\r\n setNum: NaN,\r\n chroma: \"\",\r\n normalized: \"\",\r\n aliases: [],\r\n notes: [],\r\n intervals: [],\r\n};\r\n/**\r\n * Given a string with a scale name and (optionally) a tonic, split\r\n * that components.\r\n *\r\n * It retuns an array with the form [ name, tonic ] where tonic can be a\r\n * note name or null and name can be any arbitrary string\r\n * (this function doesn\"t check if that scale name exists)\r\n *\r\n * @function\r\n * @param {string} name - the scale name\r\n * @return {Array} an array [tonic, name]\r\n * @example\r\n * tokenize(\"C mixolydean\") // => [\"C\", \"mixolydean\"]\r\n * tokenize(\"anything is valid\") // => [\"\", \"anything is valid\"]\r\n * tokenize() // => [\"\", \"\"]\r\n */\r\nfunction tokenize(name) {\r\n if (typeof name !== \"string\") {\r\n return [\"\", \"\"];\r\n }\r\n const i = name.indexOf(\" \");\r\n const tonic = note(name.substring(0, i));\r\n if (tonic.empty) {\r\n const n = note(name);\r\n return n.empty ? [\"\", name] : [n.name, \"\"];\r\n }\r\n const type = name.substring(tonic.name.length + 1);\r\n return [tonic.name, type.length ? type : \"\"];\r\n}\r\n/**\r\n * Get all scale names\r\n * @function\r\n */\r\nconst names = names$1;\r\n/**\r\n * Get a Scale from a scale name.\r\n */\r\nfunction get(src) {\r\n const tokens = Array.isArray(src) ? src : tokenize(src);\r\n const tonic = note(tokens[0]).name;\r\n const st = get$1(tokens[1]);\r\n if (st.empty) {\r\n return NoScale;\r\n }\r\n const type = st.name;\r\n const notes = tonic\r\n ? st.intervals.map((i) => transpose(tonic, i))\r\n : [];\r\n const name = tonic ? tonic + \" \" + type : type;\r\n return { ...st, name, type, tonic, notes };\r\n}\r\nconst scale = deprecate(\"Scale.scale\", \"Scale.get\", get);\r\n/**\r\n * Get all chords that fits a given scale\r\n *\r\n * @function\r\n * @param {string} name - the scale name\r\n * @return {Array} - the chord names\r\n *\r\n * @example\r\n * scaleChords(\"pentatonic\") // => [\"5\", \"64\", \"M\", \"M6\", \"Madd9\", \"Msus2\"]\r\n */\r\nfunction scaleChords(name) {\r\n const s = get(name);\r\n const inScale = isSubsetOf(s.chroma);\r\n return all()\r\n .filter((chord) => inScale(chord.chroma))\r\n .map((chord) => chord.aliases[0]);\r\n}\r\n/**\r\n * Get all scales names that are a superset of the given one\r\n * (has the same notes and at least one more)\r\n *\r\n * @function\r\n * @param {string} name\r\n * @return {Array} a list of scale names\r\n * @example\r\n * extended(\"major\") // => [\"bebop\", \"bebop dominant\", \"bebop major\", \"chromatic\", \"ichikosucho\"]\r\n */\r\nfunction extended(name) {\r\n const s = get(name);\r\n const isSuperset = isSupersetOf(s.chroma);\r\n return all$1()\r\n .filter((scale) => isSuperset(scale.chroma))\r\n .map((scale) => scale.name);\r\n}\r\n/**\r\n * Find all scales names that are a subset of the given one\r\n * (has less notes but all from the given scale)\r\n *\r\n * @function\r\n * @param {string} name\r\n * @return {Array} a list of scale names\r\n *\r\n * @example\r\n * reduced(\"major\") // => [\"ionian pentatonic\", \"major pentatonic\", \"ritusen\"]\r\n */\r\nfunction reduced(name) {\r\n const isSubset = isSubsetOf(get(name).chroma);\r\n return all$1()\r\n .filter((scale) => isSubset(scale.chroma))\r\n .map((scale) => scale.name);\r\n}\r\n/**\r\n * Given an array of notes, return the scale: a pitch class set starting from\r\n * the first note of the array\r\n *\r\n * @function\r\n * @param {string[]} notes\r\n * @return {string[]} pitch classes with same tonic\r\n * @example\r\n * scaleNotes(['C4', 'c3', 'C5', 'C4', 'c4']) // => [\"C\"]\r\n * scaleNotes(['D4', 'c#5', 'A5', 'F#6']) // => [\"D\", \"F#\", \"A\", \"C#\"]\r\n */\r\nfunction scaleNotes(notes) {\r\n const pcset = notes.map((n) => note(n).pc).filter((x) => x);\r\n const tonic = pcset[0];\r\n const scale = sortedUniqNames(pcset);\r\n return rotate(scale.indexOf(tonic), scale);\r\n}\r\n/**\r\n * Find mode names of a scale\r\n *\r\n * @function\r\n * @param {string} name - scale name\r\n * @example\r\n * modeNames(\"C pentatonic\") // => [\r\n * [\"C\", \"major pentatonic\"],\r\n * [\"D\", \"egyptian\"],\r\n * [\"E\", \"malkos raga\"],\r\n * [\"G\", \"ritusen\"],\r\n * [\"A\", \"minor pentatonic\"]\r\n * ]\r\n */\r\nfunction modeNames(name) {\r\n const s = get(name);\r\n if (s.empty) {\r\n return [];\r\n }\r\n const tonics = s.tonic ? s.notes : s.intervals;\r\n return modes(s.chroma)\r\n .map((chroma, i) => {\r\n const modeName = get(chroma).name;\r\n return modeName ? [tonics[i], modeName] : [\"\", \"\"];\r\n })\r\n .filter((x) => x[0]);\r\n}\r\nvar index = {\r\n get,\r\n names,\r\n extended,\r\n modeNames,\r\n reduced,\r\n scaleChords,\r\n scaleNotes,\r\n tokenize,\r\n // deprecated\r\n scale,\r\n};\n\nexport default index;\nexport { extended, get, modeNames, names, reduced, scale, scaleChords, scaleNotes, tokenize };\n//# sourceMappingURL=index.es.js.map\n","// CONSTANTS\r\nconst NONE = {\r\n empty: true,\r\n name: \"\",\r\n upper: undefined,\r\n lower: undefined,\r\n type: undefined,\r\n additive: [],\r\n};\r\nconst NAMES = [\"4/4\", \"3/4\", \"2/4\", \"2/2\", \"12/8\", \"9/8\", \"6/8\", \"3/8\"];\r\n// PUBLIC API\r\nfunction names() {\r\n return NAMES.slice();\r\n}\r\nconst REGEX = /^(\\d?\\d(?:\\+\\d)*)\\/(\\d)$/;\r\nconst CACHE = new Map();\r\nfunction get(literal) {\r\n const cached = CACHE.get(literal);\r\n if (cached) {\r\n return cached;\r\n }\r\n const ts = build(parse(literal));\r\n CACHE.set(literal, ts);\r\n return ts;\r\n}\r\nfunction parse(literal) {\r\n if (typeof literal === \"string\") {\r\n const [_, up, low] = REGEX.exec(literal) || [];\r\n return parse([up, low]);\r\n }\r\n const [up, down] = literal;\r\n const denominator = +down;\r\n if (typeof up === \"number\") {\r\n return [up, denominator];\r\n }\r\n const list = up.split(\"+\").map((n) => +n);\r\n return list.length === 1 ? [list[0], denominator] : [list, denominator];\r\n}\r\nvar index = { names, parse, get };\r\n// PRIVATE\r\nfunction build([up, down]) {\r\n const upper = Array.isArray(up) ? up.reduce((a, b) => a + b, 0) : up;\r\n const lower = down;\r\n if (upper === 0 || lower === 0) {\r\n return NONE;\r\n }\r\n const name = Array.isArray(up) ? `${up.join(\"+\")}/${down}` : `${up}/${down}`;\r\n const additive = Array.isArray(up) ? up : [];\r\n const type = lower === 4 || lower === 2\r\n ? \"simple\"\r\n : lower === 8 && upper % 3 === 0\r\n ? \"compound\"\r\n : \"irregular\";\r\n return {\r\n empty: false,\r\n name,\r\n type,\r\n upper,\r\n lower,\r\n additive,\r\n };\r\n}\n\nexport default index;\nexport { get, names, parse };\n//# sourceMappingURL=index.es.js.map\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tonaljs/abc-notation'), require('@tonaljs/array'), require('@tonaljs/chord'), require('@tonaljs/chord-type'), require('@tonaljs/collection'), require('@tonaljs/core'), require('@tonaljs/duration-value'), require('@tonaljs/interval'), require('@tonaljs/key'), require('@tonaljs/midi'), require('@tonaljs/mode'), require('@tonaljs/note'), require('@tonaljs/pcset'), require('@tonaljs/progression'), require('@tonaljs/range'), require('@tonaljs/roman-numeral'), require('@tonaljs/scale'), require('@tonaljs/scale-type'), require('@tonaljs/time-signature')) :\n typeof define === 'function' && define.amd ? define(['exports', '@tonaljs/abc-notation', '@tonaljs/array', '@tonaljs/chord', '@tonaljs/chord-type', '@tonaljs/collection', '@tonaljs/core', '@tonaljs/duration-value', '@tonaljs/interval', '@tonaljs/key', '@tonaljs/midi', '@tonaljs/mode', '@tonaljs/note', '@tonaljs/pcset', '@tonaljs/progression', '@tonaljs/range', '@tonaljs/roman-numeral', '@tonaljs/scale', '@tonaljs/scale-type', '@tonaljs/time-signature'], factory) :\n (global = global || self, factory(global.Tonal = {}, global.abcNotation, global.array, global.chord, global.ChordType, global.collection, global.Core, global.durationValue, global.interval, global.key, global.midi, global.mode, global.note, global.Pcset, global.progression, global.range, global.romanNumeral, global.scale, global.ScaleType, global.timeSignature));\n}(this, (function (exports, abcNotation, array, chord, ChordType, collection, Core, durationValue, interval, key, midi, mode, note, Pcset, progression, range, romanNumeral, scale, ScaleType, timeSignature) { 'use strict';\n\n abcNotation = abcNotation && Object.prototype.hasOwnProperty.call(abcNotation, 'default') ? abcNotation['default'] : abcNotation;\n chord = chord && Object.prototype.hasOwnProperty.call(chord, 'default') ? chord['default'] : chord;\n ChordType = ChordType && Object.prototype.hasOwnProperty.call(ChordType, 'default') ? ChordType['default'] : ChordType;\n collection = collection && Object.prototype.hasOwnProperty.call(collection, 'default') ? collection['default'] : collection;\n durationValue = durationValue && Object.prototype.hasOwnProperty.call(durationValue, 'default') ? durationValue['default'] : durationValue;\n interval = interval && Object.prototype.hasOwnProperty.call(interval, 'default') ? interval['default'] : interval;\n key = key && Object.prototype.hasOwnProperty.call(key, 'default') ? key['default'] : key;\n midi = midi && Object.prototype.hasOwnProperty.call(midi, 'default') ? midi['default'] : midi;\n mode = mode && Object.prototype.hasOwnProperty.call(mode, 'default') ? mode['default'] : mode;\n note = note && Object.prototype.hasOwnProperty.call(note, 'default') ? note['default'] : note;\n Pcset = Pcset && Object.prototype.hasOwnProperty.call(Pcset, 'default') ? Pcset['default'] : Pcset;\n progression = progression && Object.prototype.hasOwnProperty.call(progression, 'default') ? progression['default'] : progression;\n range = range && Object.prototype.hasOwnProperty.call(range, 'default') ? range['default'] : range;\n romanNumeral = romanNumeral && Object.prototype.hasOwnProperty.call(romanNumeral, 'default') ? romanNumeral['default'] : romanNumeral;\n scale = scale && Object.prototype.hasOwnProperty.call(scale, 'default') ? scale['default'] : scale;\n ScaleType = ScaleType && Object.prototype.hasOwnProperty.call(ScaleType, 'default') ? ScaleType['default'] : ScaleType;\n timeSignature = timeSignature && Object.prototype.hasOwnProperty.call(timeSignature, 'default') ? timeSignature['default'] : timeSignature;\n\n // deprecated (backwards compatibility)\r\n var Tonal = Core;\r\n var PcSet = Pcset;\r\n var ChordDictionary = ChordType;\r\n var ScaleDictionary = ScaleType;\n\n Object.keys(Core).forEach(function (k) {\n if (k !== 'default') Object.defineProperty(exports, k, {\n enumerable: true,\n get: function () {\n return Core[k];\n }\n });\n });\n exports.AbcNotation = abcNotation;\n exports.Array = array;\n exports.Chord = chord;\n exports.ChordType = ChordType;\n exports.Collection = collection;\n exports.Core = Core;\n exports.DurationValue = durationValue;\n exports.Interval = interval;\n exports.Key = key;\n exports.Midi = midi;\n exports.Mode = mode;\n exports.Note = note;\n exports.Pcset = Pcset;\n exports.Progression = progression;\n exports.Range = range;\n exports.RomanNumeral = romanNumeral;\n exports.Scale = scale;\n exports.ScaleType = ScaleType;\n exports.TimeSignature = timeSignature;\n exports.ChordDictionary = ChordDictionary;\n exports.PcSet = PcSet;\n exports.ScaleDictionary = ScaleDictionary;\n exports.Tonal = Tonal;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=index.js.map\n"],"names":["fillStr","s","n","Array","Math","abs","join","deprecate","original","alternative","fn","args","console","warn","apply","this","isNamed","src","name","isPitch","pitch","step","alt","FIFTHS","STEPS_TO_OCTS","map","fifths","floor","encode","oct","dir","f","undefined","FIFTHS_TO_STEPS","decode","coord","o","i","unaltered","NoNote","empty","pc","acc","cache","Map","stepToLetter","charAt","altToAcc","accToAlt","length","note","cached","get","value","noteName","tokens","tokenizeNote","letter","octStr","charCodeAt","chroma","SEMI","height","midi","freq","pow","parse","props","pitchName","set","REGEX","str","m","exec","toUpperCase","replace","coordToNote","noteCoord","NoInterval","REGEX$1","RegExp","tokenizeInterval","cache$1","interval","num","q","t","type","simple","test","qToAlt","semitones","SIZES","parse$1","altToQ","pitchName$1","coordToInterval","transpose","intervalName","note$1","interval$1","intervalCoord","distance","fromNote","toNote","from","to","fcoord","tcoord","character","times","tokenize","abcToScientificNotation","a","scientificToAbcNotation","toLowerCase","index","transpose$1","distance$1","sortedNoteNames","notes","filter","sort","b","arr","permutations","slice","reduce","perm","concat","e","pos","newPerm","splice","ascR","descR","len","rnd","random","range","rotate","compact","EmptyPcset","setNum","normalized","intervals","setNumToChroma","Number","toString","chromaToNumber","parseInt","isChroma","[object Object]","isArray","binary","listToChroma","isPcset","normalizedNum","split","_","chromaRotations","chromaToIntervals","chromaToPcset","pcset","IVLS","push","modes","normalize","r","isSubsetOf","isSupersetOf","isNoteIncludedIn","chromas","isEqual","s1","s2","isIncluded","NoChordType","quality","aliases","dictionary","chordType","all","entries","add","fullName","has","indexOf","getQuality","chord","get$1","forEach","alias","addAlias","ivls","names","index$1","x","symbols","removeAll","keys","Object","NotFound","weight","NoScaleType","scale","scaleType","NoChord","symbol","root","rootDegree","tonic","NaN","NUM_TYPES","getChord","typeName","optionalTonic","optionalRoot","rootInterval","detect","source","tonicChroma","pcToName","record","namedSet","mode","chordName","baseNote","findExactMatches","chordScales","isChordIncluded","extended","isSuperset","all$1","reduced","isSubset","VALUES","denominator","shorthand","dots","fraction","NoDuration","base","find","dur","includes","numerator","calcDots","duration","shorthands","IN","IQ","combinator","substract","fromSemitones","d","c","invert","simplify","addTo","other","coordA","coordB","isMidi","arg","toMidi","L2","log","L440","SHARPS","FLATS","midiToNoteName","options","round","sharps","pitchClass","midiToFreq","tuning","freqToMidi","v","NAMES","toName","onlyNotes","array","tr","transposeBy","trBy","transposeFrom","trFrom","transposeFifths","nFifths","nOcts","trFifths","ascending","sortedNames","comparator","sortedUniqNames","nameBuilder","enharmonic","sameAccidentals","accidentals","octave","descending","fromMidi","fromMidiSharps","NoRomanNumeral","roman","upperRoman","major","romanNumeral","ROMANS","NAMES_MINOR","mapToScale","sep","keyScale","gradesLiteral","chordsLiteral","hfLiteral","chordScalesLiteral","grades","gr","chords","chordsHarmonicFunction","distInFifths","MajorScale","NaturalScale","HarmonicScale","MelodicScale","majorKey","alteration","minorRelative","keySignature","secondaryDominants","secondaryDominantsMinorRelative","substituteDominants","substituteDominantsMinorRelative","majorTonicFromKeySignature","sig","minorKey","relativeMajor","natural","harmonic","melodic","NoMode","modeNum","triad","seventh","fromRomanNumerals","rn","toRomanNumerals","numeric","result","last","chromatic","NoScale","substring","st","names$1","modeNames","tonics","modeName","scaleChords","inScale","scaleNotes","NONE","upper","lower","additive","CACHE","literal","up","low","down","list","ts","build","exports","abcNotation","ChordType","collection","Core","durationValue","key","Pcset","progression","ScaleType","timeSignature","prototype","hasOwnProperty","call","Tonal","PcSet","ChordDictionary","ScaleDictionary","k","defineProperty","enumerable","AbcNotation","Chord","Collection","DurationValue","Interval","Key","Midi","Mode","Note","Progression","Range","RomanNumeral","Scale","TimeSignature","factory","require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18"],"mappings":"+KAMA,MAAMA,EAAU,CAACC,EAAGC,IAAMC,MAAMC,KAAKC,IAAIH,GAAK,GAAGI,KAAKL,GACtD,SAASM,EAAUC,EAAUC,EAAaC,GACtC,OAAO,YAAaC,GAGhB,OADAC,QAAQ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2BC,GAAmCC,GAA2BC,GAAgCC"} \ No newline at end of file +{"version":3,"file":"tonal.min.js","sources":["../../core/dist/index.es.js","../../abc-notation/dist/index.es.js","../../array/dist/index.es.js","../../collection/dist/index.es.js","../../pcset/dist/index.es.js","../../chord-type/dist/index.es.js","../../chord-detect/dist/index.es.js","../../scale-type/dist/index.es.js","../../chord/dist/index.es.js","../../duration-value/dist/index.es.js","../../interval/dist/index.es.js","../../midi/dist/index.es.js","../../note/dist/index.es.js","../../roman-numeral/dist/index.es.js","../../key/dist/index.es.js","../../mode/dist/index.es.js","../../progression/dist/index.es.js","../../range/dist/index.es.js","../../scale/dist/index.es.js","../../time-signature/dist/index.es.js","../dist/index.js"],"sourcesContent":["/**\r\n * Fill a string with a repeated character\r\n *\r\n * @param character\r\n * @param repetition\r\n */\r\nconst fillStr = (s, n) => Array(Math.abs(n) + 1).join(s);\r\nfunction deprecate(original, alternative, fn) {\r\n return function (...args) {\r\n // tslint:disable-next-line\r\n console.warn(`${original} is deprecated. Use ${alternative}.`);\r\n return fn.apply(this, args);\r\n };\r\n}\n\nfunction isNamed(src) {\r\n return src !== null && typeof src === \"object\" && typeof src.name === \"string\"\r\n ? true\r\n : false;\r\n}\n\nfunction isPitch(pitch) {\r\n return pitch !== null &&\r\n typeof pitch === \"object\" &&\r\n typeof pitch.step === \"number\" &&\r\n typeof pitch.alt === \"number\"\r\n ? true\r\n : false;\r\n}\r\n// The number of fifths of [C, D, E, F, G, A, B]\r\nconst FIFTHS = [0, 2, 4, -1, 1, 3, 5];\r\n// The number of octaves it span each step\r\nconst STEPS_TO_OCTS = FIFTHS.map((fifths) => Math.floor((fifths * 7) / 12));\r\nfunction encode(pitch) {\r\n const { step, alt, oct, dir = 1 } = pitch;\r\n const f = FIFTHS[step] + 7 * alt;\r\n if (oct === undefined) {\r\n return [dir * f];\r\n }\r\n const o = oct - STEPS_TO_OCTS[step] - 4 * alt;\r\n return [dir * f, dir * o];\r\n}\r\n// We need to get the steps from fifths\r\n// Fifths for CDEFGAB are [ 0, 2, 4, -1, 1, 3, 5 ]\r\n// We add 1 to fifths to avoid negative numbers, so:\r\n// for [\"F\", \"C\", \"G\", \"D\", \"A\", \"E\", \"B\"] we have:\r\nconst FIFTHS_TO_STEPS = [3, 0, 4, 1, 5, 2, 6];\r\nfunction decode(coord) {\r\n const [f, o, dir] = coord;\r\n const step = FIFTHS_TO_STEPS[unaltered(f)];\r\n const alt = Math.floor((f + 1) / 7);\r\n if (o === undefined) {\r\n return { step, alt, dir };\r\n }\r\n const oct = o + 4 * alt + STEPS_TO_OCTS[step];\r\n return { step, alt, oct, dir };\r\n}\r\n// Return the number of fifths as if it were unaltered\r\nfunction unaltered(f) {\r\n const i = (f + 1) % 7;\r\n return i < 0 ? 7 + i : i;\r\n}\n\nconst NoNote = { empty: true, name: \"\", pc: \"\", acc: \"\" };\r\nconst cache = new Map();\r\nconst stepToLetter = (step) => \"CDEFGAB\".charAt(step);\r\nconst altToAcc = (alt) => alt < 0 ? fillStr(\"b\", -alt) : fillStr(\"#\", alt);\r\nconst accToAlt = (acc) => acc[0] === \"b\" ? -acc.length : acc.length;\r\n/**\r\n * Given a note literal (a note name or a note object), returns the Note object\r\n * @example\r\n * note('Bb4') // => { name: \"Bb4\", midi: 70, chroma: 10, ... }\r\n */\r\nfunction note(src) {\r\n const cached = cache.get(src);\r\n if (cached) {\r\n return cached;\r\n }\r\n const value = typeof src === \"string\"\r\n ? parse(src)\r\n : isPitch(src)\r\n ? note(pitchName(src))\r\n : isNamed(src)\r\n ? note(src.name)\r\n : NoNote;\r\n cache.set(src, value);\r\n return value;\r\n}\r\nconst REGEX = /^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\\d*)\\s*(.*)$/;\r\n/**\r\n * @private\r\n */\r\nfunction tokenizeNote(str) {\r\n const m = REGEX.exec(str);\r\n return [m[1].toUpperCase(), m[2].replace(/x/g, \"##\"), m[3], m[4]];\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction coordToNote(noteCoord) {\r\n return note(decode(noteCoord));\r\n}\r\nconst SEMI = [0, 2, 4, 5, 7, 9, 11];\r\nfunction parse(noteName) {\r\n const tokens = tokenizeNote(noteName);\r\n if (tokens[0] === \"\" || tokens[3] !== \"\") {\r\n return NoNote;\r\n }\r\n const letter = tokens[0];\r\n const acc = tokens[1];\r\n const octStr = tokens[2];\r\n const step = (letter.charCodeAt(0) + 3) % 7;\r\n const alt = accToAlt(acc);\r\n const oct = octStr.length ? +octStr : undefined;\r\n const coord = encode({ step, alt, oct });\r\n const name = letter + acc + octStr;\r\n const pc = letter + acc;\r\n const chroma = (SEMI[step] + alt + 120) % 12;\r\n const o = oct === undefined ? -100 : oct;\r\n const height = SEMI[step] + alt + 12 * (o + 1);\r\n const midi = height >= 0 && height <= 127 ? height : null;\r\n const freq = oct === undefined ? null : Math.pow(2, (height - 69) / 12) * 440;\r\n return {\r\n empty: false,\r\n acc,\r\n alt,\r\n chroma,\r\n coord,\r\n freq,\r\n height,\r\n letter,\r\n midi,\r\n name,\r\n oct,\r\n pc,\r\n step,\r\n };\r\n}\r\nfunction pitchName(props) {\r\n const { step, alt, oct } = props;\r\n const letter = stepToLetter(step);\r\n if (!letter) {\r\n return \"\";\r\n }\r\n const pc = letter + altToAcc(alt);\r\n return oct || oct === 0 ? pc + oct : pc;\r\n}\n\nconst NoInterval = { empty: true, name: \"\", acc: \"\" };\r\n// shorthand tonal notation (with quality after number)\r\nconst INTERVAL_TONAL_REGEX = \"([-+]?\\\\d+)(d{1,4}|m|M|P|A{1,4})\";\r\n// standard shorthand notation (with quality before number)\r\nconst INTERVAL_SHORTHAND_REGEX = \"(AA|A|P|M|m|d|dd)([-+]?\\\\d+)\";\r\nconst REGEX$1 = new RegExp(\"^\" + INTERVAL_TONAL_REGEX + \"|\" + INTERVAL_SHORTHAND_REGEX + \"$\");\r\n/**\r\n * @private\r\n */\r\nfunction tokenizeInterval(str) {\r\n const m = REGEX$1.exec(`${str}`);\r\n if (m === null) {\r\n return [\"\", \"\"];\r\n }\r\n return m[1] ? [m[1], m[2]] : [m[4], m[3]];\r\n}\r\nconst cache$1 = {};\r\n/**\r\n * Get interval properties. It returns an object with:\r\n *\r\n * - name: the interval name\r\n * - num: the interval number\r\n * - type: 'perfectable' or 'majorable'\r\n * - q: the interval quality (d, m, M, A)\r\n * - dir: interval direction (1 ascending, -1 descending)\r\n * - simple: the simplified number\r\n * - semitones: the size in semitones\r\n * - chroma: the interval chroma\r\n *\r\n * @param {string} interval - the interval name\r\n * @return {Object} the interval properties\r\n *\r\n * @example\r\n * import { interval } from '@tonaljs/core'\r\n * interval('P5').semitones // => 7\r\n * interval('m3').type // => 'majorable'\r\n */\r\nfunction interval(src) {\r\n return typeof src === \"string\"\r\n ? cache$1[src] || (cache$1[src] = parse$1(src))\r\n : isPitch(src)\r\n ? interval(pitchName$1(src))\r\n : isNamed(src)\r\n ? interval(src.name)\r\n : NoInterval;\r\n}\r\nconst SIZES = [0, 2, 4, 5, 7, 9, 11];\r\nconst TYPES = \"PMMPPMM\";\r\nfunction parse$1(str) {\r\n const tokens = tokenizeInterval(str);\r\n if (tokens[0] === \"\") {\r\n return NoInterval;\r\n }\r\n const num = +tokens[0];\r\n const q = tokens[1];\r\n const step = (Math.abs(num) - 1) % 7;\r\n const t = TYPES[step];\r\n if (t === \"M\" && q === \"P\") {\r\n return NoInterval;\r\n }\r\n const type = t === \"M\" ? \"majorable\" : \"perfectable\";\r\n const name = \"\" + num + q;\r\n const dir = num < 0 ? -1 : 1;\r\n const simple = num === 8 || num === -8 ? num : dir * (step + 1);\r\n const alt = qToAlt(type, q);\r\n const oct = Math.floor((Math.abs(num) - 1) / 7);\r\n const semitones = dir * (SIZES[step] + alt + 12 * oct);\r\n const chroma = (((dir * (SIZES[step] + alt)) % 12) + 12) % 12;\r\n const coord = encode({ step, alt, oct, dir });\r\n return {\r\n empty: false,\r\n name,\r\n num,\r\n q,\r\n step,\r\n alt,\r\n dir,\r\n type,\r\n simple,\r\n semitones,\r\n chroma,\r\n coord,\r\n oct,\r\n };\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction coordToInterval(coord) {\r\n const [f, o = 0] = coord;\r\n const isDescending = f * 7 + o * 12 < 0;\r\n const ivl = isDescending ? [-f, -o, -1] : [f, o, 1];\r\n return interval(decode(ivl));\r\n}\r\nfunction qToAlt(type, q) {\r\n return (q === \"M\" && type === \"majorable\") ||\r\n (q === \"P\" && type === \"perfectable\")\r\n ? 0\r\n : q === \"m\" && type === \"majorable\"\r\n ? -1\r\n : /^A+$/.test(q)\r\n ? q.length\r\n : /^d+$/.test(q)\r\n ? -1 * (type === \"perfectable\" ? q.length : q.length + 1)\r\n : 0;\r\n}\r\n// return the interval name of a pitch\r\nfunction pitchName$1(props) {\r\n const { step, alt, oct = 0, dir } = props;\r\n if (!dir) {\r\n return \"\";\r\n }\r\n const num = step + 1 + 7 * oct;\r\n const d = dir < 0 ? \"-\" : \"\";\r\n const type = TYPES[step] === \"M\" ? \"majorable\" : \"perfectable\";\r\n const name = d + num + altToQ(type, alt);\r\n return name;\r\n}\r\nfunction altToQ(type, alt) {\r\n if (alt === 0) {\r\n return type === \"majorable\" ? \"M\" : \"P\";\r\n }\r\n else if (alt === -1 && type === \"majorable\") {\r\n return \"m\";\r\n }\r\n else if (alt > 0) {\r\n return fillStr(\"A\", alt);\r\n }\r\n else {\r\n return fillStr(\"d\", type === \"perfectable\" ? alt : alt + 1);\r\n }\r\n}\n\n/**\r\n * Transpose a note by an interval.\r\n *\r\n * @param {string} note - the note or note name\r\n * @param {string} interval - the interval or interval name\r\n * @return {string} the transposed note name or empty string if not valid notes\r\n * @example\r\n * import { tranpose } from \"@tonaljs/core\"\r\n * transpose(\"d3\", \"3M\") // => \"F#3\"\r\n * transpose(\"D\", \"3M\") // => \"F#\"\r\n * [\"C\", \"D\", \"E\", \"F\", \"G\"].map(pc => transpose(pc, \"M3)) // => [\"E\", \"F#\", \"G#\", \"A\", \"B\"]\r\n */\r\nfunction transpose(noteName, intervalName) {\r\n const note$1 = note(noteName);\r\n const interval$1 = interval(intervalName);\r\n if (note$1.empty || interval$1.empty) {\r\n return \"\";\r\n }\r\n const noteCoord = note$1.coord;\r\n const intervalCoord = interval$1.coord;\r\n const tr = noteCoord.length === 1\r\n ? [noteCoord[0] + intervalCoord[0]]\r\n : [noteCoord[0] + intervalCoord[0], noteCoord[1] + intervalCoord[1]];\r\n return coordToNote(tr).name;\r\n}\r\n/**\r\n * Find the interval distance between two notes or coord classes.\r\n *\r\n * To find distance between coord classes, both notes must be coord classes and\r\n * the interval is always ascending\r\n *\r\n * @param {Note|string} from - the note or note name to calculate distance from\r\n * @param {Note|string} to - the note or note name to calculate distance to\r\n * @return {string} the interval name or empty string if not valid notes\r\n *\r\n */\r\nfunction distance(fromNote, toNote) {\r\n const from = note(fromNote);\r\n const to = note(toNote);\r\n if (from.empty || to.empty) {\r\n return \"\";\r\n }\r\n const fcoord = from.coord;\r\n const tcoord = to.coord;\r\n const fifths = tcoord[0] - fcoord[0];\r\n const octs = fcoord.length === 2 && tcoord.length === 2\r\n ? tcoord[1] - fcoord[1]\r\n : -Math.floor((fifths * 7) / 12);\r\n return coordToInterval([fifths, octs]).name;\r\n}\n\nexport { accToAlt, altToAcc, coordToInterval, coordToNote, decode, deprecate, distance, encode, fillStr, interval, isNamed, isPitch, note, stepToLetter, tokenizeInterval, tokenizeNote, transpose };\n//# sourceMappingURL=index.es.js.map\n","import { note, transpose as transpose$1, distance as distance$1 } from '@tonaljs/core';\n\nconst fillStr = (character, times) => Array(times + 1).join(character);\r\nconst REGEX = /^(_{1,}|=|\\^{1,}|)([abcdefgABCDEFG])([,']*)$/;\r\nfunction tokenize(str) {\r\n const m = REGEX.exec(str);\r\n if (!m) {\r\n return [\"\", \"\", \"\"];\r\n }\r\n return [m[1], m[2], m[3]];\r\n}\r\n/**\r\n * Convert a (string) note in ABC notation into a (string) note in scientific notation\r\n *\r\n * @example\r\n * abcToScientificNotation(\"c\") // => \"C5\"\r\n */\r\nfunction abcToScientificNotation(str) {\r\n const [acc, letter, oct] = tokenize(str);\r\n if (letter === \"\") {\r\n return \"\";\r\n }\r\n let o = 4;\r\n for (let i = 0; i < oct.length; i++) {\r\n o += oct.charAt(i) === \",\" ? -1 : 1;\r\n }\r\n const a = acc[0] === \"_\"\r\n ? acc.replace(/_/g, \"b\")\r\n : acc[0] === \"^\"\r\n ? acc.replace(/\\^/g, \"#\")\r\n : \"\";\r\n return letter.charCodeAt(0) > 96\r\n ? letter.toUpperCase() + a + (o + 1)\r\n : letter + a + o;\r\n}\r\n/**\r\n * Convert a (string) note in scientific notation into a (string) note in ABC notation\r\n *\r\n * @example\r\n * scientificToAbcNotation(\"C#4\") // => \"^C\"\r\n */\r\nfunction scientificToAbcNotation(str) {\r\n const n = note(str);\r\n if (n.empty || !n.oct) {\r\n return \"\";\r\n }\r\n const { letter, acc, oct } = n;\r\n const a = acc[0] === \"b\" ? acc.replace(/b/g, \"_\") : acc.replace(/#/g, \"^\");\r\n const l = oct > 4 ? letter.toLowerCase() : letter;\r\n const o = oct === 5 ? \"\" : oct > 4 ? fillStr(\"'\", oct - 5) : fillStr(\",\", 4 - oct);\r\n return a + l + o;\r\n}\r\nfunction transpose(note, interval) {\r\n return scientificToAbcNotation(transpose$1(abcToScientificNotation(note), interval));\r\n}\r\nfunction distance(from, to) {\r\n return distance$1(abcToScientificNotation(from), abcToScientificNotation(to));\r\n}\r\nvar index = {\r\n abcToScientificNotation,\r\n scientificToAbcNotation,\r\n tokenize,\r\n transpose,\r\n distance,\r\n};\n\nexport default index;\nexport { abcToScientificNotation, distance, scientificToAbcNotation, tokenize, transpose };\n//# sourceMappingURL=index.es.js.map\n","import { note } from '@tonaljs/core';\n\n// ascending range\r\nfunction ascR(b, n) {\r\n const a = [];\r\n // tslint:disable-next-line:curly\r\n for (; n--; a[n] = n + b)\r\n ;\r\n return a;\r\n}\r\n// descending range\r\nfunction descR(b, n) {\r\n const a = [];\r\n // tslint:disable-next-line:curly\r\n for (; n--; a[n] = b - n)\r\n ;\r\n return a;\r\n}\r\n/**\r\n * Creates a numeric range\r\n *\r\n * @param {number} from\r\n * @param {number} to\r\n * @return {Array}\r\n *\r\n * @example\r\n * range(-2, 2) // => [-2, -1, 0, 1, 2]\r\n * range(2, -2) // => [2, 1, 0, -1, -2]\r\n */\r\nfunction range(from, to) {\r\n return from < to ? ascR(from, to - from + 1) : descR(from, from - to + 1);\r\n}\r\n/**\r\n * Rotates a list a number of times. It\"s completly agnostic about the\r\n * contents of the list.\r\n *\r\n * @param {Integer} times - the number of rotations\r\n * @param {Array} array\r\n * @return {Array} the rotated array\r\n *\r\n * @example\r\n * rotate(1, [1, 2, 3]) // => [2, 3, 1]\r\n */\r\nfunction rotate(times, arr) {\r\n const len = arr.length;\r\n const n = ((times % len) + len) % len;\r\n return arr.slice(n, len).concat(arr.slice(0, n));\r\n}\r\n/**\r\n * Return a copy of the array with the null values removed\r\n * @function\r\n * @param {Array} array\r\n * @return {Array}\r\n *\r\n * @example\r\n * compact([\"a\", \"b\", null, \"c\"]) // => [\"a\", \"b\", \"c\"]\r\n */\r\nfunction compact(arr) {\r\n return arr.filter((n) => n === 0 || n);\r\n}\r\n/**\r\n * Sort an array of notes in ascending order. Pitch classes are listed\r\n * before notes. Any string that is not a note is removed.\r\n *\r\n * @param {string[]} notes\r\n * @return {string[]} sorted array of notes\r\n *\r\n * @example\r\n * sortedNoteNames(['c2', 'c5', 'c1', 'c0', 'c6', 'c'])\r\n * // => ['C', 'C0', 'C1', 'C2', 'C5', 'C6']\r\n * sortedNoteNames(['c', 'F', 'G', 'a', 'b', 'h', 'J'])\r\n * // => ['C', 'F', 'G', 'A', 'B']\r\n */\r\nfunction sortedNoteNames(notes) {\r\n const valid = notes.map((n) => note(n)).filter((n) => !n.empty);\r\n return valid.sort((a, b) => a.height - b.height).map((n) => n.name);\r\n}\r\n/**\r\n * Get sorted notes with duplicates removed. Pitch classes are listed\r\n * before notes.\r\n *\r\n * @function\r\n * @param {string[]} array\r\n * @return {string[]} unique sorted notes\r\n *\r\n * @example\r\n * Array.sortedUniqNoteNames(['a', 'b', 'c2', '1p', 'p2', 'c2', 'b', 'c', 'c3' ])\r\n * // => [ 'C', 'A', 'B', 'C2', 'C3' ]\r\n */\r\nfunction sortedUniqNoteNames(arr) {\r\n return sortedNoteNames(arr).filter((n, i, a) => i === 0 || n !== a[i - 1]);\r\n}\r\n/**\r\n * Randomizes the order of the specified array in-place, using the Fisher–Yates shuffle.\r\n *\r\n * @function\r\n * @param {Array} array\r\n * @return {Array} the array shuffled\r\n *\r\n * @example\r\n * shuffle([\"C\", \"D\", \"E\", \"F\"]) // => [...]\r\n */\r\nfunction shuffle(arr, rnd = Math.random) {\r\n let i;\r\n let t;\r\n let m = arr.length;\r\n while (m) {\r\n i = Math.floor(rnd() * m--);\r\n t = arr[m];\r\n arr[m] = arr[i];\r\n arr[i] = t;\r\n }\r\n return arr;\r\n}\r\n/**\r\n * Get all permutations of an array\r\n *\r\n * @param {Array} array - the array\r\n * @return {Array} an array with all the permutations\r\n * @example\r\n * permutations([\"a\", \"b\", \"c\"])) // =>\r\n * [\r\n * [\"a\", \"b\", \"c\"],\r\n * [\"b\", \"a\", \"c\"],\r\n * [\"b\", \"c\", \"a\"],\r\n * [\"a\", \"c\", \"b\"],\r\n * [\"c\", \"a\", \"b\"],\r\n * [\"c\", \"b\", \"a\"]\r\n * ]\r\n */\r\nfunction permutations(arr) {\r\n if (arr.length === 0) {\r\n return [[]];\r\n }\r\n return permutations(arr.slice(1)).reduce((acc, perm) => {\r\n return acc.concat(arr.map((e, pos) => {\r\n const newPerm = perm.slice();\r\n newPerm.splice(pos, 0, arr[0]);\r\n return newPerm;\r\n }));\r\n }, []);\r\n}\n\nexport { compact, permutations, range, rotate, shuffle, sortedNoteNames, sortedUniqNoteNames };\n//# sourceMappingURL=index.es.js.map\n","// ascending range\r\nfunction ascR(b, n) {\r\n const a = [];\r\n // tslint:disable-next-line:curly\r\n for (; n--; a[n] = n + b)\r\n ;\r\n return a;\r\n}\r\n// descending range\r\nfunction descR(b, n) {\r\n const a = [];\r\n // tslint:disable-next-line:curly\r\n for (; n--; a[n] = b - n)\r\n ;\r\n return a;\r\n}\r\n/**\r\n * Creates a numeric range\r\n *\r\n * @param {number} from\r\n * @param {number} to\r\n * @return {Array}\r\n *\r\n * @example\r\n * range(-2, 2) // => [-2, -1, 0, 1, 2]\r\n * range(2, -2) // => [2, 1, 0, -1, -2]\r\n */\r\nfunction range(from, to) {\r\n return from < to ? ascR(from, to - from + 1) : descR(from, from - to + 1);\r\n}\r\n/**\r\n * Rotates a list a number of times. It\"s completly agnostic about the\r\n * contents of the list.\r\n *\r\n * @param {Integer} times - the number of rotations\r\n * @param {Array} collection\r\n * @return {Array} the rotated collection\r\n *\r\n * @example\r\n * rotate(1, [1, 2, 3]) // => [2, 3, 1]\r\n */\r\nfunction rotate(times, arr) {\r\n const len = arr.length;\r\n const n = ((times % len) + len) % len;\r\n return arr.slice(n, len).concat(arr.slice(0, n));\r\n}\r\n/**\r\n * Return a copy of the collection with the null values removed\r\n * @function\r\n * @param {Array} collection\r\n * @return {Array}\r\n *\r\n * @example\r\n * compact([\"a\", \"b\", null, \"c\"]) // => [\"a\", \"b\", \"c\"]\r\n */\r\nfunction compact(arr) {\r\n return arr.filter((n) => n === 0 || n);\r\n}\r\n/**\r\n * Randomizes the order of the specified collection in-place, using the Fisher–Yates shuffle.\r\n *\r\n * @function\r\n * @param {Array} collection\r\n * @return {Array} the collection shuffled\r\n *\r\n * @example\r\n * shuffle([\"C\", \"D\", \"E\", \"F\"]) // => [...]\r\n */\r\nfunction shuffle(arr, rnd = Math.random) {\r\n let i;\r\n let t;\r\n let m = arr.length;\r\n while (m) {\r\n i = Math.floor(rnd() * m--);\r\n t = arr[m];\r\n arr[m] = arr[i];\r\n arr[i] = t;\r\n }\r\n return arr;\r\n}\r\n/**\r\n * Get all permutations of an collection\r\n *\r\n * @param {Array} collection - the collection\r\n * @return {Array} an collection with all the permutations\r\n * @example\r\n * permutations([\"a\", \"b\", \"c\"])) // =>\r\n * [\r\n * [\"a\", \"b\", \"c\"],\r\n * [\"b\", \"a\", \"c\"],\r\n * [\"b\", \"c\", \"a\"],\r\n * [\"a\", \"c\", \"b\"],\r\n * [\"c\", \"a\", \"b\"],\r\n * [\"c\", \"b\", \"a\"]\r\n * ]\r\n */\r\nfunction permutations(arr) {\r\n if (arr.length === 0) {\r\n return [[]];\r\n }\r\n return permutations(arr.slice(1)).reduce((acc, perm) => {\r\n return acc.concat(arr.map((e, pos) => {\r\n const newPerm = perm.slice();\r\n newPerm.splice(pos, 0, arr[0]);\r\n return newPerm;\r\n }));\r\n }, []);\r\n}\r\nvar index = {\r\n compact,\r\n permutations,\r\n range,\r\n rotate,\r\n shuffle,\r\n};\n\nexport default index;\nexport { compact, permutations, range, rotate, shuffle };\n//# sourceMappingURL=index.es.js.map\n","import { range, compact, rotate } from '@tonaljs/collection';\nimport { deprecate, note, interval } from '@tonaljs/core';\n\nconst EmptyPcset = {\r\n empty: true,\r\n name: \"\",\r\n setNum: 0,\r\n chroma: \"000000000000\",\r\n normalized: \"000000000000\",\r\n intervals: [],\r\n};\r\n// UTILITIES\r\nconst setNumToChroma = (num) => Number(num).toString(2);\r\nconst chromaToNumber = (chroma) => parseInt(chroma, 2);\r\nconst REGEX = /^[01]{12}$/;\r\nfunction isChroma(set) {\r\n return REGEX.test(set);\r\n}\r\nconst isPcsetNum = (set) => typeof set === \"number\" && set >= 0 && set <= 4095;\r\nconst isPcset = (set) => set && isChroma(set.chroma);\r\nconst cache = { [EmptyPcset.chroma]: EmptyPcset };\r\n/**\r\n * Get the pitch class set of a collection of notes or set number or chroma\r\n */\r\nfunction get(src) {\r\n const chroma = isChroma(src)\r\n ? src\r\n : isPcsetNum(src)\r\n ? setNumToChroma(src)\r\n : Array.isArray(src)\r\n ? listToChroma(src)\r\n : isPcset(src)\r\n ? src.chroma\r\n : EmptyPcset.chroma;\r\n return (cache[chroma] = cache[chroma] || chromaToPcset(chroma));\r\n}\r\n/**\r\n * Use Pcset.properties\r\n * @function\r\n * @deprecated\r\n */\r\nconst pcset = deprecate(\"Pcset.pcset\", \"Pcset.get\", get);\r\n/**\r\n * Get pitch class set chroma\r\n * @function\r\n * @example\r\n * Pcset.chroma([\"c\", \"d\", \"e\"]); //=> \"101010000000\"\r\n */\r\nconst chroma = (set) => get(set).chroma;\r\n/**\r\n * Get intervals (from C) of a set\r\n * @function\r\n * @example\r\n * Pcset.intervals([\"c\", \"d\", \"e\"]); //=>\r\n */\r\nconst intervals = (set) => get(set).intervals;\r\n/**\r\n * Get pitch class set number\r\n * @function\r\n * @example\r\n * Pcset.num([\"c\", \"d\", \"e\"]); //=> 2192\r\n */\r\nconst num = (set) => get(set).setNum;\r\nconst IVLS = [\r\n \"1P\",\r\n \"2m\",\r\n \"2M\",\r\n \"3m\",\r\n \"3M\",\r\n \"4P\",\r\n \"5d\",\r\n \"5P\",\r\n \"6m\",\r\n \"6M\",\r\n \"7m\",\r\n \"7M\",\r\n];\r\n/**\r\n * @private\r\n * Get the intervals of a pcset *starting from C*\r\n * @param {Set} set - the pitch class set\r\n * @return {IntervalName[]} an array of interval names or an empty array\r\n * if not a valid pitch class set\r\n */\r\nfunction chromaToIntervals(chroma) {\r\n const intervals = [];\r\n for (let i = 0; i < 12; i++) {\r\n // tslint:disable-next-line:curly\r\n if (chroma.charAt(i) === \"1\")\r\n intervals.push(IVLS[i]);\r\n }\r\n return intervals;\r\n}\r\n/**\r\n * Get a list of all possible pitch class sets (all possible chromas) *having\r\n * C as root*. There are 2048 different chromas. If you want them with another\r\n * note you have to transpose it\r\n *\r\n * @see http://allthescales.org/\r\n * @return {Array} an array of possible chromas from '10000000000' to '11111111111'\r\n */\r\nfunction chromas() {\r\n return range(2048, 4095).map(setNumToChroma);\r\n}\r\n/**\r\n * Given a a list of notes or a pcset chroma, produce the rotations\r\n * of the chroma discarding the ones that starts with \"0\"\r\n *\r\n * This is used, for example, to get all the modes of a scale.\r\n *\r\n * @param {Array|string} set - the list of notes or pitchChr of the set\r\n * @param {boolean} normalize - (Optional, true by default) remove all\r\n * the rotations that starts with \"0\"\r\n * @return {Array} an array with all the modes of the chroma\r\n *\r\n * @example\r\n * Pcset.modes([\"C\", \"D\", \"E\"]).map(Pcset.intervals)\r\n */\r\nfunction modes(set, normalize = true) {\r\n const pcs = get(set);\r\n const binary = pcs.chroma.split(\"\");\r\n return compact(binary.map((_, i) => {\r\n const r = rotate(i, binary);\r\n return normalize && r[0] === \"0\" ? null : r.join(\"\");\r\n }));\r\n}\r\n/**\r\n * Test if two pitch class sets are numentical\r\n *\r\n * @param {Array|string} set1 - one of the pitch class sets\r\n * @param {Array|string} set2 - the other pitch class set\r\n * @return {boolean} true if they are equal\r\n * @example\r\n * Pcset.isEqual([\"c2\", \"d3\"], [\"c5\", \"d2\"]) // => true\r\n */\r\nfunction isEqual(s1, s2) {\r\n return get(s1).setNum === get(s2).setNum;\r\n}\r\n/**\r\n * Create a function that test if a collection of notes is a\r\n * subset of a given set\r\n *\r\n * The function is curryfied.\r\n *\r\n * @param {PcsetChroma|NoteName[]} set - the superset to test against (chroma or\r\n * list of notes)\r\n * @return{function(PcsetChroma|NoteNames[]): boolean} a function accepting a set\r\n * to test against (chroma or list of notes)\r\n * @example\r\n * const inCMajor = Pcset.isSubsetOf([\"C\", \"E\", \"G\"])\r\n * inCMajor([\"e6\", \"c4\"]) // => true\r\n * inCMajor([\"e6\", \"c4\", \"d3\"]) // => false\r\n */\r\nfunction isSubsetOf(set) {\r\n const s = get(set).setNum;\r\n return (notes) => {\r\n const o = get(notes).setNum;\r\n // tslint:disable-next-line: no-bitwise\r\n return s && s !== o && (o & s) === o;\r\n };\r\n}\r\n/**\r\n * Create a function that test if a collection of notes is a\r\n * superset of a given set (it contains all notes and at least one more)\r\n *\r\n * @param {Set} set - an array of notes or a chroma set string to test against\r\n * @return {(subset: Set): boolean} a function that given a set\r\n * returns true if is a subset of the first one\r\n * @example\r\n * const extendsCMajor = Pcset.isSupersetOf([\"C\", \"E\", \"G\"])\r\n * extendsCMajor([\"e6\", \"a\", \"c4\", \"g2\"]) // => true\r\n * extendsCMajor([\"c6\", \"e4\", \"g3\"]) // => false\r\n */\r\nfunction isSupersetOf(set) {\r\n const s = get(set).setNum;\r\n return (notes) => {\r\n const o = get(notes).setNum;\r\n // tslint:disable-next-line: no-bitwise\r\n return s && s !== o && (o | s) === o;\r\n };\r\n}\r\n/**\r\n * Test if a given pitch class set includes a note\r\n *\r\n * @param {Array} set - the base set to test against\r\n * @param {string} note - the note to test\r\n * @return {boolean} true if the note is included in the pcset\r\n *\r\n * Can be partially applied\r\n *\r\n * @example\r\n * const isNoteInCMajor = isNoteIncludedIn(['C', 'E', 'G'])\r\n * isNoteInCMajor('C4') // => true\r\n * isNoteInCMajor('C#4') // => false\r\n */\r\nfunction isNoteIncludedIn(set) {\r\n const s = get(set);\r\n return (noteName) => {\r\n const n = note(noteName);\r\n return s && !n.empty && s.chroma.charAt(n.chroma) === \"1\";\r\n };\r\n}\r\n/** @deprecated use: isNoteIncludedIn */\r\nconst includes = isNoteIncludedIn;\r\n/**\r\n * Filter a list with a pitch class set\r\n *\r\n * @param {Array|string} set - the pitch class set notes\r\n * @param {Array|string} notes - the note list to be filtered\r\n * @return {Array} the filtered notes\r\n *\r\n * @example\r\n * Pcset.filter([\"C\", \"D\", \"E\"], [\"c2\", \"c#2\", \"d2\", \"c3\", \"c#3\", \"d3\"]) // => [ \"c2\", \"d2\", \"c3\", \"d3\" ])\r\n * Pcset.filter([\"C2\"], [\"c2\", \"c#2\", \"d2\", \"c3\", \"c#3\", \"d3\"]) // => [ \"c2\", \"c3\" ])\r\n */\r\nfunction filter(set) {\r\n const isIncluded = isNoteIncludedIn(set);\r\n return (notes) => {\r\n return notes.filter(isIncluded);\r\n };\r\n}\r\nvar index = {\r\n get,\r\n chroma,\r\n num,\r\n intervals,\r\n chromas,\r\n isSupersetOf,\r\n isSubsetOf,\r\n isNoteIncludedIn,\r\n isEqual,\r\n filter,\r\n modes,\r\n // deprecated\r\n pcset,\r\n};\r\n//// PRIVATE ////\r\nfunction chromaRotations(chroma) {\r\n const binary = chroma.split(\"\");\r\n return binary.map((_, i) => rotate(i, binary).join(\"\"));\r\n}\r\nfunction chromaToPcset(chroma) {\r\n const setNum = chromaToNumber(chroma);\r\n const normalizedNum = chromaRotations(chroma)\r\n .map(chromaToNumber)\r\n .filter((n) => n >= 2048)\r\n .sort()[0];\r\n const normalized = setNumToChroma(normalizedNum);\r\n const intervals = chromaToIntervals(chroma);\r\n return {\r\n empty: false,\r\n name: \"\",\r\n setNum,\r\n chroma,\r\n normalized,\r\n intervals,\r\n };\r\n}\r\nfunction listToChroma(set) {\r\n if (set.length === 0) {\r\n return EmptyPcset.chroma;\r\n }\r\n let pitch;\r\n const binary = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\r\n // tslint:disable-next-line:prefer-for-of\r\n for (let i = 0; i < set.length; i++) {\r\n pitch = note(set[i]);\r\n // tslint:disable-next-line: curly\r\n if (pitch.empty)\r\n pitch = interval(set[i]);\r\n // tslint:disable-next-line: curly\r\n if (!pitch.empty)\r\n binary[pitch.chroma] = 1;\r\n }\r\n return binary.join(\"\");\r\n}\n\nexport default index;\nexport { EmptyPcset, chromaToIntervals, chromas, filter, get, includes, isEqual, isNoteIncludedIn, isSubsetOf, isSupersetOf, modes, pcset };\n//# sourceMappingURL=index.es.js.map\n","import { deprecate } from '@tonaljs/core';\nimport { get as get$1, EmptyPcset } from '@tonaljs/pcset';\n\n/**\r\n * @private\r\n * Chord List\r\n * Source: https://en.wikibooks.org/wiki/Music_Theory/Complete_List_of_Chord_Patterns\r\n * Format: [\"intervals\", \"full name\", \"abrv1 abrv2\"]\r\n */\r\nconst CHORDS = [\r\n // ==Major==\r\n [\"1P 3M 5P\", \"major\", \"M \"],\r\n [\"1P 3M 5P 7M\", \"major seventh\", \"maj7 Δ ma7 M7 Maj7\"],\r\n [\"1P 3M 5P 7M 9M\", \"major ninth\", \"maj9 Δ9\"],\r\n [\"1P 3M 5P 7M 9M 13M\", \"major thirteenth\", \"maj13 Maj13\"],\r\n [\"1P 3M 5P 6M\", \"sixth\", \"6 add6 add13 M6\"],\r\n [\"1P 3M 5P 6M 9M\", \"sixth/ninth\", \"6/9 69\"],\r\n [\"1P 3M 5P 7M 11A\", \"lydian\", \"maj#4 Δ#4 Δ#11\"],\r\n [\"1P 3M 6m 7M\", \"major seventh flat sixth\", \"M7b6\"],\r\n // ==Minor==\r\n // '''Normal'''\r\n [\"1P 3m 5P\", \"minor\", \"m min -\"],\r\n [\"1P 3m 5P 7m\", \"minor seventh\", \"m7 min7 mi7 -7\"],\r\n [\"1P 3m 5P 7M\", \"minor/major seventh\", \"m/ma7 m/maj7 mM7 m/M7 -Δ7 mΔ\"],\r\n [\"1P 3m 5P 6M\", \"minor sixth\", \"m6\"],\r\n [\"1P 3m 5P 7m 9M\", \"minor ninth\", \"m9\"],\r\n [\"1P 3m 5P 7m 9M 11P\", \"minor eleventh\", \"m11\"],\r\n [\"1P 3m 5P 7m 9M 13M\", \"minor thirteenth\", \"m13\"],\r\n // '''Diminished'''\r\n [\"1P 3m 5d\", \"diminished\", \"dim ° o\"],\r\n [\"1P 3m 5d 7d\", \"diminished seventh\", \"dim7 °7 o7\"],\r\n [\"1P 3m 5d 7m\", \"half-diminished\", \"m7b5 ø\"],\r\n // ==Dominant/Seventh==\r\n // '''Normal'''\r\n [\"1P 3M 5P 7m\", \"dominant seventh\", \"7 dom\"],\r\n [\"1P 3M 5P 7m 9M\", \"dominant ninth\", \"9\"],\r\n [\"1P 3M 5P 7m 9M 13M\", \"dominant thirteenth\", \"13\"],\r\n [\"1P 3M 5P 7m 11A\", \"lydian dominant seventh\", \"7#11 7#4\"],\r\n // '''Altered'''\r\n [\"1P 3M 5P 7m 9m\", \"dominant flat ninth\", \"7b9\"],\r\n [\"1P 3M 5P 7m 9A\", \"dominant sharp ninth\", \"7#9\"],\r\n [\"1P 3M 7m 9m\", \"altered\", \"alt7\"],\r\n // '''Suspended'''\r\n [\"1P 4P 5P\", \"suspended fourth\", \"sus4\"],\r\n [\"1P 2M 5P\", \"suspended second\", \"sus2\"],\r\n [\"1P 4P 5P 7m\", \"suspended fourth seventh\", \"7sus4\"],\r\n [\"1P 5P 7m 9M 11P\", \"eleventh\", \"11\"],\r\n [\"1P 4P 5P 7m 9m\", \"suspended fourth flat ninth\", \"b9sus phryg\"],\r\n // ==Other==\r\n [\"1P 5P\", \"fifth\", \"5\"],\r\n [\"1P 3M 5A\", \"augmented\", \"aug + +5\"],\r\n [\"1P 3M 5A 7M\", \"augmented seventh\", \"maj7#5 maj7+5\"],\r\n [\"1P 3M 5P 7M 9M 11A\", \"major sharp eleventh (lydian)\", \"maj9#11 Δ9#11\"],\r\n // ==Legacy==\r\n [\"1P 2M 4P 5P\", \"\", \"sus24 sus4add9\"],\r\n [\"1P 3M 13m\", \"\", \"Mb6\"],\r\n [\"1P 3M 5A 7M 9M\", \"\", \"maj9#5 Maj9#5\"],\r\n [\"1P 3M 5A 7m\", \"\", \"7#5 +7 7aug aug7\"],\r\n [\"1P 3M 5A 7m 9A\", \"\", \"7#5#9 7alt\"],\r\n [\"1P 3M 5A 7m 9M\", \"\", \"9#5 9+\"],\r\n [\"1P 3M 5A 7m 9M 11A\", \"\", \"9#5#11\"],\r\n [\"1P 3M 5A 7m 9m\", \"\", \"7#5b9\"],\r\n [\"1P 3M 5A 7m 9m 11A\", \"\", \"7#5b9#11\"],\r\n [\"1P 3M 5A 9A\", \"\", \"+add#9\"],\r\n [\"1P 3M 5A 9M\", \"\", \"M#5add9 +add9\"],\r\n [\"1P 3M 5P 6M 11A\", \"\", \"M6#11 M6b5 6#11 6b5\"],\r\n [\"1P 3M 5P 6M 7M 9M\", \"\", \"M7add13\"],\r\n [\"1P 3M 5P 6M 9M 11A\", \"\", \"69#11\"],\r\n [\"1P 3M 5P 6m 7m\", \"\", \"7b6\"],\r\n [\"1P 3M 5P 7M 9A 11A\", \"\", \"maj7#9#11\"],\r\n [\"1P 3M 5P 7M 9M 11A 13M\", \"\", \"M13#11 maj13#11 M13+4 M13#4\"],\r\n [\"1P 3M 5P 7M 9m\", \"\", \"M7b9\"],\r\n [\"1P 3M 5P 7m 11A 13m\", \"\", \"7#11b13 7b5b13\"],\r\n [\"1P 3M 5P 7m 13M\", \"\", \"7add6 67 7add13\"],\r\n [\"1P 3M 5P 7m 9A 11A\", \"\", \"7#9#11 7b5#9\"],\r\n [\"1P 3M 5P 7m 9A 11A 13M\", \"\", \"13#9#11\"],\r\n [\"1P 3M 5P 7m 9A 11A 13m\", \"\", \"7#9#11b13\"],\r\n [\"1P 3M 5P 7m 9A 13M\", \"\", \"13#9\"],\r\n [\"1P 3M 5P 7m 9A 13m\", \"\", \"7#9b13\"],\r\n [\"1P 3M 5P 7m 9M 11A\", \"\", \"9#11 9+4 9#4\"],\r\n [\"1P 3M 5P 7m 9M 11A 13M\", \"\", \"13#11 13+4 13#4\"],\r\n [\"1P 3M 5P 7m 9M 11A 13m\", \"\", \"9#11b13 9b5b13\"],\r\n [\"1P 3M 5P 7m 9m 11A\", \"\", \"7b9#11 7b5b9\"],\r\n [\"1P 3M 5P 7m 9m 11A 13M\", \"\", \"13b9#11\"],\r\n [\"1P 3M 5P 7m 9m 11A 13m\", \"\", \"7b9b13#11 7b9#11b13 7b5b9b13\"],\r\n [\"1P 3M 5P 7m 9m 13M\", \"\", \"13b9\"],\r\n [\"1P 3M 5P 7m 9m 13m\", \"\", \"7b9b13\"],\r\n [\"1P 3M 5P 7m 9m 9A\", \"\", \"7b9#9\"],\r\n [\"1P 3M 5P 9M\", \"\", \"Madd9 2 add9 add2\"],\r\n [\"1P 3M 5P 9m\", \"\", \"Maddb9\"],\r\n [\"1P 3M 5d\", \"\", \"Mb5\"],\r\n [\"1P 3M 5d 6M 7m 9M\", \"\", \"13b5\"],\r\n [\"1P 3M 5d 7M\", \"\", \"M7b5\"],\r\n [\"1P 3M 5d 7M 9M\", \"\", \"M9b5\"],\r\n [\"1P 3M 5d 7m\", \"\", \"7b5\"],\r\n [\"1P 3M 5d 7m 9M\", \"\", \"9b5\"],\r\n [\"1P 3M 7m\", \"\", \"7no5\"],\r\n [\"1P 3M 7m 13m\", \"\", \"7b13\"],\r\n [\"1P 3M 7m 9M\", \"\", \"9no5\"],\r\n [\"1P 3M 7m 9M 13M\", \"\", \"13no5\"],\r\n [\"1P 3M 7m 9M 13m\", \"\", \"9b13\"],\r\n [\"1P 3m 4P 5P\", \"\", \"madd4\"],\r\n [\"1P 3m 5A\", \"\", \"m#5 m+ mb6\"],\r\n [\"1P 3m 5P 6M 9M\", \"\", \"m69\"],\r\n [\"1P 3m 5P 6m 7M\", \"\", \"mMaj7b6\"],\r\n [\"1P 3m 5P 6m 7M 9M\", \"\", \"mMaj9b6\"],\r\n [\"1P 3m 5P 7M 9M\", \"\", \"mMaj9\"],\r\n [\"1P 3m 5P 7m 11P\", \"\", \"m7add11 m7add4\"],\r\n [\"1P 3m 5P 9M\", \"\", \"madd9\"],\r\n [\"1P 3m 5d 6M 7M\", \"\", \"o7M7\"],\r\n [\"1P 3m 5d 7M\", \"\", \"oM7\"],\r\n [\"1P 3m 6m 7M\", \"\", \"mb6M7\"],\r\n [\"1P 3m 6m 7m\", \"\", \"m7#5\"],\r\n [\"1P 3m 6m 7m 9M\", \"\", \"m9#5\"],\r\n [\"1P 3m 6m 7m 9M 11P\", \"\", \"m11A\"],\r\n [\"1P 3m 6m 9m\", \"\", \"mb6b9\"],\r\n [\"1P 2M 3m 5d 7m\", \"\", \"m9b5\"],\r\n [\"1P 4P 5A 7M\", \"\", \"M7#5sus4\"],\r\n [\"1P 4P 5A 7M 9M\", \"\", \"M9#5sus4\"],\r\n [\"1P 4P 5A 7m\", \"\", \"7#5sus4\"],\r\n [\"1P 4P 5P 7M\", \"\", \"M7sus4\"],\r\n [\"1P 4P 5P 7M 9M\", \"\", \"M9sus4\"],\r\n [\"1P 4P 5P 7m 9M\", \"\", \"9sus4 9sus\"],\r\n [\"1P 4P 5P 7m 9M 13M\", \"\", \"13sus4 13sus\"],\r\n [\"1P 4P 5P 7m 9m 13m\", \"\", \"7sus4b9b13 7b9b13sus4\"],\r\n [\"1P 4P 7m 10m\", \"\", \"4 quartal\"],\r\n [\"1P 5P 7m 9m 11P\", \"\", \"11b9\"],\r\n];\n\nconst NoChordType = {\r\n ...EmptyPcset,\r\n name: \"\",\r\n quality: \"Unknown\",\r\n intervals: [],\r\n aliases: [],\r\n};\r\nlet dictionary = [];\r\nlet index = {};\r\n/**\r\n * Given a chord name or chroma, return the chord properties\r\n * @param {string} source - chord name or pitch class set chroma\r\n * @example\r\n * import { get } from 'tonaljs/chord-type'\r\n * get('major') // => { name: 'major', ... }\r\n */\r\nfunction get(type) {\r\n return index[type] || NoChordType;\r\n}\r\nconst chordType = deprecate(\"ChordType.chordType\", \"ChordType.get\", get);\r\n/**\r\n * Get all chord (long) names\r\n */\r\nfunction names() {\r\n return dictionary.map((chord) => chord.name).filter((x) => x);\r\n}\r\n/**\r\n * Get all chord symbols\r\n */\r\nfunction symbols() {\r\n return dictionary.map((chord) => chord.aliases[0]).filter((x) => x);\r\n}\r\n/**\r\n * Keys used to reference chord types\r\n */\r\nfunction keys() {\r\n return Object.keys(index);\r\n}\r\n/**\r\n * Return a list of all chord types\r\n */\r\nfunction all() {\r\n return dictionary.slice();\r\n}\r\nconst entries = deprecate(\"ChordType.entries\", \"ChordType.all\", all);\r\n/**\r\n * Clear the dictionary\r\n */\r\nfunction removeAll() {\r\n dictionary = [];\r\n index = {};\r\n}\r\n/**\r\n * Add a chord to the dictionary.\r\n * @param intervals\r\n * @param aliases\r\n * @param [fullName]\r\n */\r\nfunction add(intervals, aliases, fullName) {\r\n const quality = getQuality(intervals);\r\n const chord = {\r\n ...get$1(intervals),\r\n name: fullName || \"\",\r\n quality,\r\n intervals,\r\n aliases,\r\n };\r\n dictionary.push(chord);\r\n if (chord.name) {\r\n index[chord.name] = chord;\r\n }\r\n index[chord.setNum] = chord;\r\n index[chord.chroma] = chord;\r\n chord.aliases.forEach((alias) => addAlias(chord, alias));\r\n}\r\nfunction addAlias(chord, alias) {\r\n index[alias] = chord;\r\n}\r\nfunction getQuality(intervals) {\r\n const has = (interval) => intervals.indexOf(interval) !== -1;\r\n return has(\"5A\")\r\n ? \"Augmented\"\r\n : has(\"3M\")\r\n ? \"Major\"\r\n : has(\"5d\")\r\n ? \"Diminished\"\r\n : has(\"3m\")\r\n ? \"Minor\"\r\n : \"Unknown\";\r\n}\r\nCHORDS.forEach(([ivls, fullName, names]) => add(ivls.split(\" \"), names.split(\" \"), fullName));\r\ndictionary.sort((a, b) => a.setNum - b.setNum);\r\nvar index$1 = {\r\n names,\r\n symbols,\r\n get,\r\n all,\r\n add,\r\n removeAll,\r\n keys,\r\n // deprecated\r\n entries,\r\n chordType,\r\n};\n\nexport default index$1;\nexport { add, addAlias, all, chordType, entries, get, keys, names, removeAll, symbols };\n//# sourceMappingURL=index.es.js.map\n","import { get } from '@tonaljs/chord-type';\nimport { note } from '@tonaljs/core';\nimport { modes } from '@tonaljs/pcset';\n\nconst NotFound = { weight: 0, name: \"\" };\r\nconst namedSet = (notes) => {\r\n const pcToName = notes.reduce((record, n) => {\r\n const chroma = note(n).chroma;\r\n if (chroma !== undefined) {\r\n record[chroma] = record[chroma] || note(n).name;\r\n }\r\n return record;\r\n }, {});\r\n return (chroma) => pcToName[chroma];\r\n};\r\nfunction detect(source) {\r\n const notes = source.map((n) => note(n).pc).filter((x) => x);\r\n if (note.length === 0) {\r\n return [];\r\n }\r\n const found = findExactMatches(notes, 1);\r\n return found\r\n .filter((chord) => chord.weight)\r\n .sort((a, b) => b.weight - a.weight)\r\n .map((chord) => chord.name);\r\n}\r\nfunction findExactMatches(notes, weight) {\r\n const tonic = notes[0];\r\n const tonicChroma = note(tonic).chroma;\r\n const noteName = namedSet(notes);\r\n const allModes = modes(notes, false);\r\n const found = allModes.map((mode, chroma) => {\r\n const chordName = get(mode).aliases[0];\r\n if (!chordName) {\r\n return NotFound;\r\n }\r\n const baseNote = noteName(chroma);\r\n const isInversion = chroma !== tonicChroma;\r\n if (isInversion) {\r\n return { weight: 0.5 * weight, name: `${baseNote}${chordName}/${tonic}` };\r\n }\r\n else {\r\n return { weight: 1 * weight, name: `${baseNote}${chordName}` };\r\n }\r\n });\r\n return found;\r\n}\r\nvar index = { detect };\n\nexport default index;\nexport { detect };\n//# sourceMappingURL=index.es.js.map\n","import { deprecate } from '@tonaljs/core';\nimport { EmptyPcset, get as get$1 } from '@tonaljs/pcset';\n\n// SCALES\r\n// Format: [\"intervals\", \"name\", \"alias1\", \"alias2\", ...]\r\nconst SCALES = [\r\n // 5-note scales\r\n [\"1P 2M 3M 5P 6M\", \"major pentatonic\", \"pentatonic\"],\r\n [\"1P 3M 4P 5P 7M\", \"ionian pentatonic\"],\r\n [\"1P 3M 4P 5P 7m\", \"mixolydian pentatonic\", \"indian\"],\r\n [\"1P 2M 4P 5P 6M\", \"ritusen\"],\r\n [\"1P 2M 4P 5P 7m\", \"egyptian\"],\r\n [\"1P 3M 4P 5d 7m\", \"neopolitan major pentatonic\"],\r\n [\"1P 3m 4P 5P 6m\", \"vietnamese 1\"],\r\n [\"1P 2m 3m 5P 6m\", \"pelog\"],\r\n [\"1P 2m 4P 5P 6m\", \"kumoijoshi\"],\r\n [\"1P 2M 3m 5P 6m\", \"hirajoshi\"],\r\n [\"1P 2m 4P 5d 7m\", \"iwato\"],\r\n [\"1P 2m 4P 5P 7m\", \"in-sen\"],\r\n [\"1P 3M 4A 5P 7M\", \"lydian pentatonic\", \"chinese\"],\r\n [\"1P 3m 4P 6m 7m\", \"malkos raga\"],\r\n [\"1P 3m 4P 5d 7m\", \"locrian pentatonic\", \"minor seven flat five pentatonic\"],\r\n [\"1P 3m 4P 5P 7m\", \"minor pentatonic\", \"vietnamese 2\"],\r\n [\"1P 3m 4P 5P 6M\", \"minor six pentatonic\"],\r\n [\"1P 2M 3m 5P 6M\", \"flat three pentatonic\", \"kumoi\"],\r\n [\"1P 2M 3M 5P 6m\", \"flat six pentatonic\"],\r\n [\"1P 2m 3M 5P 6M\", \"scriabin\"],\r\n [\"1P 3M 5d 6m 7m\", \"whole tone pentatonic\"],\r\n [\"1P 3M 4A 5A 7M\", \"lydian #5P pentatonic\"],\r\n [\"1P 3M 4A 5P 7m\", \"lydian dominant pentatonic\"],\r\n [\"1P 3m 4P 5P 7M\", \"minor #7M pentatonic\"],\r\n [\"1P 3m 4d 5d 7m\", \"super locrian pentatonic\"],\r\n // 6-note scales\r\n [\"1P 2M 3m 4P 5P 7M\", \"minor hexatonic\"],\r\n [\"1P 2A 3M 5P 5A 7M\", \"augmented\"],\r\n [\"1P 2M 3m 3M 5P 6M\", \"major blues\"],\r\n [\"1P 2M 4P 5P 6M 7m\", \"piongio\"],\r\n [\"1P 2m 3M 4A 6M 7m\", \"prometheus neopolitan\"],\r\n [\"1P 2M 3M 4A 6M 7m\", \"prometheus\"],\r\n [\"1P 2m 3M 5d 6m 7m\", \"mystery #1\"],\r\n [\"1P 2m 3M 4P 5A 6M\", \"six tone symmetric\"],\r\n [\"1P 2M 3M 4A 5A 7m\", \"whole tone\", \"messiaen's mode #1\"],\r\n [\"1P 2m 4P 4A 5P 7M\", \"messiaen's mode #5\"],\r\n [\"1P 3m 4P 5d 5P 7m\", \"minor blues\", \"blues\"],\r\n // 7-note scales\r\n [\"1P 2M 3M 4P 5d 6m 7m\", \"locrian major\", \"arabian\"],\r\n [\"1P 2m 3M 4A 5P 6m 7M\", \"double harmonic lydian\"],\r\n [\"1P 2M 3m 4P 5P 6m 7M\", \"harmonic minor\"],\r\n [\r\n \"1P 2m 3m 3M 5d 6m 7m\",\r\n \"altered\",\r\n \"super locrian\",\r\n \"diminished whole tone\",\r\n \"pomeroy\",\r\n ],\r\n [\"1P 2M 3m 4P 5d 6m 7m\", \"locrian #2\", \"half-diminished\", \"aeolian b5\"],\r\n [\r\n \"1P 2M 3M 4P 5P 6m 7m\",\r\n \"mixolydian b6\",\r\n \"melodic minor fifth mode\",\r\n \"hindu\",\r\n ],\r\n [\"1P 2M 3M 4A 5P 6M 7m\", \"lydian dominant\", \"lydian b7\", \"overtone\"],\r\n [\"1P 2M 3M 4A 5P 6M 7M\", \"lydian\"],\r\n [\"1P 2M 3M 4A 5A 6M 7M\", \"lydian augmented\"],\r\n [\r\n \"1P 2m 3m 4P 5P 6M 7m\",\r\n \"dorian b2\",\r\n \"phrygian #6\",\r\n \"melodic minor second mode\",\r\n ],\r\n [\"1P 2M 3m 4P 5P 6M 7M\", \"melodic minor\"],\r\n [\"1P 2m 3m 4P 5d 6m 7m\", \"locrian\"],\r\n [\r\n \"1P 2m 3m 4d 5d 6m 7d\",\r\n \"ultralocrian\",\r\n \"superlocrian bb7\",\r\n \"·superlocrian diminished\",\r\n ],\r\n [\"1P 2m 3m 4P 5d 6M 7m\", \"locrian 6\", \"locrian natural 6\", \"locrian sharp 6\"],\r\n [\"1P 2A 3M 4P 5P 5A 7M\", \"augmented heptatonic\"],\r\n [\"1P 2M 3m 5d 5P 6M 7m\", \"romanian minor\"],\r\n [\"1P 2M 3m 4A 5P 6M 7m\", \"dorian #4\"],\r\n [\"1P 2M 3m 4A 5P 6M 7M\", \"lydian diminished\"],\r\n [\"1P 2m 3m 4P 5P 6m 7m\", \"phrygian\"],\r\n [\"1P 2M 3M 4A 5A 7m 7M\", \"leading whole tone\"],\r\n [\"1P 2M 3M 4A 5P 6m 7m\", \"lydian minor\"],\r\n [\"1P 2m 3M 4P 5P 6m 7m\", \"phrygian dominant\", \"spanish\", \"phrygian major\"],\r\n [\"1P 2m 3m 4P 5P 6m 7M\", \"balinese\"],\r\n [\"1P 2m 3m 4P 5P 6M 7M\", \"neopolitan major\"],\r\n [\"1P 2M 3m 4P 5P 6m 7m\", \"aeolian\", \"minor\"],\r\n [\"1P 2M 3M 4P 5P 6m 7M\", \"harmonic major\"],\r\n [\"1P 2m 3M 4P 5P 6m 7M\", \"double harmonic major\", \"gypsy\"],\r\n [\"1P 2M 3m 4P 5P 6M 7m\", \"dorian\"],\r\n [\"1P 2M 3m 4A 5P 6m 7M\", \"hungarian minor\"],\r\n [\"1P 2A 3M 4A 5P 6M 7m\", \"hungarian major\"],\r\n [\"1P 2m 3M 4P 5d 6M 7m\", \"oriental\"],\r\n [\"1P 2m 3m 3M 4A 5P 7m\", \"flamenco\"],\r\n [\"1P 2m 3m 4A 5P 6m 7M\", \"todi raga\"],\r\n [\"1P 2M 3M 4P 5P 6M 7m\", \"mixolydian\", \"dominant\"],\r\n [\"1P 2m 3M 4P 5d 6m 7M\", \"persian\"],\r\n [\"1P 2M 3M 4P 5P 6M 7M\", \"major\", \"ionian\"],\r\n [\"1P 2m 3M 5d 6m 7m 7M\", \"enigmatic\"],\r\n [\r\n \"1P 2M 3M 4P 5A 6M 7M\",\r\n \"major augmented\",\r\n \"major #5\",\r\n \"ionian augmented\",\r\n \"ionian #5\",\r\n ],\r\n [\"1P 2A 3M 4A 5P 6M 7M\", \"lydian #9\"],\r\n // 8-note scales\r\n [\"1P 2m 2M 4P 4A 5P 6m 7M\", \"messiaen's mode #4\"],\r\n [\"1P 2m 3M 4P 4A 5P 6m 7M\", \"purvi raga\"],\r\n [\"1P 2m 3m 3M 4P 5P 6m 7m\", \"spanish heptatonic\"],\r\n [\"1P 2M 3M 4P 5P 6M 7m 7M\", \"bebop\"],\r\n [\"1P 2M 3m 3M 4P 5P 6M 7m\", \"bebop minor\"],\r\n [\"1P 2M 3M 4P 5P 5A 6M 7M\", \"bebop major\"],\r\n [\"1P 2m 3m 4P 5d 5P 6m 7m\", \"bebop locrian\"],\r\n [\"1P 2M 3m 4P 5P 6m 7m 7M\", \"minor bebop\"],\r\n [\"1P 2M 3m 4P 5d 6m 6M 7M\", \"diminished\", \"whole-half diminished\"],\r\n [\"1P 2M 3M 4P 5d 5P 6M 7M\", \"ichikosucho\"],\r\n [\"1P 2M 3m 4P 5P 6m 6M 7M\", \"minor six diminished\"],\r\n [\"1P 2m 3m 3M 4A 5P 6M 7m\", \"half-whole diminished\", \"dominant diminished\", \"messiaen's mode #2\"],\r\n [\"1P 3m 3M 4P 5P 6M 7m 7M\", \"kafi raga\"],\r\n [\"1P 2M 3M 4P 4A 5A 6A 7M\", \"messiaen's mode #6\"],\r\n // 9-note scales\r\n [\"1P 2M 3m 3M 4P 5d 5P 6M 7m\", \"composite blues\"],\r\n [\"1P 2M 3m 3M 4A 5P 6m 7m 7M\", \"messiaen's mode #3\"],\r\n // 10-note scales\r\n [\"1P 2m 2M 3m 4P 4A 5P 6m 6M 7M\", \"messiaen's mode #7\"],\r\n // 12-note scales\r\n [\"1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M\", \"chromatic\"],\r\n];\n\nconst NoScaleType = {\r\n ...EmptyPcset,\r\n intervals: [],\r\n aliases: [],\r\n};\r\nlet dictionary = [];\r\nlet index = {};\r\nfunction names() {\r\n return dictionary.map((scale) => scale.name);\r\n}\r\n/**\r\n * Given a scale name or chroma, return the scale properties\r\n *\r\n * @param {string} type - scale name or pitch class set chroma\r\n * @example\r\n * import { get } from 'tonaljs/scale-type'\r\n * get('major') // => { name: 'major', ... }\r\n */\r\nfunction get(type) {\r\n return index[type] || NoScaleType;\r\n}\r\nconst scaleType = deprecate(\"ScaleDictionary.scaleType\", \"ScaleType.get\", get);\r\n/**\r\n * Return a list of all scale types\r\n */\r\nfunction all() {\r\n return dictionary.slice();\r\n}\r\nconst entries = deprecate(\"ScaleDictionary.entries\", \"ScaleType.all\", all);\r\n/**\r\n * Keys used to reference scale types\r\n */\r\nfunction keys() {\r\n return Object.keys(index);\r\n}\r\n/**\r\n * Clear the dictionary\r\n */\r\nfunction removeAll() {\r\n dictionary = [];\r\n index = {};\r\n}\r\n/**\r\n * Add a scale into dictionary\r\n * @param intervals\r\n * @param name\r\n * @param aliases\r\n */\r\nfunction add(intervals, name, aliases = []) {\r\n const scale = { ...get$1(intervals), name, intervals, aliases };\r\n dictionary.push(scale);\r\n index[scale.name] = scale;\r\n index[scale.setNum] = scale;\r\n index[scale.chroma] = scale;\r\n scale.aliases.forEach((alias) => addAlias(scale, alias));\r\n return scale;\r\n}\r\nfunction addAlias(scale, alias) {\r\n index[alias] = scale;\r\n}\r\nSCALES.forEach(([ivls, name, ...aliases]) => add(ivls.split(\" \"), name, aliases));\r\nvar index$1 = {\r\n names,\r\n get,\r\n all,\r\n add,\r\n removeAll,\r\n keys,\r\n // deprecated\r\n entries,\r\n scaleType,\r\n};\n\nexport default index$1;\nexport { NoScaleType, add, addAlias, all, entries, get, keys, names, removeAll, scaleType };\n//# sourceMappingURL=index.es.js.map\n","import { detect } from '@tonaljs/chord-detect';\nexport { detect } from '@tonaljs/chord-detect';\nimport { get as get$1, all as all$1 } from '@tonaljs/chord-type';\nimport { tokenizeNote, note, distance, transpose as transpose$1, deprecate } from '@tonaljs/core';\nimport { isSupersetOf, isSubsetOf } from '@tonaljs/pcset';\nimport { all } from '@tonaljs/scale-type';\n\nconst NoChord = {\r\n empty: true,\r\n name: \"\",\r\n symbol: \"\",\r\n root: \"\",\r\n rootDegree: 0,\r\n type: \"\",\r\n tonic: null,\r\n setNum: NaN,\r\n quality: \"Unknown\",\r\n chroma: \"\",\r\n normalized: \"\",\r\n aliases: [],\r\n notes: [],\r\n intervals: [],\r\n};\r\n// 6, 64, 7, 9, 11 and 13 are consider part of the chord\r\n// (see https://github.com/danigb/tonal/issues/55)\r\nconst NUM_TYPES = /^(6|64|7|9|11|13)$/;\r\n/**\r\n * Tokenize a chord name. It returns an array with the tonic and chord type\r\n * If not tonic is found, all the name is considered the chord name.\r\n *\r\n * This function does NOT check if the chord type exists or not. It only tries\r\n * to split the tonic and chord type.\r\n *\r\n * @function\r\n * @param {string} name - the chord name\r\n * @return {Array} an array with [tonic, type]\r\n * @example\r\n * tokenize(\"Cmaj7\") // => [ \"C\", \"maj7\" ]\r\n * tokenize(\"C7\") // => [ \"C\", \"7\" ]\r\n * tokenize(\"mMaj7\") // => [ null, \"mMaj7\" ]\r\n * tokenize(\"Cnonsense\") // => [ null, \"nonsense\" ]\r\n */\r\nfunction tokenize(name) {\r\n const [letter, acc, oct, type] = tokenizeNote(name);\r\n if (letter === \"\") {\r\n return [\"\", name];\r\n }\r\n // aug is augmented (see https://github.com/danigb/tonal/issues/55)\r\n if (letter === \"A\" && type === \"ug\") {\r\n return [\"\", \"aug\"];\r\n }\r\n // see: https://github.com/tonaljs/tonal/issues/70\r\n if (!type && (oct === \"4\" || oct === \"5\")) {\r\n return [letter + acc, oct];\r\n }\r\n if (NUM_TYPES.test(oct)) {\r\n return [letter + acc, oct + type];\r\n }\r\n else {\r\n return [letter + acc + oct, type];\r\n }\r\n}\r\n/**\r\n * Get a Chord from a chord name.\r\n */\r\nfunction get(src) {\r\n if (src === \"\") {\r\n return NoChord;\r\n }\r\n if (Array.isArray(src) && src.length === 2) {\r\n return getChord(src[1], src[0]);\r\n }\r\n else {\r\n const [tonic, type] = tokenize(src);\r\n const chord = getChord(type, tonic);\r\n return chord.empty ? getChord(src) : chord;\r\n }\r\n}\r\n/**\r\n * Get chord properties\r\n *\r\n * @param typeName - the chord type name\r\n * @param [tonic] - Optional tonic\r\n * @param [root] - Optional root (requires a tonic)\r\n */\r\nfunction getChord(typeName, optionalTonic, optionalRoot) {\r\n const type = get$1(typeName);\r\n const tonic = note(optionalTonic || \"\");\r\n const root = note(optionalRoot || \"\");\r\n if (type.empty ||\r\n (optionalTonic && tonic.empty) ||\r\n (optionalRoot && root.empty)) {\r\n return NoChord;\r\n }\r\n const rootInterval = distance(tonic.pc, root.pc);\r\n const rootDegree = type.intervals.indexOf(rootInterval) + 1;\r\n if (!root.empty && !rootDegree) {\r\n return NoChord;\r\n }\r\n const notes = tonic.empty\r\n ? []\r\n : type.intervals.map((i) => transpose$1(tonic, i));\r\n typeName = type.aliases.indexOf(typeName) !== -1 ? typeName : type.aliases[0];\r\n const symbol = `${tonic.empty ? \"\" : tonic.pc}${typeName}${root.empty ? \"\" : \"/\" + root.pc}`;\r\n const name = `${optionalTonic ? tonic.pc + \" \" : \"\"}${type.name}${optionalRoot ? \" over \" + root.pc : \"\"}`;\r\n return {\r\n ...type,\r\n name,\r\n symbol,\r\n type: type.name,\r\n root: root.name,\r\n rootDegree,\r\n tonic: tonic.name,\r\n notes,\r\n };\r\n}\r\nconst chord = deprecate(\"Chord.chord\", \"Chord.get\", get);\r\n/**\r\n * Transpose a chord name\r\n *\r\n * @param {string} chordName - the chord name\r\n * @return {string} the transposed chord\r\n *\r\n * @example\r\n * transpose('Dm7', 'P4') // => 'Gm7\r\n */\r\nfunction transpose(chordName, interval) {\r\n const [tonic, type] = tokenize(chordName);\r\n if (!tonic) {\r\n return chordName;\r\n }\r\n return transpose$1(tonic, interval) + type;\r\n}\r\n/**\r\n * Get all scales where the given chord fits\r\n *\r\n * @example\r\n * chordScales('C7b9')\r\n * // => [\"phrygian dominant\", \"flamenco\", \"spanish heptatonic\", \"half-whole diminished\", \"chromatic\"]\r\n */\r\nfunction chordScales(name) {\r\n const s = get(name);\r\n const isChordIncluded = isSupersetOf(s.chroma);\r\n return all()\r\n .filter((scale) => isChordIncluded(scale.chroma))\r\n .map((scale) => scale.name);\r\n}\r\n/**\r\n * Get all chords names that are a superset of the given one\r\n * (has the same notes and at least one more)\r\n *\r\n * @function\r\n * @example\r\n * extended(\"CMaj7\")\r\n * // => [ 'Cmaj#4', 'Cmaj7#9#11', 'Cmaj9', 'CM7add13', 'Cmaj13', 'Cmaj9#11', 'CM13#11', 'CM7b9' ]\r\n */\r\nfunction extended(chordName) {\r\n const s = get(chordName);\r\n const isSuperset = isSupersetOf(s.chroma);\r\n return all$1()\r\n .filter((chord) => isSuperset(chord.chroma))\r\n .map((chord) => s.tonic + chord.aliases[0]);\r\n}\r\n/**\r\n * Find all chords names that are a subset of the given one\r\n * (has less notes but all from the given chord)\r\n *\r\n * @example\r\n */\r\nfunction reduced(chordName) {\r\n const s = get(chordName);\r\n const isSubset = isSubsetOf(s.chroma);\r\n return all$1()\r\n .filter((chord) => isSubset(chord.chroma))\r\n .map((chord) => s.tonic + chord.aliases[0]);\r\n}\r\nvar index = {\r\n getChord,\r\n get,\r\n detect,\r\n chordScales,\r\n extended,\r\n reduced,\r\n tokenize,\r\n transpose,\r\n // deprecate\r\n chord,\r\n};\n\nexport default index;\nexport { chord, chordScales, extended, get, getChord, reduced, tokenize, transpose };\n//# sourceMappingURL=index.es.js.map\n","// source: https://en.wikipedia.org/wiki/Note_value\r\nconst DATA = [\r\n [\r\n 0.125,\r\n \"dl\",\r\n [\"large\", \"duplex longa\", \"maxima\", \"octuple\", \"octuple whole\"],\r\n ],\r\n [0.25, \"l\", [\"long\", \"longa\"]],\r\n [0.5, \"d\", [\"double whole\", \"double\", \"breve\"]],\r\n [1, \"w\", [\"whole\", \"semibreve\"]],\r\n [2, \"h\", [\"half\", \"minim\"]],\r\n [4, \"q\", [\"quarter\", \"crotchet\"]],\r\n [8, \"e\", [\"eighth\", \"quaver\"]],\r\n [16, \"s\", [\"sixteenth\", \"semiquaver\"]],\r\n [32, \"t\", [\"thirty-second\", \"demisemiquaver\"]],\r\n [64, \"sf\", [\"sixty-fourth\", \"hemidemisemiquaver\"]],\r\n [128, \"h\", [\"hundred twenty-eighth\"]],\r\n [256, \"th\", [\"two hundred fifty-sixth\"]],\r\n];\n\nconst VALUES = [];\r\nDATA.forEach(([denominator, shorthand, names]) => add(denominator, shorthand, names));\r\nconst NoDuration = {\r\n empty: true,\r\n name: \"\",\r\n value: 0,\r\n fraction: [0, 0],\r\n shorthand: \"\",\r\n dots: \"\",\r\n names: [],\r\n};\r\nfunction names() {\r\n return VALUES.reduce((names, duration) => {\r\n duration.names.forEach((name) => names.push(name));\r\n return names;\r\n }, []);\r\n}\r\nfunction shorthands() {\r\n return VALUES.map((dur) => dur.shorthand);\r\n}\r\nconst REGEX = /^([^.]+)(\\.*)$/;\r\nfunction get(name) {\r\n const [_, simple, dots] = REGEX.exec(name) || [];\r\n const base = VALUES.find((dur) => dur.shorthand === simple || dur.names.includes(simple));\r\n if (!base) {\r\n return NoDuration;\r\n }\r\n const fraction = calcDots(base.fraction, dots.length);\r\n const value = fraction[0] / fraction[1];\r\n return { ...base, name, dots, value, fraction };\r\n}\r\nconst value = (name) => get(name).value;\r\nconst fraction = (name) => get(name).fraction;\r\nvar index = { names, shorthands, get, value, fraction };\r\n//// PRIVATE ////\r\nfunction add(denominator, shorthand, names) {\r\n VALUES.push({\r\n empty: false,\r\n dots: \"\",\r\n name: \"\",\r\n value: 1 / denominator,\r\n fraction: denominator < 1 ? [1 / denominator, 1] : [1, denominator],\r\n shorthand,\r\n names,\r\n });\r\n}\r\nfunction calcDots(fraction, dots) {\r\n const pow = Math.pow(2, dots);\r\n let numerator = fraction[0] * pow;\r\n let denominator = fraction[1] * pow;\r\n const base = numerator;\r\n // add fractions\r\n for (let i = 0; i < dots; i++) {\r\n numerator += base / Math.pow(2, i + 1);\r\n }\r\n // simplify\r\n while (numerator % 2 === 0 && denominator % 2 === 0) {\r\n numerator /= 2;\r\n denominator /= 2;\r\n }\r\n return [numerator, denominator];\r\n}\n\nexport default index;\nexport { fraction, get, names, shorthands, value };\n//# sourceMappingURL=index.es.js.map\n","import { interval, distance as distance$1, coordToInterval } from '@tonaljs/core';\n\n/**\r\n * Get the natural list of names\r\n */\r\nfunction names() {\r\n return \"1P 2M 3M 4P 5P 6m 7m\".split(\" \");\r\n}\r\n/**\r\n * Get properties of an interval\r\n *\r\n * @function\r\n * @example\r\n * Interval.get('P4') // => {\"alt\": 0, \"dir\": 1, \"name\": \"4P\", \"num\": 4, \"oct\": 0, \"q\": \"P\", \"semitones\": 5, \"simple\": 4, \"step\": 3, \"type\": \"perfectable\"}\r\n */\r\nconst get = interval;\r\n/**\r\n * Get name of an interval\r\n *\r\n * @function\r\n * @example\r\n * Interval.name('4P') // => \"4P\"\r\n * Interval.name('P4') // => \"4P\"\r\n * Interval.name('C4') // => \"\"\r\n */\r\nconst name = (name) => interval(name).name;\r\n/**\r\n * Get semitones of an interval\r\n * @function\r\n * @example\r\n * Interval.semitones('P4') // => 5\r\n */\r\nconst semitones = (name) => interval(name).semitones;\r\n/**\r\n * Get quality of an interval\r\n * @function\r\n * @example\r\n * Interval.quality('P4') // => \"P\"\r\n */\r\nconst quality = (name) => interval(name).q;\r\n/**\r\n * Get number of an interval\r\n * @function\r\n * @example\r\n * Interval.num('P4') // => 4\r\n */\r\nconst num = (name) => interval(name).num;\r\n/**\r\n * Get the simplified version of an interval.\r\n *\r\n * @function\r\n * @param {string} interval - the interval to simplify\r\n * @return {string} the simplified interval\r\n *\r\n * @example\r\n * Interval.simplify(\"9M\") // => \"2M\"\r\n * Interval.simplify(\"2M\") // => \"2M\"\r\n * Interval.simplify(\"-2M\") // => \"7m\"\r\n * [\"8P\", \"9M\", \"10M\", \"11P\", \"12P\", \"13M\", \"14M\", \"15P\"].map(Interval.simplify)\r\n * // => [ \"8P\", \"2M\", \"3M\", \"4P\", \"5P\", \"6M\", \"7M\", \"8P\" ]\r\n */\r\nfunction simplify(name) {\r\n const i = interval(name);\r\n return i.empty ? \"\" : i.simple + i.q;\r\n}\r\n/**\r\n * Get the inversion (https://en.wikipedia.org/wiki/Inversion_(music)#Intervals)\r\n * of an interval.\r\n *\r\n * @function\r\n * @param {string} interval - the interval to invert in interval shorthand\r\n * notation or interval array notation\r\n * @return {string} the inverted interval\r\n *\r\n * @example\r\n * Interval.invert(\"3m\") // => \"6M\"\r\n * Interval.invert(\"2M\") // => \"7m\"\r\n */\r\nfunction invert(name) {\r\n const i = interval(name);\r\n if (i.empty) {\r\n return \"\";\r\n }\r\n const step = (7 - i.step) % 7;\r\n const alt = i.type === \"perfectable\" ? -i.alt : -(i.alt + 1);\r\n return interval({ step, alt, oct: i.oct, dir: i.dir }).name;\r\n}\r\n// interval numbers\r\nconst IN = [1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7];\r\n// interval qualities\r\nconst IQ = \"P m M m M P d P m M m M\".split(\" \");\r\n/**\r\n * Get interval name from semitones number. Since there are several interval\r\n * names for the same number, the name it's arbitrary, but deterministic.\r\n *\r\n * @param {Integer} num - the number of semitones (can be negative)\r\n * @return {string} the interval name\r\n * @example\r\n * Interval.fromSemitones(7) // => \"5P\"\r\n * Interval.fromSemitones(-7) // => \"-5P\"\r\n */\r\nfunction fromSemitones(semitones) {\r\n const d = semitones < 0 ? -1 : 1;\r\n const n = Math.abs(semitones);\r\n const c = n % 12;\r\n const o = Math.floor(n / 12);\r\n return d * (IN[c] + 7 * o) + IQ[c];\r\n}\r\n/**\r\n * Find interval between two notes\r\n *\r\n * @example\r\n * Interval.distance(\"C4\", \"G4\"); // => \"5P\"\r\n */\r\nconst distance = distance$1;\r\n/**\r\n * Adds two intervals\r\n *\r\n * @function\r\n * @param {string} interval1\r\n * @param {string} interval2\r\n * @return {string} the added interval name\r\n * @example\r\n * Interval.add(\"3m\", \"5P\") // => \"7m\"\r\n */\r\nconst add = combinator((a, b) => [a[0] + b[0], a[1] + b[1]]);\r\n/**\r\n * Returns a function that adds an interval\r\n *\r\n * @function\r\n * @example\r\n * ['1P', '2M', '3M'].map(Interval.addTo('5P')) // => [\"5P\", \"6M\", \"7M\"]\r\n */\r\nconst addTo = (interval) => (other) => add(interval, other);\r\n/**\r\n * Subtracts two intervals\r\n *\r\n * @function\r\n * @param {string} minuendInterval\r\n * @param {string} subtrahendInterval\r\n * @return {string} the substracted interval name\r\n * @example\r\n * Interval.substract('5P', '3M') // => '3m'\r\n * Interval.substract('3M', '5P') // => '-3m'\r\n */\r\nconst substract = combinator((a, b) => [a[0] - b[0], a[1] - b[1]]);\r\nvar index = {\r\n names,\r\n get,\r\n name,\r\n num,\r\n semitones,\r\n quality,\r\n fromSemitones,\r\n distance,\r\n invert,\r\n simplify,\r\n add,\r\n addTo,\r\n substract,\r\n};\r\nfunction combinator(fn) {\r\n return (a, b) => {\r\n const coordA = interval(a).coord;\r\n const coordB = interval(b).coord;\r\n if (coordA && coordB) {\r\n const coord = fn(coordA, coordB);\r\n return coordToInterval(coord).name;\r\n }\r\n };\r\n}\n\nexport default index;\nexport { add, addTo, distance, fromSemitones, get, invert, name, names, num, quality, semitones, simplify, substract };\n//# sourceMappingURL=index.es.js.map\n","import { note } from '@tonaljs/core';\n\nfunction isMidi(arg) {\r\n return +arg >= 0 && +arg <= 127;\r\n}\r\n/**\r\n * Get the note midi number (a number between 0 and 127)\r\n *\r\n * It returns undefined if not valid note name\r\n *\r\n * @function\r\n * @param {string|number} note - the note name or midi number\r\n * @return {Integer} the midi number or undefined if not valid note\r\n * @example\r\n * import { toMidi } from '@tonaljs/midi'\r\n * toMidi(\"C4\") // => 60\r\n * toMidi(60) // => 60\r\n * toMidi('60') // => 60\r\n */\r\nfunction toMidi(note$1) {\r\n if (isMidi(note$1)) {\r\n return +note$1;\r\n }\r\n const n = note(note$1);\r\n return n.empty ? null : n.midi;\r\n}\r\n/**\r\n * Get the frequency in hertzs from midi number\r\n *\r\n * @param {number} midi - the note midi number\r\n * @param {number} [tuning = 440] - A4 tuning frequency in Hz (440 by default)\r\n * @return {number} the frequency or null if not valid note midi\r\n * @example\r\n * import { midiToFreq} from '@tonaljs/midi'\r\n * midiToFreq(69) // => 440\r\n */\r\nfunction midiToFreq(midi, tuning = 440) {\r\n return Math.pow(2, (midi - 69) / 12) * tuning;\r\n}\r\nconst L2 = Math.log(2);\r\nconst L440 = Math.log(440);\r\n/**\r\n * Get the midi number from a frequency in hertz. The midi number can\r\n * contain decimals (with two digits precission)\r\n *\r\n * @param {number} frequency\r\n * @return {number}\r\n * @example\r\n * import { freqToMidi} from '@tonaljs/midi'\r\n * freqToMidi(220)); //=> 57\r\n * freqToMidi(261.62)); //=> 60\r\n * freqToMidi(261)); //=> 59.96\r\n */\r\nfunction freqToMidi(freq) {\r\n const v = (12 * (Math.log(freq) - L440)) / L2 + 69;\r\n return Math.round(v * 100) / 100;\r\n}\r\nconst SHARPS = \"C C# D D# E F F# G G# A A# B\".split(\" \");\r\nconst FLATS = \"C Db D Eb E F Gb G Ab A Bb B\".split(\" \");\r\n/**\r\n * Given a midi number, returns a note name. The altered notes will have\r\n * flats unless explicitly set with the optional `useSharps` parameter.\r\n *\r\n * @function\r\n * @param {number} midi - the midi note number\r\n * @param {Object} options = default: `{ sharps: false, pitchClass: false }`\r\n * @param {boolean} useSharps - (Optional) set to true to use sharps instead of flats\r\n * @return {string} the note name\r\n * @example\r\n * import { midiToNoteName } from '@tonaljs/midi'\r\n * midiToNoteName(61) // => \"Db4\"\r\n * midiToNoteName(61, { pitchClass: true }) // => \"Db\"\r\n * midiToNoteName(61, { sharps: true }) // => \"C#4\"\r\n * midiToNoteName(61, { pitchClass: true, sharps: true }) // => \"C#\"\r\n * // it rounds to nearest note\r\n * midiToNoteName(61.7) // => \"D4\"\r\n */\r\nfunction midiToNoteName(midi, options = {}) {\r\n midi = Math.round(midi);\r\n const pcs = options.sharps === true ? SHARPS : FLATS;\r\n const pc = pcs[midi % 12];\r\n if (options.pitchClass) {\r\n return pc;\r\n }\r\n const o = Math.floor(midi / 12) - 1;\r\n return pc + o;\r\n}\r\nvar index = { isMidi, toMidi, midiToFreq, midiToNoteName, freqToMidi };\n\nexport default index;\nexport { freqToMidi, isMidi, midiToFreq, midiToNoteName, toMidi };\n//# sourceMappingURL=index.es.js.map\n","import { note, transpose as transpose$1, coordToNote } from '@tonaljs/core';\nimport { midiToNoteName } from '@tonaljs/midi';\n\nconst NAMES = [\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"];\r\nconst toName = (n) => n.name;\r\nconst onlyNotes = (array) => array.map(note).filter((n) => !n.empty);\r\n/**\r\n * Return the natural note names without octave\r\n * @function\r\n * @example\r\n * Note.names(); // => [\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"]\r\n */\r\nfunction names(array) {\r\n if (array === undefined) {\r\n return NAMES.slice();\r\n }\r\n else if (!Array.isArray(array)) {\r\n return [];\r\n }\r\n else {\r\n return onlyNotes(array).map(toName);\r\n }\r\n}\r\n/**\r\n * Get a note from a note name\r\n *\r\n * @function\r\n * @example\r\n * Note.get('Bb4') // => { name: \"Bb4\", midi: 70, chroma: 10, ... }\r\n */\r\nconst get = note;\r\n/**\r\n * Get the note name\r\n * @function\r\n */\r\nconst name = (note) => get(note).name;\r\n/**\r\n * Get the note pitch class name\r\n * @function\r\n */\r\nconst pitchClass = (note) => get(note).pc;\r\n/**\r\n * Get the note accidentals\r\n * @function\r\n */\r\nconst accidentals = (note) => get(note).acc;\r\n/**\r\n * Get the note octave\r\n * @function\r\n */\r\nconst octave = (note) => get(note).oct;\r\n/**\r\n * Get the note midi\r\n * @function\r\n */\r\nconst midi = (note) => get(note).midi;\r\n/**\r\n * Get the note midi\r\n * @function\r\n */\r\nconst freq = (note) => get(note).freq;\r\n/**\r\n * Get the note chroma\r\n * @function\r\n */\r\nconst chroma = (note) => get(note).chroma;\r\n/**\r\n * Given a midi number, returns a note name. Uses flats for altered notes.\r\n *\r\n * @function\r\n * @param {number} midi - the midi note number\r\n * @return {string} the note name\r\n * @example\r\n * Note.fromMidi(61) // => \"Db4\"\r\n * Note.fromMidi(61.7) // => \"D4\"\r\n */\r\nfunction fromMidi(midi) {\r\n return midiToNoteName(midi);\r\n}\r\n/**\r\n * Given a midi number, returns a note name. Uses flats for altered notes.\r\n *\r\n * @function\r\n * @param {number} midi - the midi note number\r\n * @return {string} the note name\r\n * @example\r\n * Note.fromMidiSharps(61) // => \"C#4\"\r\n */\r\nfunction fromMidiSharps(midi) {\r\n return midiToNoteName(midi, { sharps: true });\r\n}\r\n/**\r\n * Transpose a note by an interval\r\n */\r\nconst transpose = transpose$1;\r\nconst tr = transpose$1;\r\n/**\r\n * Transpose by an interval.\r\n * @function\r\n * @param {string} interval\r\n * @return {function} a function that transposes by the given interval\r\n * @example\r\n * [\"C\", \"D\", \"E\"].map(Note.transposeBy(\"5P\"));\r\n * // => [\"G\", \"A\", \"B\"]\r\n */\r\nconst transposeBy = (interval) => (note) => transpose(note, interval);\r\nconst trBy = transposeBy;\r\n/**\r\n * Transpose from a note\r\n * @function\r\n * @param {string} note\r\n * @return {function} a function that transposes the the note by an interval\r\n * [\"1P\", \"3M\", \"5P\"].map(Note.transposeFrom(\"C\"));\r\n * // => [\"C\", \"E\", \"G\"]\r\n */\r\nconst transposeFrom = (note) => (interval) => transpose(note, interval);\r\nconst trFrom = transposeFrom;\r\n/**\r\n * Transpose a note by a number of perfect fifths.\r\n *\r\n * @function\r\n * @param {string} note - the note name\r\n * @param {number} fifhts - the number of fifths\r\n * @return {string} the transposed note name\r\n *\r\n * @example\r\n * import { transposeFifths } from \"@tonaljs/note\"\r\n * transposeFifths(\"G4\", 1) // => \"D\"\r\n * [0, 1, 2, 3, 4].map(fifths => transposeFifths(\"C\", fifths)) // => [\"C\", \"G\", \"D\", \"A\", \"E\"]\r\n */\r\nfunction transposeFifths(noteName, fifths) {\r\n const note = get(noteName);\r\n if (note.empty) {\r\n return \"\";\r\n }\r\n const [nFifths, nOcts] = note.coord;\r\n const transposed = nOcts === undefined\r\n ? coordToNote([nFifths + fifths])\r\n : coordToNote([nFifths + fifths, nOcts]);\r\n return transposed.name;\r\n}\r\nconst trFifths = transposeFifths;\r\nconst ascending = (a, b) => a.height - b.height;\r\nconst descending = (a, b) => b.height - a.height;\r\nfunction sortedNames(notes, comparator) {\r\n comparator = comparator || ascending;\r\n return onlyNotes(notes).sort(comparator).map(toName);\r\n}\r\nfunction sortedUniqNames(notes) {\r\n return sortedNames(notes, ascending).filter((n, i, a) => i === 0 || n !== a[i - 1]);\r\n}\r\n/**\r\n * Simplify a note\r\n *\r\n * @function\r\n * @param {string} note - the note to be simplified\r\n * - sameAccType: default true. Use same kind of accidentals that source\r\n * @return {string} the simplified note or '' if not valid note\r\n * @example\r\n * simplify(\"C##\") // => \"D\"\r\n * simplify(\"C###\") // => \"D#\"\r\n * simplify(\"C###\")\r\n * simplify(\"B#4\") // => \"C5\"\r\n */\r\nconst simplify = nameBuilder(true);\r\n/**\r\n * Get enharmonic of a note\r\n *\r\n * @function\r\n * @param {string} note\r\n * @return {string} the enharmonic note or '' if not valid note\r\n * @example\r\n * Note.enharmonic(\"Db\") // => \"C#\"\r\n * Note.enharmonic(\"C\") // => \"C\"\r\n */\r\nconst enharmonic = nameBuilder(false);\r\nfunction nameBuilder(sameAccidentals) {\r\n return (noteName) => {\r\n const note = get(noteName);\r\n if (note.empty) {\r\n return \"\";\r\n }\r\n const sharps = sameAccidentals ? note.alt > 0 : note.alt < 0;\r\n const pitchClass = note.midi === null;\r\n return midiToNoteName(note.midi || note.chroma, { sharps, pitchClass });\r\n };\r\n}\r\nvar index = {\r\n names,\r\n get,\r\n name,\r\n pitchClass,\r\n accidentals,\r\n octave,\r\n midi,\r\n ascending,\r\n descending,\r\n sortedNames,\r\n sortedUniqNames,\r\n fromMidi,\r\n fromMidiSharps,\r\n freq,\r\n chroma,\r\n transpose,\r\n tr,\r\n transposeBy,\r\n trBy,\r\n transposeFrom,\r\n trFrom,\r\n transposeFifths,\r\n trFifths,\r\n simplify,\r\n enharmonic,\r\n};\n\nexport default index;\nexport { accidentals, ascending, chroma, descending, enharmonic, freq, fromMidi, fromMidiSharps, get, midi, name, names, octave, pitchClass, simplify, sortedNames, sortedUniqNames, tr, trBy, trFifths, trFrom, transpose, transposeBy, transposeFifths, transposeFrom };\n//# sourceMappingURL=index.es.js.map\n","import { isPitch, altToAcc, isNamed, deprecate, accToAlt, interval } from '@tonaljs/core';\n\nconst NoRomanNumeral = { empty: true, name: \"\", chordType: \"\" };\r\nconst cache = {};\r\n/**\r\n * Get properties of a roman numeral string\r\n *\r\n * @function\r\n * @param {string} - the roman numeral string (can have type, like: Imaj7)\r\n * @return {Object} - the roman numeral properties\r\n * @param {string} name - the roman numeral (tonic)\r\n * @param {string} type - the chord type\r\n * @param {string} num - the number (1 = I, 2 = II...)\r\n * @param {boolean} major - major or not\r\n *\r\n * @example\r\n * romanNumeral(\"VIIb5\") // => { name: \"VII\", type: \"b5\", num: 7, major: true }\r\n */\r\nfunction get(src) {\r\n return typeof src === \"string\"\r\n ? cache[src] || (cache[src] = parse(src))\r\n : typeof src === \"number\"\r\n ? get(NAMES[src] || \"\")\r\n : isPitch(src)\r\n ? fromPitch(src)\r\n : isNamed(src)\r\n ? get(src.name)\r\n : NoRomanNumeral;\r\n}\r\nconst romanNumeral = deprecate(\"RomanNumeral.romanNumeral\", \"RomanNumeral.get\", get);\r\n/**\r\n * Get roman numeral names\r\n *\r\n * @function\r\n * @param {boolean} [isMajor=true]\r\n * @return {Array}\r\n *\r\n * @example\r\n * names() // => [\"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\"]\r\n */\r\nfunction names(major = true) {\r\n return (major ? NAMES : NAMES_MINOR).slice();\r\n}\r\nfunction fromPitch(pitch) {\r\n return get(altToAcc(pitch.alt) + NAMES[pitch.step]);\r\n}\r\nconst REGEX = /^(#{1,}|b{1,}|x{1,}|)(IV|I{1,3}|VI{0,2}|iv|i{1,3}|vi{0,2})([^IViv]*)$/;\r\nfunction tokenize(str) {\r\n return (REGEX.exec(str) || [\"\", \"\", \"\", \"\"]);\r\n}\r\nconst ROMANS = \"I II III IV V VI VII\";\r\nconst NAMES = ROMANS.split(\" \");\r\nconst NAMES_MINOR = ROMANS.toLowerCase().split(\" \");\r\nfunction parse(src) {\r\n const [name, acc, roman, chordType] = tokenize(src);\r\n if (!roman) {\r\n return NoRomanNumeral;\r\n }\r\n const upperRoman = roman.toUpperCase();\r\n const step = NAMES.indexOf(upperRoman);\r\n const alt = accToAlt(acc);\r\n const dir = 1;\r\n return {\r\n empty: false,\r\n name,\r\n roman,\r\n interval: interval({ step, alt, dir }).name,\r\n acc,\r\n chordType,\r\n alt,\r\n step,\r\n major: roman === upperRoman,\r\n oct: 0,\r\n dir,\r\n };\r\n}\r\nvar index = {\r\n names,\r\n get,\r\n // deprecated\r\n romanNumeral,\r\n};\n\nexport default index;\nexport { get, names, tokenize };\n//# sourceMappingURL=index.es.js.map\n","import { transpose, altToAcc, accToAlt, note } from '@tonaljs/core';\nimport { transposeFifths } from '@tonaljs/note';\nimport { get } from '@tonaljs/roman-numeral';\n\nconst mapToScale = (scale) => (symbols, sep = \"\") => symbols.map((symbol, index) => symbol !== \"-\" ? scale[index] + sep + symbol : \"\");\r\nfunction keyScale(gradesLiteral, chordsLiteral, hfLiteral, chordScalesLiteral) {\r\n return (tonic) => {\r\n const grades = gradesLiteral.split(\" \");\r\n const intervals = grades.map((gr) => get(gr).interval || \"\");\r\n const scale = intervals.map((interval) => transpose(tonic, interval));\r\n const map = mapToScale(scale);\r\n return {\r\n tonic,\r\n grades,\r\n intervals,\r\n scale,\r\n chords: map(chordsLiteral.split(\" \")),\r\n chordsHarmonicFunction: hfLiteral.split(\" \"),\r\n chordScales: map(chordScalesLiteral.split(\",\"), \" \"),\r\n };\r\n };\r\n}\r\nconst distInFifths = (from, to) => {\r\n const f = note(from);\r\n const t = note(to);\r\n return f.empty || t.empty ? 0 : t.coord[0] - f.coord[0];\r\n};\r\nconst MajorScale = keyScale(\"I II III IV V VI VII\", \"maj7 m7 m7 maj7 7 m7 m7b5\", \"T SD T SD D T D\", \"major,dorian,phrygian,lydian,mixolydian,minor,locrian\");\r\nconst NaturalScale = keyScale(\"I II bIII IV V bVI bVII\", \"m7 m7b5 maj7 m7 m7 maj7 7\", \"T SD T SD D SD SD\", \"minor,locrian,major,dorian,phrygian,lydian,mixolydian\");\r\nconst HarmonicScale = keyScale(\"I II bIII IV V bVI VII\", \"mmaj7 m7b5 +maj7 m7 7 maj7 mo7\", \"T SD T SD D SD D\", \"harmonic minor,locrian 6,major augmented,lydian diminished,phrygian dominant,lydian #9,ultralocrian\");\r\nconst MelodicScale = keyScale(\"I II bIII IV V VI VII\", \"m6 m7 +maj7 7 7 m7b5 m7b5\", \"T SD T SD D - -\", \"melodic minor,dorian b2,lydian augmented,lydian dominant,mixolydian b6,locrian #2,altered\");\r\n/**\r\n * Get a major key properties in a given tonic\r\n * @param tonic\r\n */\r\nfunction majorKey(tonic) {\r\n const keyScale = MajorScale(tonic);\r\n const alteration = distInFifths(\"C\", tonic);\r\n const map = mapToScale(keyScale.scale);\r\n return {\r\n ...keyScale,\r\n type: \"major\",\r\n minorRelative: transpose(tonic, \"-3m\"),\r\n alteration,\r\n keySignature: altToAcc(alteration),\r\n secondaryDominants: map(\"- VI7 VII7 I7 II7 III7 -\".split(\" \")),\r\n secondaryDominantsMinorRelative: map(\"- IIIm7b5 IV#m7 Vm7 VIm7 VIIm7b5 -\".split(\" \")),\r\n substituteDominants: map(\"- bIII7 IV7 bV7 bVI7 bVII7 -\".split(\" \")),\r\n substituteDominantsMinorRelative: map(\"- IIIm7 Im7 IIbm7 VIm7 IVm7 -\".split(\" \")),\r\n };\r\n}\r\n/**\r\n * Get minor key properties in a given tonic\r\n * @param tonic\r\n */\r\nfunction minorKey(tonic) {\r\n const alteration = distInFifths(\"C\", tonic) - 3;\r\n return {\r\n type: \"minor\",\r\n tonic,\r\n relativeMajor: transpose(tonic, \"3m\"),\r\n alteration,\r\n keySignature: altToAcc(alteration),\r\n natural: NaturalScale(tonic),\r\n harmonic: HarmonicScale(tonic),\r\n melodic: MelodicScale(tonic),\r\n };\r\n}\r\n/**\r\n * Given a key signature, returns the tonic of the major key\r\n * @param sigature\r\n * @example\r\n * majorTonicFromKeySignature('###') // => 'A'\r\n */\r\nfunction majorTonicFromKeySignature(sig) {\r\n if (typeof sig === \"number\") {\r\n return transposeFifths(\"C\", sig);\r\n }\r\n else if (typeof sig === \"string\" && /^b+|#+$/.test(sig)) {\r\n return transposeFifths(\"C\", accToAlt(sig));\r\n }\r\n return null;\r\n}\r\nvar index = { majorKey, majorTonicFromKeySignature, minorKey };\n\nexport default index;\nexport { majorKey, majorTonicFromKeySignature, minorKey };\n//# sourceMappingURL=index.es.js.map\n","import { deprecate } from '@tonaljs/core';\nimport { chromaToIntervals, EmptyPcset } from '@tonaljs/pcset';\n\nconst DATA = [\r\n [0, 2773, 0, \"ionian\", \"\", \"Maj7\", \"major\"],\r\n [1, 2902, 2, \"dorian\", \"m\", \"m7\"],\r\n [2, 3418, 4, \"phrygian\", \"m\", \"m7\"],\r\n [3, 2741, -1, \"lydian\", \"\", \"Maj7\"],\r\n [4, 2774, 1, \"mixolydian\", \"\", \"7\"],\r\n [5, 2906, 3, \"aeolian\", \"m\", \"m7\", \"minor\"],\r\n [6, 3434, 5, \"locrian\", \"dim\", \"m7b5\"],\r\n];\n\nconst NoMode = {\r\n ...EmptyPcset,\r\n name: \"\",\r\n alt: 0,\r\n modeNum: NaN,\r\n triad: \"\",\r\n seventh: \"\",\r\n aliases: [],\r\n};\r\nconst modes = DATA.map(toMode);\r\nconst index = {};\r\nmodes.forEach((mode) => {\r\n index[mode.name] = mode;\r\n mode.aliases.forEach((alias) => {\r\n index[alias] = mode;\r\n });\r\n});\r\n/**\r\n * Get a Mode by it's name\r\n *\r\n * @example\r\n * get('dorian')\r\n * // =>\r\n * // {\r\n * // intervals: [ '1P', '2M', '3m', '4P', '5P', '6M', '7m' ],\r\n * // modeNum: 1,\r\n * // chroma: '101101010110',\r\n * // normalized: '101101010110',\r\n * // name: 'dorian',\r\n * // setNum: 2902,\r\n * // alt: 2,\r\n * // triad: 'm',\r\n * // seventh: 'm7',\r\n * // aliases: []\r\n * // }\r\n */\r\nfunction get(name) {\r\n return typeof name === \"string\"\r\n ? index[name.toLowerCase()] || NoMode\r\n : name && name.name\r\n ? get(name.name)\r\n : NoMode;\r\n}\r\nconst mode = deprecate(\"Mode.mode\", \"Mode.get\", get);\r\n/**\r\n * Get a list of all modes\r\n */\r\nfunction all() {\r\n return modes.slice();\r\n}\r\nconst entries = deprecate(\"Mode.mode\", \"Mode.all\", all);\r\n/**\r\n * Get a list of all mode names\r\n */\r\nfunction names() {\r\n return modes.map((mode) => mode.name);\r\n}\r\nfunction toMode(mode) {\r\n const [modeNum, setNum, alt, name, triad, seventh, alias] = mode;\r\n const aliases = alias ? [alias] : [];\r\n const chroma = Number(setNum).toString(2);\r\n const intervals = chromaToIntervals(chroma);\r\n return {\r\n empty: false,\r\n intervals,\r\n modeNum,\r\n chroma,\r\n normalized: chroma,\r\n name,\r\n setNum,\r\n alt,\r\n triad,\r\n seventh,\r\n aliases,\r\n };\r\n}\r\nvar index$1 = {\r\n get,\r\n names,\r\n all,\r\n // deprecated\r\n entries,\r\n mode,\r\n};\n\nexport default index$1;\nexport { all, entries, get, mode, names };\n//# sourceMappingURL=index.es.js.map\n","import { tokenize } from '@tonaljs/chord';\nimport { transpose, interval, distance } from '@tonaljs/core';\nimport { get } from '@tonaljs/roman-numeral';\n\n/**\r\n * Given a tonic and a chord list expressed with roman numeral notation\r\n * returns the progression expressed with leadsheet chords symbols notation\r\n * @example\r\n * fromRomanNumerals(\"C\", [\"I\", \"IIm7\", \"V7\"]);\r\n * // => [\"C\", \"Dm7\", \"G7\"]\r\n */\r\nfunction fromRomanNumerals(tonic, chords) {\r\n const romanNumerals = chords.map(get);\r\n return romanNumerals.map((rn) => transpose(tonic, interval(rn)) + rn.chordType);\r\n}\r\n/**\r\n * Given a tonic and a chord list with leadsheet symbols notation,\r\n * return the chord list with roman numeral notation\r\n * @example\r\n * toRomanNumerals(\"C\", [\"CMaj7\", \"Dm7\", \"G7\"]);\r\n * // => [\"IMaj7\", \"IIm7\", \"V7\"]\r\n */\r\nfunction toRomanNumerals(tonic, chords) {\r\n return chords.map((chord) => {\r\n const [note, chordType] = tokenize(chord);\r\n const intervalName = distance(tonic, note);\r\n const roman = get(interval(intervalName));\r\n return roman.name + chordType;\r\n });\r\n}\r\nvar index = { fromRomanNumerals, toRomanNumerals };\n\nexport default index;\nexport { fromRomanNumerals, toRomanNumerals };\n//# sourceMappingURL=index.es.js.map\n","import { compact, range } from '@tonaljs/collection';\nimport { toMidi, midiToNoteName } from '@tonaljs/midi';\n\n/**\r\n * Create a numeric range. You supply a list of notes or numbers and it will\r\n * be connected to create complex ranges.\r\n *\r\n * @param {Array} array - the list of notes or numbers used\r\n * @return {Array} an array of numbers or empty array if not valid parameters\r\n *\r\n * @example\r\n * numeric([\"C5\", \"C4\"]) // => [ 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60 ]\r\n * // it works midi notes\r\n * numeric([10, 5]) // => [ 10, 9, 8, 7, 6, 5 ]\r\n * // complex range\r\n * numeric([\"C4\", \"E4\", \"Bb3\"]) // => [60, 61, 62, 63, 64, 63, 62, 61, 60, 59, 58]\r\n */\r\nfunction numeric(notes) {\r\n const midi = compact(notes.map(toMidi));\r\n if (!notes.length || midi.length !== notes.length) {\r\n // there is no valid notes\r\n return [];\r\n }\r\n return midi.reduce((result, note) => {\r\n const last = result[result.length - 1];\r\n return result.concat(range(last, note).slice(1));\r\n }, [midi[0]]);\r\n}\r\n/**\r\n * Create a range of chromatic notes. The altered notes will use flats.\r\n *\r\n * @function\r\n * @param {String|Array} list - the list of notes or midi note numbers\r\n * @return {Array} an array of note names\r\n *\r\n * @example\r\n * Range.chromatic(\"C2 E2 D2\") // => [\"C2\", \"Db2\", \"D2\", \"Eb2\", \"E2\", \"Eb2\", \"D2\"]\r\n * // with sharps\r\n * Range.chromatic(\"C2 C3\", true) // => [ \"C2\", \"C#2\", \"D2\", \"D#2\", \"E2\", \"F2\", \"F#2\", \"G2\", \"G#2\", \"A2\", \"A#2\", \"B2\", \"C3\" ]\r\n */\r\nfunction chromatic(notes, options) {\r\n return numeric(notes).map((midi) => midiToNoteName(midi, options));\r\n}\r\nvar index = { numeric, chromatic };\n\nexport default index;\nexport { chromatic, numeric };\n//# sourceMappingURL=index.es.js.map\n","import { all } from '@tonaljs/chord-type';\nimport { rotate } from '@tonaljs/collection';\nimport { note, transpose, deprecate } from '@tonaljs/core';\nimport { sortedUniqNames } from '@tonaljs/note';\nimport { isSubsetOf, isSupersetOf, modes } from '@tonaljs/pcset';\nimport { names as names$1, get as get$1, all as all$1 } from '@tonaljs/scale-type';\n\n/**\r\n * References:\r\n * - https://www.researchgate.net/publication/327567188_An_Algorithm_for_Spelling_the_Pitches_of_Any_Musical_Scale\r\n * @module scale\r\n */\r\nconst NoScale = {\r\n empty: true,\r\n name: \"\",\r\n type: \"\",\r\n tonic: null,\r\n setNum: NaN,\r\n chroma: \"\",\r\n normalized: \"\",\r\n aliases: [],\r\n notes: [],\r\n intervals: [],\r\n};\r\n/**\r\n * Given a string with a scale name and (optionally) a tonic, split\r\n * that components.\r\n *\r\n * It retuns an array with the form [ name, tonic ] where tonic can be a\r\n * note name or null and name can be any arbitrary string\r\n * (this function doesn\"t check if that scale name exists)\r\n *\r\n * @function\r\n * @param {string} name - the scale name\r\n * @return {Array} an array [tonic, name]\r\n * @example\r\n * tokenize(\"C mixolydean\") // => [\"C\", \"mixolydean\"]\r\n * tokenize(\"anything is valid\") // => [\"\", \"anything is valid\"]\r\n * tokenize() // => [\"\", \"\"]\r\n */\r\nfunction tokenize(name) {\r\n if (typeof name !== \"string\") {\r\n return [\"\", \"\"];\r\n }\r\n const i = name.indexOf(\" \");\r\n const tonic = note(name.substring(0, i));\r\n if (tonic.empty) {\r\n const n = note(name);\r\n return n.empty ? [\"\", name] : [n.name, \"\"];\r\n }\r\n const type = name.substring(tonic.name.length + 1);\r\n return [tonic.name, type.length ? type : \"\"];\r\n}\r\n/**\r\n * Get all scale names\r\n * @function\r\n */\r\nconst names = names$1;\r\n/**\r\n * Get a Scale from a scale name.\r\n */\r\nfunction get(src) {\r\n const tokens = Array.isArray(src) ? src : tokenize(src);\r\n const tonic = note(tokens[0]).name;\r\n const st = get$1(tokens[1]);\r\n if (st.empty) {\r\n return NoScale;\r\n }\r\n const type = st.name;\r\n const notes = tonic\r\n ? st.intervals.map((i) => transpose(tonic, i))\r\n : [];\r\n const name = tonic ? tonic + \" \" + type : type;\r\n return { ...st, name, type, tonic, notes };\r\n}\r\nconst scale = deprecate(\"Scale.scale\", \"Scale.get\", get);\r\n/**\r\n * Get all chords that fits a given scale\r\n *\r\n * @function\r\n * @param {string} name - the scale name\r\n * @return {Array} - the chord names\r\n *\r\n * @example\r\n * scaleChords(\"pentatonic\") // => [\"5\", \"64\", \"M\", \"M6\", \"Madd9\", \"Msus2\"]\r\n */\r\nfunction scaleChords(name) {\r\n const s = get(name);\r\n const inScale = isSubsetOf(s.chroma);\r\n return all()\r\n .filter((chord) => inScale(chord.chroma))\r\n .map((chord) => chord.aliases[0]);\r\n}\r\n/**\r\n * Get all scales names that are a superset of the given one\r\n * (has the same notes and at least one more)\r\n *\r\n * @function\r\n * @param {string} name\r\n * @return {Array} a list of scale names\r\n * @example\r\n * extended(\"major\") // => [\"bebop\", \"bebop dominant\", \"bebop major\", \"chromatic\", \"ichikosucho\"]\r\n */\r\nfunction extended(name) {\r\n const s = get(name);\r\n const isSuperset = isSupersetOf(s.chroma);\r\n return all$1()\r\n .filter((scale) => isSuperset(scale.chroma))\r\n .map((scale) => scale.name);\r\n}\r\n/**\r\n * Find all scales names that are a subset of the given one\r\n * (has less notes but all from the given scale)\r\n *\r\n * @function\r\n * @param {string} name\r\n * @return {Array} a list of scale names\r\n *\r\n * @example\r\n * reduced(\"major\") // => [\"ionian pentatonic\", \"major pentatonic\", \"ritusen\"]\r\n */\r\nfunction reduced(name) {\r\n const isSubset = isSubsetOf(get(name).chroma);\r\n return all$1()\r\n .filter((scale) => isSubset(scale.chroma))\r\n .map((scale) => scale.name);\r\n}\r\n/**\r\n * Given an array of notes, return the scale: a pitch class set starting from\r\n * the first note of the array\r\n *\r\n * @function\r\n * @param {string[]} notes\r\n * @return {string[]} pitch classes with same tonic\r\n * @example\r\n * scaleNotes(['C4', 'c3', 'C5', 'C4', 'c4']) // => [\"C\"]\r\n * scaleNotes(['D4', 'c#5', 'A5', 'F#6']) // => [\"D\", \"F#\", \"A\", \"C#\"]\r\n */\r\nfunction scaleNotes(notes) {\r\n const pcset = notes.map((n) => note(n).pc).filter((x) => x);\r\n const tonic = pcset[0];\r\n const scale = sortedUniqNames(pcset);\r\n return rotate(scale.indexOf(tonic), scale);\r\n}\r\n/**\r\n * Find mode names of a scale\r\n *\r\n * @function\r\n * @param {string} name - scale name\r\n * @example\r\n * modeNames(\"C pentatonic\") // => [\r\n * [\"C\", \"major pentatonic\"],\r\n * [\"D\", \"egyptian\"],\r\n * [\"E\", \"malkos raga\"],\r\n * [\"G\", \"ritusen\"],\r\n * [\"A\", \"minor pentatonic\"]\r\n * ]\r\n */\r\nfunction modeNames(name) {\r\n const s = get(name);\r\n if (s.empty) {\r\n return [];\r\n }\r\n const tonics = s.tonic ? s.notes : s.intervals;\r\n return modes(s.chroma)\r\n .map((chroma, i) => {\r\n const modeName = get(chroma).name;\r\n return modeName ? [tonics[i], modeName] : [\"\", \"\"];\r\n })\r\n .filter((x) => x[0]);\r\n}\r\nvar index = {\r\n get,\r\n names,\r\n extended,\r\n modeNames,\r\n reduced,\r\n scaleChords,\r\n scaleNotes,\r\n tokenize,\r\n // deprecated\r\n scale,\r\n};\n\nexport default index;\nexport { extended, get, modeNames, names, reduced, scale, scaleChords, scaleNotes, tokenize };\n//# sourceMappingURL=index.es.js.map\n","// CONSTANTS\r\nconst NONE = {\r\n empty: true,\r\n name: \"\",\r\n upper: undefined,\r\n lower: undefined,\r\n type: undefined,\r\n additive: [],\r\n};\r\nconst NAMES = [\"4/4\", \"3/4\", \"2/4\", \"2/2\", \"12/8\", \"9/8\", \"6/8\", \"3/8\"];\r\n// PUBLIC API\r\nfunction names() {\r\n return NAMES.slice();\r\n}\r\nconst REGEX = /^(\\d?\\d(?:\\+\\d)*)\\/(\\d)$/;\r\nconst CACHE = new Map();\r\nfunction get(literal) {\r\n const cached = CACHE.get(literal);\r\n if (cached) {\r\n return cached;\r\n }\r\n const ts = build(parse(literal));\r\n CACHE.set(literal, ts);\r\n return ts;\r\n}\r\nfunction parse(literal) {\r\n if (typeof literal === \"string\") {\r\n const [_, up, low] = REGEX.exec(literal) || [];\r\n return parse([up, low]);\r\n }\r\n const [up, down] = literal;\r\n const denominator = +down;\r\n if (typeof up === \"number\") {\r\n return [up, denominator];\r\n }\r\n const list = up.split(\"+\").map((n) => +n);\r\n return list.length === 1 ? [list[0], denominator] : [list, denominator];\r\n}\r\nvar index = { names, parse, get };\r\n// PRIVATE\r\nfunction build([up, down]) {\r\n const upper = Array.isArray(up) ? up.reduce((a, b) => a + b, 0) : up;\r\n const lower = down;\r\n if (upper === 0 || lower === 0) {\r\n return NONE;\r\n }\r\n const name = Array.isArray(up) ? `${up.join(\"+\")}/${down}` : `${up}/${down}`;\r\n const additive = Array.isArray(up) ? up : [];\r\n const type = lower === 4 || lower === 2\r\n ? \"simple\"\r\n : lower === 8 && upper % 3 === 0\r\n ? \"compound\"\r\n : \"irregular\";\r\n return {\r\n empty: false,\r\n name,\r\n type,\r\n upper,\r\n lower,\r\n additive,\r\n };\r\n}\n\nexport default index;\nexport { get, names, parse };\n//# sourceMappingURL=index.es.js.map\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tonaljs/abc-notation'), require('@tonaljs/array'), require('@tonaljs/chord'), require('@tonaljs/chord-type'), require('@tonaljs/collection'), require('@tonaljs/core'), require('@tonaljs/duration-value'), require('@tonaljs/interval'), require('@tonaljs/key'), require('@tonaljs/midi'), require('@tonaljs/mode'), require('@tonaljs/note'), require('@tonaljs/pcset'), require('@tonaljs/progression'), require('@tonaljs/range'), require('@tonaljs/roman-numeral'), require('@tonaljs/scale'), require('@tonaljs/scale-type'), require('@tonaljs/time-signature')) :\n typeof define === 'function' && define.amd ? define(['exports', '@tonaljs/abc-notation', '@tonaljs/array', '@tonaljs/chord', '@tonaljs/chord-type', '@tonaljs/collection', '@tonaljs/core', '@tonaljs/duration-value', '@tonaljs/interval', '@tonaljs/key', '@tonaljs/midi', '@tonaljs/mode', '@tonaljs/note', '@tonaljs/pcset', '@tonaljs/progression', '@tonaljs/range', '@tonaljs/roman-numeral', '@tonaljs/scale', '@tonaljs/scale-type', '@tonaljs/time-signature'], factory) :\n (global = global || self, factory(global.Tonal = {}, global.abcNotation, global.array, global.chord, global.ChordType, global.collection, global.Core, global.durationValue, global.interval, global.key, global.midi, global.mode, global.note, global.Pcset, global.progression, global.range, global.romanNumeral, global.scale, global.ScaleType, global.timeSignature));\n}(this, (function (exports, abcNotation, array, chord, ChordType, collection, Core, durationValue, interval, key, midi, mode, note, Pcset, progression, range, romanNumeral, scale, ScaleType, timeSignature) { 'use strict';\n\n abcNotation = abcNotation && Object.prototype.hasOwnProperty.call(abcNotation, 'default') ? abcNotation['default'] : abcNotation;\n chord = chord && Object.prototype.hasOwnProperty.call(chord, 'default') ? chord['default'] : chord;\n ChordType = ChordType && Object.prototype.hasOwnProperty.call(ChordType, 'default') ? ChordType['default'] : ChordType;\n collection = collection && Object.prototype.hasOwnProperty.call(collection, 'default') ? collection['default'] : collection;\n durationValue = durationValue && Object.prototype.hasOwnProperty.call(durationValue, 'default') ? durationValue['default'] : durationValue;\n interval = interval && Object.prototype.hasOwnProperty.call(interval, 'default') ? interval['default'] : interval;\n key = key && Object.prototype.hasOwnProperty.call(key, 'default') ? key['default'] : key;\n midi = midi && Object.prototype.hasOwnProperty.call(midi, 'default') ? midi['default'] : midi;\n mode = mode && Object.prototype.hasOwnProperty.call(mode, 'default') ? mode['default'] : mode;\n note = note && Object.prototype.hasOwnProperty.call(note, 'default') ? note['default'] : note;\n Pcset = Pcset && Object.prototype.hasOwnProperty.call(Pcset, 'default') ? Pcset['default'] : Pcset;\n progression = progression && Object.prototype.hasOwnProperty.call(progression, 'default') ? progression['default'] : progression;\n range = range && Object.prototype.hasOwnProperty.call(range, 'default') ? range['default'] : range;\n romanNumeral = romanNumeral && Object.prototype.hasOwnProperty.call(romanNumeral, 'default') ? romanNumeral['default'] : romanNumeral;\n scale = scale && Object.prototype.hasOwnProperty.call(scale, 'default') ? scale['default'] : scale;\n ScaleType = ScaleType && Object.prototype.hasOwnProperty.call(ScaleType, 'default') ? ScaleType['default'] : ScaleType;\n timeSignature = timeSignature && Object.prototype.hasOwnProperty.call(timeSignature, 'default') ? timeSignature['default'] : timeSignature;\n\n // deprecated (backwards compatibility)\r\n var Tonal = Core;\r\n var PcSet = Pcset;\r\n var ChordDictionary = ChordType;\r\n var ScaleDictionary = ScaleType;\n\n Object.keys(Core).forEach(function (k) {\n if (k !== 'default') Object.defineProperty(exports, k, {\n enumerable: true,\n get: function () {\n return Core[k];\n }\n });\n });\n exports.AbcNotation = abcNotation;\n exports.Array = array;\n exports.Chord = chord;\n exports.ChordType = ChordType;\n exports.Collection = collection;\n exports.Core = Core;\n exports.DurationValue = durationValue;\n exports.Interval = interval;\n exports.Key = key;\n exports.Midi = midi;\n exports.Mode = mode;\n exports.Note = note;\n exports.Pcset = Pcset;\n exports.Progression = progression;\n exports.Range = range;\n exports.RomanNumeral = romanNumeral;\n exports.Scale = scale;\n exports.ScaleType = ScaleType;\n exports.TimeSignature = timeSignature;\n exports.ChordDictionary = ChordDictionary;\n exports.PcSet = PcSet;\n exports.ScaleDictionary = ScaleDictionary;\n exports.Tonal = Tonal;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=index.js.map\n"],"names":["fillStr","s","n","Array","Math","abs","join","deprecate","original","alternative","fn","args","console","warn","apply","this","isNamed","src","name","isPitch","pitch","step","alt","FIFTHS","STEPS_TO_OCTS","map","fifths","floor","encode","oct","dir","f","undefined","FIFTHS_TO_STEPS","decode","coord","o","i","unaltered","NoNote","empty","pc","acc","cache","Map","stepToLetter","charAt","altToAcc","accToAlt","length","note","cached","get","value","noteName","tokens","tokenizeNote","letter","octStr","charCodeAt","chroma","SEMI","height","midi","freq","pow","parse","props","pitchName","set","REGEX","str","m","exec","toUpperCase","replace","coordToNote","noteCoord","NoInterval","REGEX$1","RegExp","tokenizeInterval","cache$1","interval","num","q","t","type","simple","test","qToAlt","semitones","SIZES","parse$1","altToQ","pitchName$1","coordToInterval","transpose","intervalName","note$1","interval$1","intervalCoord","distance","fromNote","toNote","from","to","fcoord","tcoord","character","times","tokenize","abcToScientificNotation","a","scientificToAbcNotation","toLowerCase","index","transpose$1","distance$1","sortedNoteNames","notes","filter","sort","b","arr","permutations","slice","reduce","perm","concat","e","pos","newPerm","splice","ascR","descR","len","rnd","random","range","rotate","compact","EmptyPcset","setNum","normalized","intervals","setNumToChroma","Number","toString","chromaToNumber","parseInt","isChroma","[object Object]","isArray","binary","listToChroma","isPcset","normalizedNum","split","_","chromaRotations","chromaToIntervals","chromaToPcset","pcset","IVLS","push","modes","normalize","r","isSubsetOf","isSupersetOf","isNoteIncludedIn","chromas","isEqual","s1","s2","isIncluded","NoChordType","quality","aliases","dictionary","chordType","all","entries","add","fullName","has","indexOf","getQuality","chord","get$1","forEach","alias","addAlias","ivls","names","index$1","x","symbols","removeAll","keys","Object","NotFound","weight","NoScaleType","scale","scaleType","NoChord","symbol","root","rootDegree","tonic","NaN","NUM_TYPES","getChord","typeName","optionalTonic","optionalRoot","rootInterval","detect","source","tonicChroma","pcToName","record","namedSet","mode","chordName","baseNote","findExactMatches","chordScales","isChordIncluded","extended","isSuperset","all$1","reduced","isSubset","VALUES","denominator","shorthand","dots","fraction","NoDuration","base","find","dur","includes","numerator","calcDots","duration","shorthands","IN","IQ","combinator","substract","fromSemitones","d","c","invert","simplify","addTo","other","coordA","coordB","isMidi","arg","toMidi","L2","log","L440","SHARPS","FLATS","midiToNoteName","options","round","sharps","pitchClass","midiToFreq","tuning","freqToMidi","v","NAMES","toName","onlyNotes","array","tr","transposeBy","trBy","transposeFrom","trFrom","transposeFifths","nFifths","nOcts","trFifths","ascending","sortedNames","comparator","sortedUniqNames","nameBuilder","enharmonic","sameAccidentals","accidentals","octave","descending","fromMidi","fromMidiSharps","NoRomanNumeral","roman","upperRoman","major","romanNumeral","ROMANS","NAMES_MINOR","mapToScale","sep","keyScale","gradesLiteral","chordsLiteral","hfLiteral","chordScalesLiteral","grades","gr","chords","chordsHarmonicFunction","distInFifths","MajorScale","NaturalScale","HarmonicScale","MelodicScale","majorKey","alteration","minorRelative","keySignature","secondaryDominants","secondaryDominantsMinorRelative","substituteDominants","substituteDominantsMinorRelative","majorTonicFromKeySignature","sig","minorKey","relativeMajor","natural","harmonic","melodic","NoMode","modeNum","triad","seventh","fromRomanNumerals","rn","toRomanNumerals","numeric","result","last","chromatic","NoScale","substring","st","names$1","modeNames","tonics","modeName","scaleChords","inScale","scaleNotes","NONE","upper","lower","additive","CACHE","literal","up","low","down","list","ts","build","exports","abcNotation","ChordType","collection","Core","durationValue","key","Pcset","progression","ScaleType","timeSignature","prototype","hasOwnProperty","call","Tonal","PcSet","ChordDictionary","ScaleDictionary","k","defineProperty","enumerable","AbcNotation","Chord","Collection","DurationValue","Interval","Key","Midi","Mode","Note","Progression","Range","RomanNumeral","Scale","TimeSignature","factory","require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18"],"mappings":"+KAMA,MAAMA,EAAU,CAACC,EAAGC,IAAMC,MAAMC,KAAKC,IAAIH,GAAK,GAAGI,KAAKL,GACtD,SAASM,EAAUC,EAAUC,EAAaC,GACtC,OAAO,YAAaC,GAGhB,OADAC,QAAQC,KAAK,GAAGL,wBAA+BC,MACxCC,EAAGI,MAAMC,KAAMJ,IAI9B,SAASK,EAAQC,GACb,OAAe,OAARA,GAA+B,iBAARA,GAAwC,iBAAbA,EAAIC,KAKjE,SAASC,EAAQC,GACb,OAAiB,OAAVA,GACc,iBAAVA,GACe,iBAAfA,EAAMC,MACQ,iBAAdD,EAAME,IAKrB,MAAMC,EAAS,CAAC,EAAG,EAAG,GAAI,EAAG,EAAG,EAAG,GAE7BC,EAAgBD,EAAOE,IAAKC,GAAWtB,KAAKuB,MAAgB,EAATD,EAAc,KACvE,SAASE,EAAOR,GACZ,MAAMC,KAAEA,EAAIC,IAAEA,EAAGO,IAAEA,EAAGC,IAAEA,EAAM,GAAMV,EAC9BW,EAAIR,EAAOF,GAAQ,EAAIC,EAC7B,YAAYU,IAARH,EACO,CAACC,EAAMC,GAGX,CAACD,EAAMC,EAAGD,GADPD,EAAML,EAAcH,G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,EACpBF,EAAQuB,WAAapB,EACrBH,EAAQI,KAAOA,EACfJ,EAAQwB,cAAgBnB,EACxBL,EAAQyB,SAAW9T,EACnBqS,EAAQ0B,IAAMpB,EACdN,EAAQ2B,KAAOpV,EACfyT,EAAQ4B,KAAOnL,EACfuJ,EAAQ6B,KAAOnW,EACfsU,EAAQO,MAAQA,EAChBP,EAAQ8B,YAActB,EACtBR,EAAQ+B,MAAQ5Q,EAChB6O,EAAQgC,aAAenG,EACvBmE,EAAQiC,MAAQ5M,EAChB2K,EAAQS,UAAYA,EACpBT,EAAQkC,cAAgBxB,EACxBV,EAAQgB,gBAAkBA,EAC1BhB,EAAQe,MAAQA,EAChBf,EAAQiB,gBAAkBA,EAC1BjB,EAAQc,MAAQA,EAEhB7L,OAAOkM,eAAenB,EAAS,aAAc,CAAEnU,OAAO,IA7DSsW,CAAQnC,EAASoC,EAAkCC,EAA2BC,GAA2BC,GAAgCC,EAAgCC,EAA0BC,GAAoCC,GAA8BC,GAAyBC,GAA0BC,GAA0BC,GAA0BC,GAA2BC,GAAiCC,GAA2BC,GAAmCC,GAA2BC,GAAgCC"} \ No newline at end of file diff --git a/mercury_ide/code/node_modules/@tonaljs/tonal/package.json b/mercury_ide/code/node_modules/@tonaljs/tonal/package.json index 121ec2f5..3d017f60 100644 --- a/mercury_ide/code/node_modules/@tonaljs/tonal/package.json +++ b/mercury_ide/code/node_modules/@tonaljs/tonal/package.json @@ -1,28 +1,28 @@ { - "_from": "@tonaljs/tonal@^3.6.0", - "_id": "@tonaljs/tonal@3.7.4", + "_from": "@tonaljs/tonal@^3.7.5", + "_id": "@tonaljs/tonal@3.7.5", "_inBundle": false, - "_integrity": "sha512-r4J8vYUFI3sPjDJg32jUOFYuSqvzjstVJdOiB70Vf2fNTuQzGb0dYtvOg3Q8h6CkIzO5ak7EYSgeKrZNuOnx5g==", + "_integrity": "sha512-k5TAIj4F+q6I9yTAFY46YkBpUMtuEZLsCAiD0HJl7f5yV7qzZj5/rz/SwQMrgKcBoNNXw+kVw+SVTr9sgb/RBw==", "_location": "/@tonaljs/tonal", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "@tonaljs/tonal@^3.6.0", + "raw": "@tonaljs/tonal@^3.7.5", "name": "@tonaljs/tonal", "escapedName": "@tonaljs%2ftonal", "scope": "@tonaljs", - "rawSpec": "^3.6.0", + "rawSpec": "^3.7.5", "saveSpec": null, - "fetchSpec": "^3.6.0" + "fetchSpec": "^3.7.5" }, "_requiredBy": [ "/total-serialism" ], - "_resolved": "https://registry.npmjs.org/@tonaljs/tonal/-/tonal-3.7.4.tgz", - "_shasum": "ec6fef80cdbb3889e3b2b27b4468c4380dac6cb5", - "_spec": "@tonaljs/tonal@^3.6.0", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/total-serialism", + "_resolved": "https://registry.npmjs.org/@tonaljs/tonal/-/tonal-3.7.5.tgz", + "_shasum": "f465839e48152d9cfd5afc8fb239f4ffe5037af1", + "_spec": "@tonaljs/tonal@^3.7.5", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/total-serialism", "author": { "name": "danigb@gmail.com" }, @@ -30,7 +30,7 @@ "dependencies": { "@tonaljs/abc-notation": "^3.5.4", "@tonaljs/array": "^3.2.8", - "@tonaljs/chord": "^3.6.3", + "@tonaljs/chord": "^3.6.4", "@tonaljs/chord-type": "^3.5.4", "@tonaljs/collection": "^3.5.3", "@tonaljs/core": "^3.5.3", @@ -41,7 +41,7 @@ "@tonaljs/mode": "^3.5.3", "@tonaljs/note": "^3.5.3", "@tonaljs/pcset": "^3.5.3", - "@tonaljs/progression": "^3.5.5", + "@tonaljs/progression": "^3.5.6", "@tonaljs/range": "^3.5.3", "@tonaljs/roman-numeral": "^3.5.3", "@tonaljs/scale": "^3.5.5", @@ -54,7 +54,7 @@ "dist", "browser" ], - "gitHead": "31df6c0ed6b5b820fb845e62b69b2d1b95cc1594", + "gitHead": "7b4dc70b46138088c31a314881c7bcb8c562cf0b", "keywords": [ "music", "theory", @@ -71,5 +71,5 @@ "build": "rollup -c=../../rollup.config.js" }, "types": "dist/index.d.ts", - "version": "3.7.4" + "version": "3.7.5" } diff --git a/mercury_ide/code/node_modules/fast-glob/out/managers/tasks.js b/mercury_ide/code/node_modules/fast-glob/out/managers/tasks.js index 24aba05c..c1a98d61 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/managers/tasks.js +++ b/mercury_ide/code/node_modules/fast-glob/out/managers/tasks.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; const utils = require("../utils"); function generate(patterns, settings) { const positivePatterns = getPositivePatterns(patterns); diff --git a/mercury_ide/code/node_modules/fast-glob/out/providers/filters/deep.d.ts b/mercury_ide/code/node_modules/fast-glob/out/providers/filters/deep.d.ts index b4ce3059..22586a90 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/providers/filters/deep.d.ts +++ b/mercury_ide/code/node_modules/fast-glob/out/providers/filters/deep.d.ts @@ -9,8 +9,8 @@ export default class DeepFilter { private _getNegativePatternsRe; private _filter; private _isSkippedByDeep; - private _isSkippedSymbolicLink; private _getEntryLevel; + private _isSkippedSymbolicLink; private _isSkippedByPositivePatterns; private _isSkippedByNegativePatterns; } diff --git a/mercury_ide/code/node_modules/fast-glob/out/providers/filters/deep.js b/mercury_ide/code/node_modules/fast-glob/out/providers/filters/deep.js index c8f98101..819c2603 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/providers/filters/deep.js +++ b/mercury_ide/code/node_modules/fast-glob/out/providers/filters/deep.js @@ -20,8 +20,7 @@ class DeepFilter { return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); } _filter(basePath, entry, matcher, negativeRe) { - const depth = this._getEntryLevel(basePath, entry.path); - if (this._isSkippedByDeep(depth)) { + if (this._isSkippedByDeep(basePath, entry.path)) { return false; } if (this._isSkippedSymbolicLink(entry)) { @@ -33,22 +32,31 @@ class DeepFilter { } return this._isSkippedByNegativePatterns(filepath, negativeRe); } - _isSkippedByDeep(entryDepth) { - return entryDepth >= this._settings.deep; - } - _isSkippedSymbolicLink(entry) { - return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); + _isSkippedByDeep(basePath, entryPath) { + /** + * Avoid unnecessary depth calculations when it doesn't matter. + */ + if (this._settings.deep === Infinity) { + return false; + } + return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; } _getEntryLevel(basePath, entryPath) { - const basePathDepth = basePath.split('/').length; const entryPathDepth = entryPath.split('/').length; - return entryPathDepth - (basePath === '' ? 0 : basePathDepth); + if (basePath === '') { + return entryPathDepth; + } + const basePathDepth = basePath.split('/').length; + return entryPathDepth - basePathDepth; + } + _isSkippedSymbolicLink(entry) { + return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); } _isSkippedByPositivePatterns(entryPath, matcher) { return !this._settings.baseNameMatch && !matcher.match(entryPath); } - _isSkippedByNegativePatterns(entryPath, negativeRe) { - return !utils.pattern.matchAny(entryPath, negativeRe); + _isSkippedByNegativePatterns(entryPath, patternsRe) { + return !utils.pattern.matchAny(entryPath, patternsRe); } } exports.default = DeepFilter; diff --git a/mercury_ide/code/node_modules/fast-glob/out/providers/filters/entry.js b/mercury_ide/code/node_modules/fast-glob/out/providers/filters/entry.js index eadf9af2..4e86438a 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/providers/filters/entry.js +++ b/mercury_ide/code/node_modules/fast-glob/out/providers/filters/entry.js @@ -13,20 +13,21 @@ class EntryFilter { return (entry) => this._filter(entry, positiveRe, negativeRe); } _filter(entry, positiveRe, negativeRe) { - if (this._settings.unique) { - if (this._isDuplicateEntry(entry)) { - return false; - } - this._createIndexRecord(entry); + if (this._settings.unique && this._isDuplicateEntry(entry)) { + return false; } if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { return false; } - if (this._isSkippedByAbsoluteNegativePatterns(entry, negativeRe)) { + if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) { return false; } const filepath = this._settings.baseNameMatch ? entry.name : entry.path; - return this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe); + const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe); + if (this._settings.unique && isMatched) { + this._createIndexRecord(entry); + } + return isMatched; } _isDuplicateEntry(entry) { return this.index.has(entry.path); @@ -40,12 +41,12 @@ class EntryFilter { _onlyDirectoryFilter(entry) { return this._settings.onlyDirectories && !entry.dirent.isDirectory(); } - _isSkippedByAbsoluteNegativePatterns(entry, negativeRe) { + _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { if (!this._settings.absolute) { return false; } - const fullpath = utils.path.makeAbsolute(this._settings.cwd, entry.path); - return this._isMatchToPatterns(fullpath, negativeRe); + const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); + return utils.pattern.matchAny(fullpath, patternsRe); } _isMatchToPatterns(entryPath, patternsRe) { const filepath = utils.path.removeLeadingDotSegment(entryPath); diff --git a/mercury_ide/code/node_modules/fast-glob/out/settings.js b/mercury_ide/code/node_modules/fast-glob/out/settings.js index 6e5198fb..94f9154c 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/settings.js +++ b/mercury_ide/code/node_modules/fast-glob/out/settings.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; const fs = require("fs"); const os = require("os"); const CPU_COUNT = os.cpus().length; diff --git a/mercury_ide/code/node_modules/fast-glob/out/utils/array.js b/mercury_ide/code/node_modules/fast-glob/out/utils/array.js index 884bf31d..f43f1145 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/utils/array.js +++ b/mercury_ide/code/node_modules/fast-glob/out/utils/array.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.splitWhen = exports.flatten = void 0; function flatten(items) { return items.reduce((collection, item) => [].concat(collection, item), []); } diff --git a/mercury_ide/code/node_modules/fast-glob/out/utils/errno.js b/mercury_ide/code/node_modules/fast-glob/out/utils/errno.js index adc3939b..178ace60 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/utils/errno.js +++ b/mercury_ide/code/node_modules/fast-glob/out/utils/errno.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEnoentCodeError = void 0; function isEnoentCodeError(error) { return error.code === 'ENOENT'; } diff --git a/mercury_ide/code/node_modules/fast-glob/out/utils/fs.js b/mercury_ide/code/node_modules/fast-glob/out/utils/fs.js index cd70c6bb..f15b8cf2 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/utils/fs.js +++ b/mercury_ide/code/node_modules/fast-glob/out/utils/fs.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDirentFromStats = void 0; class DirentFromStats { constructor(name, stats) { this.name = name; diff --git a/mercury_ide/code/node_modules/fast-glob/out/utils/index.js b/mercury_ide/code/node_modules/fast-glob/out/utils/index.js index 616b5aa2..8fc6703a 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/utils/index.js +++ b/mercury_ide/code/node_modules/fast-glob/out/utils/index.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; const array = require("./array"); exports.array = array; const errno = require("./errno"); diff --git a/mercury_ide/code/node_modules/fast-glob/out/utils/path.js b/mercury_ide/code/node_modules/fast-glob/out/utils/path.js index 0abbe0e5..966fcc90 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/utils/path.js +++ b/mercury_ide/code/node_modules/fast-glob/out/utils/path.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0; const path = require("path"); const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; diff --git a/mercury_ide/code/node_modules/fast-glob/out/utils/pattern.js b/mercury_ide/code/node_modules/fast-glob/out/utils/pattern.js index 827683b3..7dcadd53 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/utils/pattern.js +++ b/mercury_ide/code/node_modules/fast-glob/out/utils/pattern.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; const path = require("path"); const globParent = require("glob-parent"); const micromatch = require("micromatch"); @@ -16,6 +17,14 @@ function isStaticPattern(pattern, options = {}) { } exports.isStaticPattern = isStaticPattern; function isDynamicPattern(pattern, options = {}) { + /** + * A special case with an empty string is necessary for matching patterns that start with a forward slash. + * An empty string cannot be a dynamic pattern. + * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. + */ + if (pattern === '') { + return false; + } /** * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check * filepath directly (without read directory). @@ -90,12 +99,23 @@ function expandBraceExpansion(pattern) { } exports.expandBraceExpansion = expandBraceExpansion; function getPatternParts(pattern, options) { - const info = picomatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); - // See micromatch/picomatch#58 for more details - if (info.parts.length === 0) { - return [pattern]; + let { parts } = picomatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); + /** + * The scan method returns an empty array in some cases. + * See micromatch/picomatch#58 for more details. + */ + if (parts.length === 0) { + parts = [pattern]; + } + /** + * The scan method does not return an empty part for the pattern with a forward slash. + * This is another part of micromatch/picomatch#58. + */ + if (parts[0].startsWith('/')) { + parts[0] = parts[0].slice(1); + parts.unshift(''); } - return info.parts; + return parts; } exports.getPatternParts = getPatternParts; function makeRe(pattern, options) { diff --git a/mercury_ide/code/node_modules/fast-glob/out/utils/stream.js b/mercury_ide/code/node_modules/fast-glob/out/utils/stream.js index 6cded554..f1ab1f5b 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/utils/stream.js +++ b/mercury_ide/code/node_modules/fast-glob/out/utils/stream.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.merge = void 0; const merge2 = require("merge2"); function merge(streams) { const mergedStream = merge2(streams); diff --git a/mercury_ide/code/node_modules/fast-glob/out/utils/string.js b/mercury_ide/code/node_modules/fast-glob/out/utils/string.js index 9ab9b5db..738c2270 100644 --- a/mercury_ide/code/node_modules/fast-glob/out/utils/string.js +++ b/mercury_ide/code/node_modules/fast-glob/out/utils/string.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEmpty = exports.isString = void 0; function isString(input) { return typeof input === 'string'; } diff --git a/mercury_ide/code/node_modules/fast-glob/package.json b/mercury_ide/code/node_modules/fast-glob/package.json index b1865f93..adf9b2b6 100644 --- a/mercury_ide/code/node_modules/fast-glob/package.json +++ b/mercury_ide/code/node_modules/fast-glob/package.json @@ -1,28 +1,28 @@ { - "_from": "fast-glob", - "_id": "fast-glob@3.2.2", + "_from": "fast-glob@3.2.4", + "_id": "fast-glob@3.2.4", "_inBundle": false, - "_integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "_integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", "_location": "/fast-glob", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "fast-glob", + "raw": "fast-glob@3.2.4", "name": "fast-glob", "escapedName": "fast-glob", - "rawSpec": "", + "rawSpec": "3.2.4", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "3.2.4" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", - "_shasum": "ade1a9d91148965d4bf7c51f72e1ca662d32e63d", - "_spec": "fast-glob", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code", + "_resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "_shasum": "d20aefbf99579383e7f3cc66529158c9b98554d3", + "_spec": "fast-glob@3.2.4", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code", "author": { "name": "Denis Malinochkin", "url": "https://mrmlnc.com" @@ -47,6 +47,7 @@ "@types/easy-table": "^0.0.32", "@types/glob": "^7.1.1", "@types/glob-parent": "^5.1.0", + "@types/is-ci": "^2.0.0", "@types/merge2": "^1.1.4", "@types/micromatch": "^4.0.0", "@types/minimist": "^1.2.0", @@ -61,6 +62,8 @@ "execa": "^2.0.4", "fast-glob": "^3.0.4", "glob": "^7.1.4", + "is-ci": "^2.0.0", + "log-update": "^4.0.0", "minimist": "^1.2.0", "mocha": "^6.2.1", "rimraf": "^3.0.0", @@ -114,5 +117,5 @@ "watch": "npm run clean && npm run compile -- --sourceMap --watch" }, "typings": "out/index.d.ts", - "version": "3.2.2" + "version": "3.2.4" } diff --git a/mercury_ide/code/node_modules/fastq/index.d.ts b/mercury_ide/code/node_modules/fastq/index.d.ts index a09619a4..2f4ccf73 100644 --- a/mercury_ide/code/node_modules/fastq/index.d.ts +++ b/mercury_ide/code/node_modules/fastq/index.d.ts @@ -1,17 +1,18 @@ -declare function fastq(context: T, worker: fastq.worker, concurrency: number): fastq.queue -declare function fastq(worker: fastq.worker, concurrency: number): fastq.queue +declare function fastq(context: C, worker: fastq.worker, concurrency: number): fastq.queue +declare function fastq(worker: fastq.worker, concurrency: number): fastq.queue declare namespace fastq { - type worker = (this: T, arg: any, cb: () => void) => void - type done = (err: Error, result: any) => void + type worker = (this: C, task: T, cb: fastq.done) => void + type done = (err: Error | null, result?: R) => void - interface queue { - push(task: any, done: done): void - unshift(task: any, done: done): void + interface queue { + push(task: T, done: done): void + unshift(task: T, done: done): void pause(): any resume(): any idle(): boolean length(): number + getQueue(): T[] kill(): any killAndDrain(): any concurrency: number @@ -21,4 +22,4 @@ declare namespace fastq { } } -export = fastq \ No newline at end of file +export = fastq diff --git a/mercury_ide/code/node_modules/fastq/package.json b/mercury_ide/code/node_modules/fastq/package.json index cba72124..fa070931 100644 --- a/mercury_ide/code/node_modules/fastq/package.json +++ b/mercury_ide/code/node_modules/fastq/package.json @@ -1,8 +1,8 @@ { "_from": "fastq@^1.6.0", - "_id": "fastq@1.7.0", + "_id": "fastq@1.8.0", "_inBundle": false, - "_integrity": "sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ==", + "_integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", "_location": "/fastq", "_phantomChildren": {}, "_requested": { @@ -18,10 +18,10 @@ "_requiredBy": [ "/@nodelib/fs.walk" ], - "_resolved": "https://registry.npmjs.org/fastq/-/fastq-1.7.0.tgz", - "_shasum": "fcd79a08c5bd7ec5b55cd3f5c4720db551929801", + "_resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", + "_shasum": "550e1f9f59bbc65fe185cb6a9b4d95357107f481", "_spec": "fastq@^1.6.0", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/@nodelib/fs.walk", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/@nodelib/fs.walk", "author": { "name": "Matteo Collina", "email": "hello@matteocollina.com" @@ -71,5 +71,5 @@ "typescript": "tsc --project ./test/tsconfig.json", "unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test/test.js" }, - "version": "1.7.0" + "version": "1.8.0" } diff --git a/mercury_ide/code/node_modules/fastq/test/example.ts b/mercury_ide/code/node_modules/fastq/test/example.ts index b188d0cb..9e29e476 100644 --- a/mercury_ide/code/node_modules/fastq/test/example.ts +++ b/mercury_ide/code/node_modules/fastq/test/example.ts @@ -1,10 +1,12 @@ import * as fastq from '../' -const queue = fastq({ hello: 'world' }, worker, 1) +// Basic example -queue.push(42, (err, done) => { +const queue = fastq(worker, 1) + +queue.push('world', (err, result) => { if (err) throw err - console.log('the result is', done) + console.log('the result is', result) }) queue.concurrency @@ -13,6 +15,8 @@ queue.drain() queue.empty = () => undefined +console.log('the queue tasks are', queue.getQueue()) + queue.idle() queue.kill() @@ -27,11 +31,33 @@ queue.resume() queue.saturated = () => undefined -queue.unshift(42, (err, done) => { +queue.unshift('world', (err, result) => { + if (err) throw err + console.log('the result is', result) +}) + +function worker(task: any, cb: fastq.done) { + cb(null, 'hello ' + task) +} + +// Generics example + +interface GenericsContext { + base: number; +} + +const genericsQueue = fastq({ base: 6 }, genericsWorker, 1) + +genericsQueue.push(7, (err, done) => { + if (err) throw err + console.log('the result is', done) +}) + +genericsQueue.unshift(7, (err, done) => { if (err) throw err console.log('the result is', done) }) -function worker(arg: any, cb: any) { - cb(null, 42 * 2) +function genericsWorker(this: GenericsContext, task: number, cb: fastq.done) { + cb(null, 'the meaning of life is ' + (this.base * task)) } diff --git a/mercury_ide/code/node_modules/fs-extra/CHANGELOG.md b/mercury_ide/code/node_modules/fs-extra/CHANGELOG.md index 96d692b8..668efb26 100644 --- a/mercury_ide/code/node_modules/fs-extra/CHANGELOG.md +++ b/mercury_ide/code/node_modules/fs-extra/CHANGELOG.md @@ -1,3 +1,10 @@ +9.0.1 / 2020-06-03 +------------------ + +- Fix issue with `ensureFile()` when used with Jest on Windows ([#804](https://github.com/jprichardson/node-fs-extra/issues/804), [#805](https://github.com/jprichardson/node-fs-extra/pull/805)) +- Remove unneeded `process.umask()` call ([#791](https://github.com/jprichardson/node-fs-extra/pull/791)) +- Docs improvements ([#753](https://github.com/jprichardson/node-fs-extra/pull/753), [#795](https://github.com/jprichardson/node-fs-extra/pull/795), [#797](https://github.com/jprichardson/node-fs-extra/pull/797)) + 9.0.0 / 2020-03-19 ------------------ diff --git a/mercury_ide/code/node_modules/fs-extra/lib/mkdirs/make-dir.js b/mercury_ide/code/node_modules/fs-extra/lib/mkdirs/make-dir.js index f17ecffb..3e7e8360 100644 --- a/mercury_ide/code/node_modules/fs-extra/lib/mkdirs/make-dir.js +++ b/mercury_ide/code/node_modules/fs-extra/lib/mkdirs/make-dir.js @@ -25,8 +25,7 @@ const checkPath = pth => { } const processOptions = options => { - // Must be defined here so we get fresh process.umask() - const defaults = { mode: 0o777 & (~process.umask()) } + const defaults = { mode: 0o777 } if (typeof options === 'number') options = { mode: options } return { ...defaults, ...options } } diff --git a/mercury_ide/code/node_modules/fs-extra/lib/remove/rimraf.js b/mercury_ide/code/node_modules/fs-extra/lib/remove/rimraf.js index 1e44c128..2c771026 100644 --- a/mercury_ide/code/node_modules/fs-extra/lib/remove/rimraf.js +++ b/mercury_ide/code/node_modules/fs-extra/lib/remove/rimraf.js @@ -113,9 +113,6 @@ function fixWinEPERM (p, options, er, cb) { assert(p) assert(options) assert(typeof cb === 'function') - if (er) { - assert(er instanceof Error) - } options.chmod(p, 0o666, er2 => { if (er2) { @@ -139,9 +136,6 @@ function fixWinEPERMSync (p, options, er) { assert(p) assert(options) - if (er) { - assert(er instanceof Error) - } try { options.chmodSync(p, 0o666) @@ -173,9 +167,6 @@ function fixWinEPERMSync (p, options, er) { function rmdir (p, options, originalEr, cb) { assert(p) assert(options) - if (originalEr) { - assert(originalEr instanceof Error) - } assert(typeof cb === 'function') // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) @@ -268,9 +259,6 @@ function rimrafSync (p, options) { function rmdirSync (p, options, originalEr) { assert(p) assert(options) - if (originalEr) { - assert(originalEr instanceof Error) - } try { options.rmdirSync(p) diff --git a/mercury_ide/code/node_modules/fs-extra/package.json b/mercury_ide/code/node_modules/fs-extra/package.json index f9a339ae..0f0c3e87 100644 --- a/mercury_ide/code/node_modules/fs-extra/package.json +++ b/mercury_ide/code/node_modules/fs-extra/package.json @@ -1,30 +1,28 @@ { - "_from": "fs-extra", - "_id": "fs-extra@9.0.0", + "_from": "fs-extra@9.0.1", + "_id": "fs-extra@9.0.1", "_inBundle": false, - "_integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", + "_integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", "_location": "/fs-extra", - "_phantomChildren": { - "graceful-fs": "4.2.3" - }, + "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "fs-extra", + "raw": "fs-extra@9.0.1", "name": "fs-extra", "escapedName": "fs-extra", - "rawSpec": "", + "rawSpec": "9.0.1", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "9.0.1" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", - "_shasum": "b6afc31036e247b2466dc99c29ae797d5d4580a3", - "_spec": "fs-extra", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code", + "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", + "_shasum": "910da0062437ba4c39fedd863f1675ccfefcb9fc", + "_spec": "fs-extra@9.0.1", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code", "author": { "name": "JP Richardson", "email": "jprichardson@gmail.com" @@ -40,7 +38,7 @@ "universalify": "^1.0.0" }, "deprecated": false, - "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.", + "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.", "devDependencies": { "coveralls": "^3.0.0", "klaw": "^2.1.1", @@ -100,5 +98,5 @@ "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha", "unit": "node test.js" }, - "version": "9.0.0" + "version": "9.0.1" } diff --git a/mercury_ide/code/node_modules/graceful-fs/graceful-fs.js b/mercury_ide/code/node_modules/graceful-fs/graceful-fs.js index 8c75ee25..de3df47f 100644 --- a/mercury_ide/code/node_modules/graceful-fs/graceful-fs.js +++ b/mercury_ide/code/node_modules/graceful-fs/graceful-fs.js @@ -21,6 +21,14 @@ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { function noop () {} +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + var debug = noop if (util.debuglog) debug = util.debuglog('gfs4') @@ -32,14 +40,10 @@ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) } // Once time initialization -if (!global[gracefulQueue]) { +if (!fs[gracefulQueue]) { // This queue can be shared by multiple loaded instances - var queue = [] - Object.defineProperty(global, gracefulQueue, { - get: function() { - return queue - } - }) + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) // Patch fs.close/closeSync to shared queue version, because we need // to retry() whenever a close happens *anywhere* in the program. @@ -79,12 +83,16 @@ if (!global[gracefulQueue]) { if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { - debug(global[gracefulQueue]) - require('assert').equal(global[gracefulQueue].length, 0) + debug(fs[gracefulQueue]) + require('assert').equal(fs[gracefulQueue].length, 0) }) } } +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + module.exports = patch(clone(fs)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module.exports = patch(fs) @@ -334,11 +342,11 @@ function patch (fs) { function enqueue (elem) { debug('ENQUEUE', elem[0].name, elem[1]) - global[gracefulQueue].push(elem) + fs[gracefulQueue].push(elem) } function retry () { - var elem = global[gracefulQueue].shift() + var elem = fs[gracefulQueue].shift() if (elem) { debug('RETRY', elem[0].name, elem[1]) elem[0].apply(null, elem[1]) diff --git a/mercury_ide/code/node_modules/graceful-fs/package.json b/mercury_ide/code/node_modules/graceful-fs/package.json index 4ed09565..62488ce2 100644 --- a/mercury_ide/code/node_modules/graceful-fs/package.json +++ b/mercury_ide/code/node_modules/graceful-fs/package.json @@ -1,27 +1,28 @@ { - "_from": "graceful-fs@^4.1.6", - "_id": "graceful-fs@4.2.3", + "_from": "graceful-fs@^4.2.0", + "_id": "graceful-fs@4.2.4", "_inBundle": false, - "_integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "_integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "_location": "/graceful-fs", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "graceful-fs@^4.1.6", + "raw": "graceful-fs@^4.2.0", "name": "graceful-fs", "escapedName": "graceful-fs", - "rawSpec": "^4.1.6", + "rawSpec": "^4.2.0", "saveSpec": null, - "fetchSpec": "^4.1.6" + "fetchSpec": "^4.2.0" }, "_requiredBy": [ + "/fs-extra", "/jsonfile" ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "_shasum": "4a12ff1b60376ef09862c2093edd908328be8423", - "_spec": "graceful-fs@^4.1.6", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/jsonfile", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "_shasum": "2256bde14d3632958c465ebc96dc467ca07a29fb", + "_spec": "graceful-fs@^4.2.0", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/fs-extra", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, @@ -75,5 +76,5 @@ "preversion": "npm test", "test": "node test.js | tap -" }, - "version": "4.2.3" + "version": "4.2.4" } diff --git a/mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md b/mercury_ide/code/node_modules/jsonfile/CHANGELOG.md similarity index 100% rename from mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md rename to mercury_ide/code/node_modules/jsonfile/CHANGELOG.md diff --git a/mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/LICENSE b/mercury_ide/code/node_modules/jsonfile/LICENSE similarity index 100% rename from mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/LICENSE rename to mercury_ide/code/node_modules/jsonfile/LICENSE diff --git a/mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/README.md b/mercury_ide/code/node_modules/jsonfile/README.md similarity index 100% rename from mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/README.md rename to mercury_ide/code/node_modules/jsonfile/README.md diff --git a/mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/index.js b/mercury_ide/code/node_modules/jsonfile/index.js similarity index 100% rename from mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/index.js rename to mercury_ide/code/node_modules/jsonfile/index.js diff --git a/mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/package.json b/mercury_ide/code/node_modules/jsonfile/package.json similarity index 94% rename from mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/package.json rename to mercury_ide/code/node_modules/jsonfile/package.json index a280f244..a600fd73 100644 --- a/mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/package.json +++ b/mercury_ide/code/node_modules/jsonfile/package.json @@ -3,7 +3,7 @@ "_id": "jsonfile@6.0.1", "_inBundle": false, "_integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", - "_location": "/fs-extra/jsonfile", + "_location": "/jsonfile", "_phantomChildren": {}, "_requested": { "type": "range", @@ -21,7 +21,7 @@ "_resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", "_shasum": "98966cba214378c8c84b82e085907b40bf614179", "_spec": "jsonfile@^6.0.1", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/fs-extra", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/fs-extra", "author": { "name": "JP Richardson", "email": "jprichardson@gmail.com" diff --git a/mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/utils.js b/mercury_ide/code/node_modules/jsonfile/utils.js similarity index 100% rename from mercury_ide/code/node_modules/fs-extra/node_modules/jsonfile/utils.js rename to mercury_ide/code/node_modules/jsonfile/utils.js diff --git a/mercury_ide/code/node_modules/merge2/LICENSE b/mercury_ide/code/node_modules/merge2/LICENSE index b3f0c32e..31dd9c72 100644 --- a/mercury_ide/code/node_modules/merge2/LICENSE +++ b/mercury_ide/code/node_modules/merge2/LICENSE @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Teambition - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2014-2020 Teambition + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/mercury_ide/code/node_modules/merge2/README.md b/mercury_ide/code/node_modules/merge2/README.md index f19d627a..27f8eb99 100644 --- a/mercury_ide/code/node_modules/merge2/README.md +++ b/mercury_ide/code/node_modules/merge2/README.md @@ -124,6 +124,8 @@ Type: `Object`. * **end** - `Boolean` - if `end === false` then mergedStream will not be auto ended, you should end by yourself. **Default:** `undefined` +* **pipeError** - `Boolean` - if `pipeError === true` then mergedStream will emit `error` event from source streams. **Default:** `undefined` + * **objectMode** - `Boolean` . **Default:** `true` `objectMode` and other options(`highWaterMark`, `defaultEncoding` ...) is same as Node.js `Stream`. diff --git a/mercury_ide/code/node_modules/merge2/index.js b/mercury_ide/code/node_modules/merge2/index.js index f644e3c8..78a61edf 100644 --- a/mercury_ide/code/node_modules/merge2/index.js +++ b/mercury_ide/code/node_modules/merge2/index.js @@ -3,7 +3,7 @@ * merge2 * https://github.com/teambition/merge2 * - * Copyright (c) 2014-2016 Teambition + * Copyright (c) 2014-2020 Teambition * Licensed under the MIT license. */ const Stream = require('stream') @@ -14,16 +14,24 @@ module.exports = merge2 function merge2 () { const streamsQueue = [] - let merging = false const args = slice.call(arguments) + let merging = false let options = args[args.length - 1] - if (options && !Array.isArray(options) && options.pipe == null) args.pop() - else options = {} + if (options && !Array.isArray(options) && options.pipe == null) { + args.pop() + } else { + options = {} + } const doEnd = options.end !== false - if (options.objectMode == null) options.objectMode = true - if (options.highWaterMark == null) options.highWaterMark = 64 * 1024 + const doPipeError = options.pipeError === true + if (options.objectMode == null) { + options.objectMode = true + } + if (options.highWaterMark == null) { + options.highWaterMark = 64 * 1024 + } const mergedStream = PassThrough(options) function addStream () { @@ -35,7 +43,9 @@ function merge2 () { } function mergeStream () { - if (merging) return + if (merging) { + return + } merging = true let streams = streamsQueue.shift() @@ -43,12 +53,16 @@ function merge2 () { process.nextTick(endStream) return } - if (!Array.isArray(streams)) streams = [streams] + if (!Array.isArray(streams)) { + streams = [streams] + } let pipesCount = streams.length + 1 function next () { - if (--pipesCount > 0) return + if (--pipesCount > 0) { + return + } merging = false mergeStream() } @@ -57,19 +71,34 @@ function merge2 () { function onend () { stream.removeListener('merge2UnpipeEnd', onend) stream.removeListener('end', onend) + if (doPipeError) { + stream.removeListener('error', onerror) + } next() } + function onerror (err) { + mergedStream.emit('error', err) + } // skip ended stream - if (stream._readableState.endEmitted) return next() + if (stream._readableState.endEmitted) { + return next() + } stream.on('merge2UnpipeEnd', onend) stream.on('end', onend) + + if (doPipeError) { + stream.on('error', onerror) + } + stream.pipe(mergedStream, { end: false }) // compatible for old stream stream.resume() } - for (let i = 0; i < streams.length; i++) pipe(streams[i]) + for (let i = 0; i < streams.length; i++) { + pipe(streams[i]) + } next() } @@ -78,7 +107,9 @@ function merge2 () { merging = false // emit 'queueDrain' when all streams merged. mergedStream.emit('queueDrain') - return doEnd && mergedStream.end() + if (doEnd) { + mergedStream.end() + } } mergedStream.setMaxListeners(0) @@ -87,7 +118,9 @@ function merge2 () { stream.emit('merge2UnpipeEnd') }) - if (args.length) addStream.apply(null, args) + if (args.length) { + addStream.apply(null, args) + } return mergedStream } @@ -95,13 +128,17 @@ function merge2 () { function pauseStreams (streams, options) { if (!Array.isArray(streams)) { // Backwards-compat with old-style streams - if (!streams._readableState && streams.pipe) streams = streams.pipe(PassThrough(options)) + if (!streams._readableState && streams.pipe) { + streams = streams.pipe(PassThrough(options)) + } if (!streams._readableState || !streams.pause || !streams.pipe) { throw new Error('Only readable stream can be merged.') } streams.pause() } else { - for (let i = 0, len = streams.length; i < len; i++) streams[i] = pauseStreams(streams[i], options) + for (let i = 0, len = streams.length; i < len; i++) { + streams[i] = pauseStreams(streams[i], options) + } } return streams } diff --git a/mercury_ide/code/node_modules/merge2/package.json b/mercury_ide/code/node_modules/merge2/package.json index 23171d1b..c1167a2d 100644 --- a/mercury_ide/code/node_modules/merge2/package.json +++ b/mercury_ide/code/node_modules/merge2/package.json @@ -1,8 +1,8 @@ { "_from": "merge2@^1.3.0", - "_id": "merge2@1.3.0", + "_id": "merge2@1.4.1", "_inBundle": false, - "_integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "_integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "_location": "/merge2", "_phantomChildren": {}, "_requested": { @@ -18,10 +18,10 @@ "_requiredBy": [ "/fast-glob" ], - "_resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", - "_shasum": "5b366ee83b2f1582c48f87e47cf1a9352103ca81", + "_resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "_shasum": "4368892f885e907455a6fd7dc55c0c9d404990ae", "_spec": "merge2@^1.3.0", - "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide_0.9.9/code/node_modules/fast-glob", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/fast-glob", "authors": [ "Yan Qing " ], @@ -33,14 +33,14 @@ "deprecated": false, "description": "Merge multiple streams into one stream in sequence or parallel.", "devDependencies": { - "standard": "^14.2.0", + "standard": "^14.3.4", "through2": "^3.0.1", - "thunks": "^4.9.5", - "tman": "^1.9.0", + "thunks": "^4.9.6", + "tman": "^1.10.0", "to-through": "^2.0.0" }, "engines": { - "node": ">= 6" + "node": ">= 8" }, "files": [ "README.md", @@ -67,5 +67,5 @@ "scripts": { "test": "standard && tman" }, - "version": "1.3.0" + "version": "1.4.1" } diff --git a/mercury_ide/code/node_modules/save-dev/README.md b/mercury_ide/code/node_modules/save-dev/README.md new file mode 100644 index 00000000..5e9a74ca --- /dev/null +++ b/mercury_ide/code/node_modules/save-dev/README.md @@ -0,0 +1,9 @@ +# Security holding package + +This package name is not currently in use, but was formerly occupied +by another package. To avoid malicious use, npm is hanging on to the +package name, but loosely, and we'll probably give it to you if you +want it. + +You may adopt this package by contacting support@npmjs.com and +requesting the name. diff --git a/mercury_ide/code/node_modules/save-dev/package.json b/mercury_ide/code/node_modules/save-dev/package.json new file mode 100644 index 00000000..127bafd4 --- /dev/null +++ b/mercury_ide/code/node_modules/save-dev/package.json @@ -0,0 +1,38 @@ +{ + "_from": "save-dev@0.0.1-security", + "_id": "save-dev@0.0.1-security", + "_inBundle": false, + "_integrity": "sha512-k6knZTDNK8PKKbIqnvxiOveJinuw2LcQjqDoaorZWP9M5AR2EPsnpDeSbeoZZ0pHr5ze1uoaKdK8NBGQrJ34Uw==", + "_location": "/save-dev", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "save-dev@0.0.1-security", + "name": "save-dev", + "escapedName": "save-dev", + "rawSpec": "0.0.1-security", + "saveSpec": null, + "fetchSpec": "0.0.1-security" + }, + "_requiredBy": [ + "/total-serialism" + ], + "_resolved": "https://registry.npmjs.org/save-dev/-/save-dev-0.0.1-security.tgz", + "_shasum": "5eb7267e25a8709c20ac336f0101c8d35900ca5e", + "_spec": "save-dev@0.0.1-security", + "_where": "/Users/timohoogland/Drive/work/code/max/major_projects/mercury_lc/mercury/mercury_ide/code/node_modules/total-serialism", + "bugs": { + "url": "https://github.com/npm/security-holder/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "security holding package", + "homepage": "https://github.com/npm/security-holder#readme", + "name": "save-dev", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/security-holder.git" + }, + "version": "0.0.1-security" +} diff --git a/mercury_ide/code/node_modules/total-serialism/README.md b/mercury_ide/code/node_modules/total-serialism/README.md index 8e280338..ec6841de 100644 --- a/mercury_ide/code/node_modules/total-serialism/README.md +++ b/mercury_ide/code/node_modules/total-serialism/README.md @@ -1,12 +1,36 @@ # Total Serialism +**Visit the [Total Serialism Documentation](http://tmhglnd.github.io/total-serialism) for interactive examples.** + `total-serialism` is a set of methods used for procedurally generating and transforming number sequences. This library is mainly designed with algorithmic composition of music in mind, but can surely be useful for other purposes that involve generation and manipulation of arrays and numbers. The library is a result of my research in algorithmic composition, livecoding and electronic music and was first prototyped with Max/MSP in the [Mercury](http://github.com/tmhglnd/mercury) livecoding environment. -*This library is a work in progress, and I'm always interested in receiving inspiration, suggestions, enhancements, literature and more. Feel free to file an [issue here](https://github.com/tmhglnd/total-serialism/issues) or make a pull request and I will gladly look into it!* +*This library is a work in progress. I'm always interested in receiving inspiration, suggestions, enhancements, literature and more. Feel free to file an [issue here](https://github.com/tmhglnd/total-serialism/issues) or make a pull request and I will gladly look into it!* + +# Table of Content + +- [Install](#install) +- [Content](#content) +- [Usage](#usage) + - [Generative Methods](docs/generative-methods.md) + - [Algorithmic Methods](docs/algorithmic-methods.md) + - [Euclidean Rhythm](docs/algorithmic-methods.md#euclid) + - [Hexadecimal Rhythm](docs/algorithmic-methods.md#hexBeat) + - [Lindenmayer System](docs/algorithmic-methods.md#linden) + - [Fibonacci Sequence](docs/algorithmic-methods.md#fibonacci) + - [Pisano Period](docs/algorithmic-methods.md#pisano) + - [Stochastic Methods](docs/stochastic-methods.md) + - [Markov Chain](docs/stochastic-methods.md#markov-chain) + - [Transform Methods](docs/transform-methods.md) + - [Statistic Methods](docs/statistic-methods.md) + - [Translate Methods](docs/translate-methods.md) + - [Utility Methods](docs/utility-methods.md) +- [In Action](#in-action) +- [Inspiration & Further Reading](#inspiration--further-reading) +- [License](#license) # Install -Install in node_modules: +## Install in node_modules ``` $ npm install total-serialism @@ -19,7 +43,7 @@ const Srl = require('total-serialism'); const Gen = require('total-serialism').Generative; ``` -Import es5 version +## Import es5 version ```js // entire package @@ -28,12 +52,18 @@ const Srl = require('total-serialism/build/ts.es5.js'); const Algo = require('total-serialism/build/ts.es5.js').Algorithmic; ``` -Include bundled minified es5 through url in index.html: +## Include in html + +Include latest or specific version of bundled minified es5 through url in index.html ```html - + + + ``` +Use in a html `