@musodojo/music-theory-data 27.0.0 → 29.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -12
- package/esm/src/data/chord-progressions/mod.d.ts +20 -64
- package/esm/src/data/chord-progressions/mod.d.ts.map +1 -1
- package/esm/src/data/chord-progressions/mod.js +154 -65
- package/esm/src/data/chords/mod.d.ts +5 -0
- package/esm/src/data/chords/mod.d.ts.map +1 -1
- package/esm/src/data/chords/mod.js +20 -0
- package/esm/src/data/note-collections/augmented-variants.d.ts +1 -0
- package/esm/src/data/note-collections/augmented-variants.d.ts.map +1 -1
- package/esm/src/data/note-collections/augmented-variants.js +25 -0
- package/esm/src/data/note-collections/mod.d.ts +2 -1
- package/esm/src/data/note-collections/mod.d.ts.map +1 -1
- package/esm/src/mod.d.ts +1 -1
- package/esm/src/mod.js +1 -1
- package/esm/src/utils/chord-progressions.d.ts +16 -16
- package/esm/src/utils/chord-progressions.d.ts.map +1 -1
- package/esm/src/utils/chord-progressions.js +55 -101
- package/package.json +1 -1
- package/script/src/data/chord-progressions/mod.d.ts +20 -64
- package/script/src/data/chord-progressions/mod.d.ts.map +1 -1
- package/script/src/data/chord-progressions/mod.js +155 -70
- package/script/src/data/chords/mod.d.ts +5 -0
- package/script/src/data/chords/mod.d.ts.map +1 -1
- package/script/src/data/chords/mod.js +22 -1
- package/script/src/data/note-collections/augmented-variants.d.ts +1 -0
- package/script/src/data/note-collections/augmented-variants.d.ts.map +1 -1
- package/script/src/data/note-collections/augmented-variants.js +25 -0
- package/script/src/data/note-collections/mod.d.ts +2 -1
- package/script/src/data/note-collections/mod.d.ts.map +1 -1
- package/script/src/mod.d.ts +1 -1
- package/script/src/mod.js +1 -1
- package/script/src/utils/chord-progressions.d.ts +16 -16
- package/script/src/utils/chord-progressions.d.ts.map +1 -1
- package/script/src/utils/chord-progressions.js +61 -106
- package/esm/src/data/chord-progressions/basic.d.ts +0 -10
- package/esm/src/data/chord-progressions/basic.d.ts.map +0 -1
- package/esm/src/data/chord-progressions/basic.js +0 -164
- package/esm/src/data/chord-progressions/blues.d.ts +0 -5
- package/esm/src/data/chord-progressions/blues.d.ts.map +0 -1
- package/esm/src/data/chord-progressions/blues.js +0 -30
- package/esm/src/data/chord-progressions/jazz.d.ts +0 -8
- package/esm/src/data/chord-progressions/jazz.d.ts.map +0 -1
- package/esm/src/data/chord-progressions/jazz.js +0 -143
- package/esm/src/data/chord-progressions/pop.d.ts +0 -6
- package/esm/src/data/chord-progressions/pop.d.ts.map +0 -1
- package/esm/src/data/chord-progressions/pop.js +0 -42
- package/script/src/data/chord-progressions/basic.d.ts +0 -10
- package/script/src/data/chord-progressions/basic.d.ts.map +0 -1
- package/script/src/data/chord-progressions/basic.js +0 -167
- package/script/src/data/chord-progressions/blues.d.ts +0 -5
- package/script/src/data/chord-progressions/blues.d.ts.map +0 -1
- package/script/src/data/chord-progressions/blues.js +0 -33
- package/script/src/data/chord-progressions/jazz.d.ts +0 -8
- package/script/src/data/chord-progressions/jazz.d.ts.map +0 -1
- package/script/src/data/chord-progressions/jazz.js +0 -146
- package/script/src/data/chord-progressions/pop.d.ts +0 -6
- package/script/src/data/chord-progressions/pop.d.ts.map +0 -1
- package/script/src/data/chord-progressions/pop.js +0 -45
|
@@ -19,6 +19,7 @@ export declare const noteCollections: {
|
|
|
19
19
|
readonly wholeTone: import("../../mod.js").NoteCollection;
|
|
20
20
|
readonly augmentedTriad: import("../../mod.js").ChordCollection;
|
|
21
21
|
readonly augmented7: import("../../mod.js").ChordCollection;
|
|
22
|
+
readonly augmentedMajor7: import("../../mod.js").ChordCollection;
|
|
22
23
|
readonly diminishedTriad: import("../../mod.js").NoteCollection;
|
|
23
24
|
readonly diminished7: import("../../mod.js").NoteCollection;
|
|
24
25
|
readonly halfDiminished7: import("../../mod.js").NoteCollection;
|
|
@@ -81,7 +82,7 @@ export declare const groupedNoteCollections: {
|
|
|
81
82
|
readonly harmonicMinorModes: Record<"harmonicMinor" | "locrianNatural6" | "ionianSharp5" | "dorianSharp4" | "phrygianDominant" | "lydianSharp2" | "superLocrianDoubleFlat7", import("../../mod.js").ModalScaleCollection>;
|
|
82
83
|
readonly melodicMinorModes: Record<"melodicMinor" | "dorianFlat2" | "lydianAugmented" | "lydianDominant" | "mixolydianFlat6" | "aeolianFlat5" | "altered", import("../../mod.js").ModalScaleCollection>;
|
|
83
84
|
readonly diminishedVariants: Record<"diminishedTriad" | "diminished7" | "halfDiminished7" | "wholeHalfDiminished" | "halfWholeDiminished", import("../../mod.js").NoteCollection>;
|
|
84
|
-
readonly augmentedVariants: Record<"augmentedTriad" | "augmented7", import("../../mod.js").ChordCollection>;
|
|
85
|
+
readonly augmentedVariants: Record<"augmentedTriad" | "augmented7" | "augmentedMajor7", import("../../mod.js").ChordCollection>;
|
|
85
86
|
readonly otherNoteCollections: Record<"root" | "rootAndFifth" | "rootAndFourth" | "rootAndTritone" | "bluesPentatonic" | "chromatic" | "wholeTone", import("../../mod.js").NoteCollection>;
|
|
86
87
|
};
|
|
87
88
|
/** A strictly typed generic string representing the key of a top-level note collection category array. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/data/note-collections/mod.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,oIAAoI;AACpI,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/data/note-collections/mod.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,oIAAoI;AACpI,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWlB,CAAC;AAEX,0HAA0H;AAC1H,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,eAAe,CAAC;AAE7D,qIAAqI;AACrI,eAAO,MAAM,sBAAsB;;;;;;;;;;;CAWzB,CAAC;AAEX,0GAA0G;AAC1G,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,sBAAsB,CAAC;AAEzE,sHAAsH;AACtH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAC/C,sBAAsB,EACtB;IACE,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,CAkDO,CAAC"}
|
package/script/src/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A comprehensive library of music theory data, including notes, dyads, scales, chord pitch collections, and chord
|
|
2
|
+
* A comprehensive library of music theory data, including notes, dyads, scales, chord pitch collections, and chord progressions.
|
|
3
3
|
*
|
|
4
4
|
* This package provides a collection of datasets and utility functions
|
|
5
5
|
* to work with fundamental concepts of music theory. It's designed to be
|
package/script/src/mod.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/**
|
|
18
|
-
* A comprehensive library of music theory data, including notes, dyads, scales, chord pitch collections, and chord
|
|
18
|
+
* A comprehensive library of music theory data, including notes, dyads, scales, chord pitch collections, and chord progressions.
|
|
19
19
|
*
|
|
20
20
|
* This package provides a collection of datasets and utility functions
|
|
21
21
|
* to work with fundamental concepts of music theory. It's designed to be
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
export interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type?: string;
|
|
1
|
+
import { type ChordProgressionKey } from "../data/chord-progressions/mod.js";
|
|
2
|
+
import type { ChordProgression } from "../types/chord-progressions";
|
|
3
|
+
import type { RootNote } from "../data/labels/note-labels.js";
|
|
4
|
+
import type { NoteCollectionKey } from "../data/note-collections/mod.js";
|
|
5
|
+
export interface ChordProgressionChordReference {
|
|
6
|
+
readonly rootNote: RootNote;
|
|
7
|
+
readonly chordName: string;
|
|
8
|
+
readonly noteCollectionKey: NoteCollectionKey;
|
|
10
9
|
}
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function
|
|
10
|
+
export declare function isValidChordProgressionKey(key: string): key is ChordProgressionKey;
|
|
11
|
+
export declare function getChordProgressionChordNames(rootNote: RootNote, progressionOrKey: ChordProgression | ChordProgressionKey): string[];
|
|
12
|
+
export declare function getChordProgressionRomanSymbols(progressionOrKey: ChordProgression | ChordProgressionKey): string[];
|
|
13
|
+
export declare function getChordProgressionKeysForTotalBars(totalBars: number): ChordProgressionKey[];
|
|
14
|
+
export declare function getChordProgressionUniqueChordNames(rootNote: RootNote, progressionOrKey: ChordProgression | ChordProgressionKey): string[];
|
|
15
|
+
export declare function getChordProgressionChordReferences(rootNote: RootNote, progressionOrKey: ChordProgression | ChordProgressionKey): ChordProgressionChordReference[];
|
|
16
|
+
export declare function getChordProgressionUniqueChordReferences(rootNote: RootNote, progressionOrKey: ChordProgression | ChordProgressionKey): ChordProgressionChordReference[];
|
|
17
|
+
export declare function getChordProgressionTotalDurationInBars(progressionOrKey: ChordProgression | ChordProgressionKey): number;
|
|
18
18
|
//# sourceMappingURL=chord-progressions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chord-progressions.d.ts","sourceRoot":"","sources":["../../../src/src/utils/chord-progressions.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"chord-progressions.d.ts","sourceRoot":"","sources":["../../../src/src/utils/chord-progressions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAMzE,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;CAC/C;AAED,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,GACV,GAAG,IAAI,mBAAmB,CAE5B;AASD,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,GACvD,MAAM,EAAE,CAYV;AAED,wBAAgB,+BAA+B,CAC7C,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,GACvD,MAAM,EAAE,CAKV;AAED,wBAAgB,mCAAmC,CACjD,SAAS,EAAE,MAAM,GAChB,mBAAmB,EAAE,CAKvB;AAED,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,GACvD,MAAM,EAAE,CAIV;AAED,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,GACvD,8BAA8B,EAAE,CAmBlC;AAED,wBAAgB,wCAAwC,CACtD,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,GACvD,8BAA8B,EAAE,CAkBlC;AAED,wBAAgB,sCAAsC,CACpD,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,GACvD,MAAM,CAQR"}
|
|
@@ -1,120 +1,75 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
3
|
+
exports.isValidChordProgressionKey = isValidChordProgressionKey;
|
|
4
|
+
exports.getChordProgressionChordNames = getChordProgressionChordNames;
|
|
5
|
+
exports.getChordProgressionRomanSymbols = getChordProgressionRomanSymbols;
|
|
6
|
+
exports.getChordProgressionKeysForTotalBars = getChordProgressionKeysForTotalBars;
|
|
7
|
+
exports.getChordProgressionUniqueChordNames = getChordProgressionUniqueChordNames;
|
|
8
|
+
exports.getChordProgressionChordReferences = getChordProgressionChordReferences;
|
|
9
|
+
exports.getChordProgressionUniqueChordReferences = getChordProgressionUniqueChordReferences;
|
|
10
|
+
exports.getChordProgressionTotalDurationInBars = getChordProgressionTotalDurationInBars;
|
|
10
11
|
const mod_js_1 = require("../data/chord-progressions/mod.js");
|
|
11
|
-
const
|
|
12
|
+
const mod_js_2 = require("../data/chords/mod.js");
|
|
12
13
|
const note_names_js_1 = require("./note-names.js");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return Object.prototype.hasOwnProperty.call(mod_js_1.chordProgressionTemplates, key);
|
|
14
|
+
function isValidChordProgressionKey(key) {
|
|
15
|
+
return Object.prototype.hasOwnProperty.call(mod_js_1.chordProgressions, key);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
17
|
+
function resolveProgression(progressionOrKey) {
|
|
18
|
+
if (typeof progressionOrKey !== "string")
|
|
19
|
+
return progressionOrKey;
|
|
20
|
+
return mod_js_1.chordProgressions[progressionOrKey];
|
|
19
21
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
function getSearchableTemplateText(template) {
|
|
28
|
-
return [
|
|
29
|
-
template.primaryName,
|
|
30
|
-
template.templateType,
|
|
31
|
-
template.category,
|
|
32
|
-
...template.names,
|
|
33
|
-
...template.type,
|
|
34
|
-
...template.characteristics,
|
|
35
|
-
...getChordProgressionTemplateDegreeNames(template),
|
|
36
|
-
...getChordProgressionTemplateRomanNames(template),
|
|
37
|
-
]
|
|
38
|
-
.map(normalizeSearchTerm)
|
|
39
|
-
.join(" ");
|
|
40
|
-
}
|
|
41
|
-
function searchChordProgressionTemplates(options = {}) {
|
|
42
|
-
const { query, category, templateType, type } = options;
|
|
43
|
-
let candidates = Object.values(mod_js_1.chordProgressionTemplates);
|
|
44
|
-
if (category) {
|
|
45
|
-
candidates = candidates.filter((template) => template.category === category);
|
|
46
|
-
}
|
|
47
|
-
if (templateType) {
|
|
48
|
-
candidates = candidates.filter((template) => template.templateType === templateType);
|
|
49
|
-
}
|
|
50
|
-
if (type) {
|
|
51
|
-
const normalizedType = normalizeSearchTerm(type);
|
|
52
|
-
candidates = candidates.filter((template) => template.type.map(normalizeSearchTerm).includes(normalizedType));
|
|
53
|
-
}
|
|
54
|
-
if (!query)
|
|
55
|
-
return candidates;
|
|
56
|
-
const normalizedQuery = normalizeSearchTerm(query);
|
|
57
|
-
if (!normalizedQuery)
|
|
58
|
-
return candidates;
|
|
59
|
-
const queryWords = normalizedQuery.split(" ");
|
|
60
|
-
const textFilteredCandidates = candidates.filter((template) => {
|
|
61
|
-
const searchableText = getSearchableTemplateText(template);
|
|
62
|
-
return queryWords.every((word) => searchableText.includes(word));
|
|
63
|
-
});
|
|
64
|
-
const prioritizedResults = new Set();
|
|
65
|
-
const passes = [
|
|
66
|
-
(template) => normalizeSearchTerm(template.primaryName) === normalizedQuery,
|
|
67
|
-
(template) => template.names.some((name) => normalizeSearchTerm(name) === normalizedQuery),
|
|
68
|
-
(template) => normalizeSearchTerm(template.primaryName).startsWith(normalizedQuery),
|
|
69
|
-
(template) => template.names.some((name) => normalizeSearchTerm(name).startsWith(normalizedQuery)),
|
|
70
|
-
];
|
|
71
|
-
for (const pass of passes) {
|
|
72
|
-
for (const template of textFilteredCandidates) {
|
|
73
|
-
if (pass(template))
|
|
74
|
-
prioritizedResults.add(template);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
for (const template of textFilteredCandidates) {
|
|
78
|
-
prioritizedResults.add(template);
|
|
79
|
-
}
|
|
80
|
-
return Array.from(prioritizedResults);
|
|
81
|
-
}
|
|
82
|
-
function findChordProgressionTemplate(options = {}) {
|
|
83
|
-
return searchChordProgressionTemplates(options)[0];
|
|
22
|
+
function getChordProgressionChordNames(rootNote, progressionOrKey) {
|
|
23
|
+
const progression = resolveProgression(progressionOrKey);
|
|
24
|
+
if (!progression)
|
|
25
|
+
return [];
|
|
26
|
+
const noteNames = (0, note_names_js_1.getNoteNamesForRootAndIntervals)(rootNote, progression.chords.map((chord) => chord.degree));
|
|
27
|
+
return progression.chords.map((chord, index) => noteNames[index] + chord.quality);
|
|
84
28
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
29
|
+
function getChordProgressionRomanSymbols(progressionOrKey) {
|
|
30
|
+
const progression = resolveProgression(progressionOrKey);
|
|
31
|
+
if (!progression)
|
|
32
|
+
return [];
|
|
33
|
+
return progression.chords.map((chord) => chord.romanSymbol);
|
|
89
34
|
}
|
|
90
|
-
function
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return undefined;
|
|
94
|
-
const [, accidental, intervalNumber] = match;
|
|
95
|
-
const roman = (0, chords_js_1.getRomanNumeralForScaleIndexAndChordQuality)(Number(intervalNumber) - 1, quality);
|
|
96
|
-
return roman === undefined ? undefined : accidental + roman;
|
|
35
|
+
function getChordProgressionKeysForTotalBars(totalBars) {
|
|
36
|
+
return mod_js_1.chordProgressionBarGroups.find((group) => group.totalBars === totalBars)
|
|
37
|
+
?.progressionKeys.slice() ?? [];
|
|
97
38
|
}
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
if (!template)
|
|
101
|
-
return [];
|
|
102
|
-
return flattenTemplateSteps(template).map((step) => step.interval + step.quality);
|
|
39
|
+
function getChordProgressionUniqueChordNames(rootNote, progressionOrKey) {
|
|
40
|
+
return Array.from(new Set(getChordProgressionChordNames(rootNote, progressionOrKey)));
|
|
103
41
|
}
|
|
104
|
-
function
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
42
|
+
function getChordProgressionChordReferences(rootNote, progressionOrKey) {
|
|
43
|
+
const progression = resolveProgression(progressionOrKey);
|
|
44
|
+
if (!progression)
|
|
107
45
|
return [];
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
46
|
+
const chordRootNotes = (0, note_names_js_1.getNoteNamesForRootAndIntervals)(rootNote, progression.chords.map((chord) => chord.degree)).map((noteName) => (0, note_names_js_1.normalizeRootNoteString)(noteName));
|
|
47
|
+
return progression.chords.flatMap((chord, index) => {
|
|
48
|
+
const chordRootNote = chordRootNotes[index];
|
|
49
|
+
if (!chordRootNote)
|
|
50
|
+
return [];
|
|
51
|
+
return [{
|
|
52
|
+
rootNote: chordRootNote,
|
|
53
|
+
chordName: chordRootNote + chord.quality,
|
|
54
|
+
noteCollectionKey: (0, mod_js_2.getChordQualityNoteCollectionKey)(chord.quality),
|
|
55
|
+
}];
|
|
111
56
|
});
|
|
112
57
|
}
|
|
113
|
-
function
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
58
|
+
function getChordProgressionUniqueChordReferences(rootNote, progressionOrKey) {
|
|
59
|
+
const uniqueReferences = [];
|
|
60
|
+
const seen = new Set();
|
|
61
|
+
for (const reference of getChordProgressionChordReferences(rootNote, progressionOrKey)) {
|
|
62
|
+
const key = `${reference.rootNote}:${reference.noteCollectionKey}:${reference.chordName}`;
|
|
63
|
+
if (seen.has(key))
|
|
64
|
+
continue;
|
|
65
|
+
seen.add(key);
|
|
66
|
+
uniqueReferences.push(reference);
|
|
67
|
+
}
|
|
68
|
+
return uniqueReferences;
|
|
69
|
+
}
|
|
70
|
+
function getChordProgressionTotalDurationInBars(progressionOrKey) {
|
|
71
|
+
const progression = resolveProgression(progressionOrKey);
|
|
72
|
+
if (!progression)
|
|
73
|
+
return 0;
|
|
74
|
+
return progression.chords.reduce((total, chord) => total + chord.durationInBars, 0);
|
|
120
75
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ChordProgressionTemplate } from "../../types/chord-progressions";
|
|
2
|
-
export declare const basicChordProgressionTemplates: {
|
|
3
|
-
readonly oneFourFive: ChordProgressionTemplate;
|
|
4
|
-
readonly oneFive: ChordProgressionTemplate;
|
|
5
|
-
readonly oneFour: ChordProgressionTemplate;
|
|
6
|
-
readonly oneOneFiveFive: ChordProgressionTemplate;
|
|
7
|
-
readonly oneOneFiveFiveSeven: ChordProgressionTemplate;
|
|
8
|
-
readonly oneFourOneFive: ChordProgressionTemplate;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=basic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../../src/src/data/chord-progressions/basic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAoK/E,eAAO,MAAM,8BAA8B;;;;;;;CAOjC,CAAC"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
const oneFourFive = {
|
|
2
|
-
templateType: "formula",
|
|
3
|
-
category: "basic",
|
|
4
|
-
primaryName: "I IV V",
|
|
5
|
-
names: ["I IV V", "One Four Five", "1 4 5"],
|
|
6
|
-
type: ["basic", "formula", "major key", "three chord", "beginner"],
|
|
7
|
-
characteristics: [
|
|
8
|
-
"simple",
|
|
9
|
-
"foundational",
|
|
10
|
-
"common",
|
|
11
|
-
"beginner friendly",
|
|
12
|
-
"tonic subdominant dominant",
|
|
13
|
-
],
|
|
14
|
-
sections: [
|
|
15
|
-
{
|
|
16
|
-
name: "Main",
|
|
17
|
-
chords: [
|
|
18
|
-
{ interval: "1", quality: "M", noteCollectionKey: "major" },
|
|
19
|
-
{ interval: "4", quality: "M", noteCollectionKey: "major" },
|
|
20
|
-
{ interval: "5", quality: "M", noteCollectionKey: "major" },
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
};
|
|
25
|
-
const oneFive = {
|
|
26
|
-
templateType: "formula",
|
|
27
|
-
category: "basic",
|
|
28
|
-
primaryName: "I V",
|
|
29
|
-
names: ["I V", "One Five", "1 5"],
|
|
30
|
-
type: ["basic", "formula", "major key", "two chord", "beginner"],
|
|
31
|
-
characteristics: [
|
|
32
|
-
"simple",
|
|
33
|
-
"foundational",
|
|
34
|
-
"common",
|
|
35
|
-
"beginner friendly",
|
|
36
|
-
"tonic dominant",
|
|
37
|
-
],
|
|
38
|
-
sections: [
|
|
39
|
-
{
|
|
40
|
-
name: "Main",
|
|
41
|
-
chords: [
|
|
42
|
-
{ interval: "1", quality: "M", noteCollectionKey: "major" },
|
|
43
|
-
{ interval: "5", quality: "M", noteCollectionKey: "major" },
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
};
|
|
48
|
-
const oneFour = {
|
|
49
|
-
templateType: "formula",
|
|
50
|
-
category: "basic",
|
|
51
|
-
primaryName: "I IV",
|
|
52
|
-
names: ["I IV", "One Four", "1 4"],
|
|
53
|
-
type: ["basic", "formula", "major key", "two chord", "beginner"],
|
|
54
|
-
characteristics: [
|
|
55
|
-
"simple",
|
|
56
|
-
"foundational",
|
|
57
|
-
"common",
|
|
58
|
-
"beginner friendly",
|
|
59
|
-
"tonic subdominant",
|
|
60
|
-
],
|
|
61
|
-
sections: [
|
|
62
|
-
{
|
|
63
|
-
name: "Main",
|
|
64
|
-
chords: [
|
|
65
|
-
{ interval: "1", quality: "M", noteCollectionKey: "major" },
|
|
66
|
-
{ interval: "4", quality: "M", noteCollectionKey: "major" },
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
};
|
|
71
|
-
const oneOneFiveFive = {
|
|
72
|
-
templateType: "loop",
|
|
73
|
-
category: "basic",
|
|
74
|
-
primaryName: "I I V V",
|
|
75
|
-
names: ["I I V V", "One One Five Five", "1 1 5 5", "Tonic Dominant Loop"],
|
|
76
|
-
type: ["basic", "loop", "major key", "tonic dominant", "beginner"],
|
|
77
|
-
characteristics: [
|
|
78
|
-
"simple",
|
|
79
|
-
"playable",
|
|
80
|
-
"stable",
|
|
81
|
-
"beginner friendly",
|
|
82
|
-
"practice loop",
|
|
83
|
-
],
|
|
84
|
-
sections: [
|
|
85
|
-
{
|
|
86
|
-
name: "Main",
|
|
87
|
-
chords: [
|
|
88
|
-
{ interval: "1", quality: "M", noteCollectionKey: "major" },
|
|
89
|
-
{ interval: "1", quality: "M", noteCollectionKey: "major" },
|
|
90
|
-
{ interval: "5", quality: "M", noteCollectionKey: "major" },
|
|
91
|
-
{ interval: "5", quality: "M", noteCollectionKey: "major" },
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
};
|
|
96
|
-
const oneOneFiveFiveSeven = {
|
|
97
|
-
templateType: "loop",
|
|
98
|
-
category: "basic",
|
|
99
|
-
primaryName: "I I V V7",
|
|
100
|
-
names: [
|
|
101
|
-
"I I V V7",
|
|
102
|
-
"One One Five Five-Seven",
|
|
103
|
-
"Tonic Dominant Seventh Loop",
|
|
104
|
-
],
|
|
105
|
-
type: [
|
|
106
|
-
"basic",
|
|
107
|
-
"loop",
|
|
108
|
-
"major key",
|
|
109
|
-
"tonic dominant",
|
|
110
|
-
"turnaround",
|
|
111
|
-
"beginner",
|
|
112
|
-
],
|
|
113
|
-
characteristics: [
|
|
114
|
-
"simple",
|
|
115
|
-
"playable",
|
|
116
|
-
"resolving",
|
|
117
|
-
"beginner friendly",
|
|
118
|
-
"practice loop",
|
|
119
|
-
],
|
|
120
|
-
sections: [
|
|
121
|
-
{
|
|
122
|
-
name: "Main",
|
|
123
|
-
chords: [
|
|
124
|
-
{ interval: "1", quality: "M", noteCollectionKey: "major" },
|
|
125
|
-
{ interval: "1", quality: "M", noteCollectionKey: "major" },
|
|
126
|
-
{ interval: "5", quality: "M", noteCollectionKey: "major" },
|
|
127
|
-
{ interval: "5", quality: "7", noteCollectionKey: "dominant7" },
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
};
|
|
132
|
-
const oneFourOneFive = {
|
|
133
|
-
templateType: "loop",
|
|
134
|
-
category: "basic",
|
|
135
|
-
primaryName: "I IV I V",
|
|
136
|
-
names: ["I IV I V", "One Four One Five", "1 4 1 5"],
|
|
137
|
-
type: ["basic", "loop", "major key", "three chord", "beginner"],
|
|
138
|
-
characteristics: [
|
|
139
|
-
"simple",
|
|
140
|
-
"playable",
|
|
141
|
-
"balanced",
|
|
142
|
-
"beginner friendly",
|
|
143
|
-
"practice loop",
|
|
144
|
-
],
|
|
145
|
-
sections: [
|
|
146
|
-
{
|
|
147
|
-
name: "Main",
|
|
148
|
-
chords: [
|
|
149
|
-
{ interval: "1", quality: "M", noteCollectionKey: "major" },
|
|
150
|
-
{ interval: "4", quality: "M", noteCollectionKey: "major" },
|
|
151
|
-
{ interval: "1", quality: "M", noteCollectionKey: "major" },
|
|
152
|
-
{ interval: "5", quality: "M", noteCollectionKey: "major" },
|
|
153
|
-
],
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
};
|
|
157
|
-
export const basicChordProgressionTemplates = {
|
|
158
|
-
oneFourFive,
|
|
159
|
-
oneFive,
|
|
160
|
-
oneFour,
|
|
161
|
-
oneOneFiveFive,
|
|
162
|
-
oneOneFiveFiveSeven,
|
|
163
|
-
oneFourOneFive,
|
|
164
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blues.d.ts","sourceRoot":"","sources":["../../../../src/src/data/chord-progressions/blues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AA8B/E,eAAO,MAAM,8BAA8B;;CAEjC,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const twelveBarBlues = {
|
|
2
|
-
templateType: "form",
|
|
3
|
-
category: "blues",
|
|
4
|
-
primaryName: "Twelve Bar Blues",
|
|
5
|
-
names: ["Twelve Bar Blues", "12 Bar Blues", "I7 IV7 V7 Blues"],
|
|
6
|
-
type: ["blues", "form", "dominant seventh", "twelve bar", "beginner"],
|
|
7
|
-
characteristics: ["foundational", "cyclical", "common", "blues"],
|
|
8
|
-
sections: [
|
|
9
|
-
{
|
|
10
|
-
name: "Main",
|
|
11
|
-
chords: [
|
|
12
|
-
{ interval: "1", quality: "7", noteCollectionKey: "dominant7" },
|
|
13
|
-
{ interval: "1", quality: "7", noteCollectionKey: "dominant7" },
|
|
14
|
-
{ interval: "1", quality: "7", noteCollectionKey: "dominant7" },
|
|
15
|
-
{ interval: "1", quality: "7", noteCollectionKey: "dominant7" },
|
|
16
|
-
{ interval: "4", quality: "7", noteCollectionKey: "dominant7" },
|
|
17
|
-
{ interval: "4", quality: "7", noteCollectionKey: "dominant7" },
|
|
18
|
-
{ interval: "1", quality: "7", noteCollectionKey: "dominant7" },
|
|
19
|
-
{ interval: "1", quality: "7", noteCollectionKey: "dominant7" },
|
|
20
|
-
{ interval: "5", quality: "7", noteCollectionKey: "dominant7" },
|
|
21
|
-
{ interval: "4", quality: "7", noteCollectionKey: "dominant7" },
|
|
22
|
-
{ interval: "1", quality: "7", noteCollectionKey: "dominant7" },
|
|
23
|
-
{ interval: "5", quality: "7", noteCollectionKey: "dominant7" },
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
};
|
|
28
|
-
export const bluesChordProgressionTemplates = {
|
|
29
|
-
twelveBarBlues,
|
|
30
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ChordProgressionTemplate } from "../../types/chord-progressions";
|
|
2
|
-
export declare const jazzChordProgressionTemplates: {
|
|
3
|
-
readonly twoFiveOneMajor: ChordProgressionTemplate;
|
|
4
|
-
readonly minorTwoFiveOne: ChordProgressionTemplate;
|
|
5
|
-
readonly rhythmChanges: ChordProgressionTemplate;
|
|
6
|
-
readonly jazzBluesBasic: ChordProgressionTemplate;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=jazz.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jazz.d.ts","sourceRoot":"","sources":["../../../../src/src/data/chord-progressions/jazz.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AA+I/E,eAAO,MAAM,6BAA6B;;;;;CAKhC,CAAC"}
|