@tonaljs/voicing-dictionary
Version:
Collections of chord voicings
115 lines (112 loc) • 3.78 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all2) => {
for (var name in all2)
__defProp(target, name, { get: all2[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// index.ts
var index_exports = {};
__export(index_exports, {
all: () => all,
default: () => index_default,
defaultDictionary: () => defaultDictionary,
lefthand: () => lefthand,
lookup: () => lookup,
triads: () => triads
});
module.exports = __toCommonJS(index_exports);
var import_chord = __toESM(require("@tonaljs/chord"));
// data.ts
var triads = {
M: ["1P 3M 5P", "3M 5P 8P", "5P 8P 10M"],
m: ["1P 3m 5P", "3m 5P 8P", "5P 8P 10m"],
o: ["1P 3m 5d", "3m 5d 8P", "5d 8P 10m"],
aug: ["1P 3m 5A", "3m 5A 8P", "5A 8P 10m"]
};
var lefthand = {
m7: ["3m 5P 7m 9M", "7m 9M 10m 12P"],
"7": ["3M 6M 7m 9M", "7m 9M 10M 13M"],
"^7": ["3M 5P 7M 9M", "7M 9M 10M 12P"],
"69": ["3M 5P 6A 9M"],
m7b5: ["3m 5d 7m 8P", "7m 8P 10m 12d"],
"7b9": ["3M 6m 7m 9m", "7m 9m 10M 13m"],
// b9 / b13
"7b13": ["3M 6m 7m 9m", "7m 9m 10M 13m"],
// b9 / b13
o7: ["1P 3m 5d 6M", "5d 6M 8P 10m"],
"7#11": ["7m 9M 11A 13A"],
"7#9": ["3M 7m 9A"],
mM7: ["3m 5P 7M 9M", "7M 9M 10m 12P"],
m6: ["3m 5P 6M 9M", "6M 9M 10m 12P"]
};
var all = {
M: ["1P 3M 5P", "3M 5P 8P", "5P 8P 10M"],
m: ["1P 3m 5P", "3m 5P 8P", "5P 8P 10m"],
o: ["1P 3m 5d", "3m 5d 8P", "5d 8P 10m"],
aug: ["1P 3m 5A", "3m 5A 8P", "5A 8P 10m"],
m7: ["3m 5P 7m 9M", "7m 9M 10m 12P"],
"7": ["3M 6M 7m 9M", "7m 9M 10M 13M"],
"^7": ["3M 5P 7M 9M", "7M 9M 10M 12P"],
"69": ["3M 5P 6A 9M"],
m7b5: ["3m 5d 7m 8P", "7m 8P 10m 12d"],
"7b9": ["3M 6m 7m 9m", "7m 9m 10M 13m"],
// b9 / b13
"7b13": ["3M 6m 7m 9m", "7m 9m 10M 13m"],
// b9 / b13
o7: ["1P 3m 5d 6M", "5d 6M 8P 10m"],
"7#11": ["7m 9M 11A 13A"],
"7#9": ["3M 7m 9A"],
mM7: ["3m 5P 7M 9M", "7M 9M 10m 12P"],
m6: ["3m 5P 6M 9M", "6M 9M 10m 12P"]
};
// index.ts
var defaultDictionary = lefthand;
function lookup(symbol, dictionary = defaultDictionary) {
if (dictionary[symbol]) {
return dictionary[symbol];
}
const { aliases } = import_chord.default.get("C" + symbol);
const match = Object.keys(dictionary).find((_symbol) => aliases.includes(_symbol)) || "";
if (match !== void 0) {
return dictionary[match];
}
return void 0;
}
var index_default = {
lookup,
lefthand,
triads,
all,
defaultDictionary
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
all,
defaultDictionary,
lefthand,
lookup,
triads
});
//# sourceMappingURL=index.js.map
;