@musodojo/music-theory-data 31.0.0 → 32.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.
Files changed (116) hide show
  1. package/README.md +87 -287
  2. package/esm/src/data/chord-progressions/mod.d.ts +3 -0
  3. package/esm/src/data/chord-progressions/mod.d.ts.map +1 -1
  4. package/esm/src/data/chord-progressions/mod.js +2 -0
  5. package/esm/src/data/chords/mod.d.ts +12 -0
  6. package/esm/src/data/chords/mod.d.ts.map +1 -1
  7. package/esm/src/data/chords/mod.js +1 -0
  8. package/esm/src/data/chromatic.d.ts +2 -0
  9. package/esm/src/data/chromatic.d.ts.map +1 -1
  10. package/esm/src/data/chromatic.js +2 -0
  11. package/esm/src/data/colors/mod.d.ts +14 -0
  12. package/esm/src/data/colors/mod.d.ts.map +1 -1
  13. package/esm/src/data/colors/mod.js +5 -0
  14. package/esm/src/data/note-collections/augmented-variants.d.ts +1 -0
  15. package/esm/src/data/note-collections/augmented-variants.d.ts.map +1 -1
  16. package/esm/src/data/note-collections/augmented-variants.js +4 -2
  17. package/esm/src/data/note-collections/diminished-variants.d.ts +1 -0
  18. package/esm/src/data/note-collections/diminished-variants.d.ts.map +1 -1
  19. package/esm/src/data/note-collections/diminished-variants.js +1 -0
  20. package/esm/src/data/note-collections/dominant-variants.d.ts +1 -0
  21. package/esm/src/data/note-collections/dominant-variants.d.ts.map +1 -1
  22. package/esm/src/data/note-collections/dominant-variants.js +1 -0
  23. package/esm/src/data/note-collections/major-variants.d.ts +1 -0
  24. package/esm/src/data/note-collections/major-variants.d.ts.map +1 -1
  25. package/esm/src/data/note-collections/major-variants.js +1 -0
  26. package/esm/src/data/note-collections/minor-variants.d.ts +1 -0
  27. package/esm/src/data/note-collections/minor-variants.d.ts.map +1 -1
  28. package/esm/src/data/note-collections/minor-variants.js +1 -0
  29. package/esm/src/data/note-collections/other-collections.d.ts +1 -0
  30. package/esm/src/data/note-collections/other-collections.d.ts.map +1 -1
  31. package/esm/src/data/note-collections/other-collections.js +1 -0
  32. package/esm/src/data/note-collections/pentatonic-variants.d.ts +1 -0
  33. package/esm/src/data/note-collections/pentatonic-variants.d.ts.map +1 -1
  34. package/esm/src/data/note-collections/pentatonic-variants.js +1 -0
  35. package/esm/src/data/tunings/bass-guitar-tunings.d.ts +7 -0
  36. package/esm/src/data/tunings/bass-guitar-tunings.d.ts.map +1 -1
  37. package/esm/src/data/tunings/bass-guitar-tunings.js +3 -0
  38. package/esm/src/data/tunings/folk-fretted-string-tunings.d.ts +7 -0
  39. package/esm/src/data/tunings/folk-fretted-string-tunings.d.ts.map +1 -1
  40. package/esm/src/data/tunings/folk-fretted-string-tunings.js +3 -0
  41. package/esm/src/data/tunings/guitar-tunings.d.ts +8 -0
  42. package/esm/src/data/tunings/guitar-tunings.d.ts.map +1 -1
  43. package/esm/src/data/tunings/guitar-tunings.js +3 -0
  44. package/esm/src/data/tunings/orchestral-string-tunings.d.ts +6 -0
  45. package/esm/src/data/tunings/orchestral-string-tunings.d.ts.map +1 -1
  46. package/esm/src/data/tunings/orchestral-string-tunings.js +2 -0
  47. package/esm/src/data/tunings/string-instrument-groups.d.ts +8 -0
  48. package/esm/src/data/tunings/string-instrument-groups.d.ts.map +1 -1
  49. package/esm/src/data/tunings/string-instrument-groups.js +6 -0
  50. package/esm/src/data/tunings/string-instrument-tunings.d.ts +10 -0
  51. package/esm/src/data/tunings/string-instrument-tunings.d.ts.map +1 -1
  52. package/esm/src/data/tunings/string-instrument-tunings.js +5 -0
  53. package/esm/src/mod.d.ts +0 -47
  54. package/esm/src/mod.d.ts.map +1 -1
  55. package/esm/src/mod.js +0 -47
  56. package/esm/src/utils/chord-progressions.d.ts +7 -0
  57. package/esm/src/utils/chord-progressions.d.ts.map +1 -1
  58. package/esm/src/utils/chord-progressions.js +6 -0
  59. package/package.json +1 -1
  60. package/script/src/data/chord-progressions/mod.d.ts +3 -0
  61. package/script/src/data/chord-progressions/mod.d.ts.map +1 -1
  62. package/script/src/data/chord-progressions/mod.js +2 -0
  63. package/script/src/data/chords/mod.d.ts +12 -0
  64. package/script/src/data/chords/mod.d.ts.map +1 -1
  65. package/script/src/data/chords/mod.js +1 -0
  66. package/script/src/data/chromatic.d.ts +2 -0
  67. package/script/src/data/chromatic.d.ts.map +1 -1
  68. package/script/src/data/chromatic.js +2 -0
  69. package/script/src/data/colors/mod.d.ts +14 -0
  70. package/script/src/data/colors/mod.d.ts.map +1 -1
  71. package/script/src/data/colors/mod.js +5 -0
  72. package/script/src/data/note-collections/augmented-variants.d.ts +1 -0
  73. package/script/src/data/note-collections/augmented-variants.d.ts.map +1 -1
  74. package/script/src/data/note-collections/augmented-variants.js +4 -2
  75. package/script/src/data/note-collections/diminished-variants.d.ts +1 -0
  76. package/script/src/data/note-collections/diminished-variants.d.ts.map +1 -1
  77. package/script/src/data/note-collections/diminished-variants.js +1 -0
  78. package/script/src/data/note-collections/dominant-variants.d.ts +1 -0
  79. package/script/src/data/note-collections/dominant-variants.d.ts.map +1 -1
  80. package/script/src/data/note-collections/dominant-variants.js +1 -0
  81. package/script/src/data/note-collections/major-variants.d.ts +1 -0
  82. package/script/src/data/note-collections/major-variants.d.ts.map +1 -1
  83. package/script/src/data/note-collections/major-variants.js +1 -0
  84. package/script/src/data/note-collections/minor-variants.d.ts +1 -0
  85. package/script/src/data/note-collections/minor-variants.d.ts.map +1 -1
  86. package/script/src/data/note-collections/minor-variants.js +1 -0
  87. package/script/src/data/note-collections/other-collections.d.ts +1 -0
  88. package/script/src/data/note-collections/other-collections.d.ts.map +1 -1
  89. package/script/src/data/note-collections/other-collections.js +1 -0
  90. package/script/src/data/note-collections/pentatonic-variants.d.ts +1 -0
  91. package/script/src/data/note-collections/pentatonic-variants.d.ts.map +1 -1
  92. package/script/src/data/note-collections/pentatonic-variants.js +1 -0
  93. package/script/src/data/tunings/bass-guitar-tunings.d.ts +7 -0
  94. package/script/src/data/tunings/bass-guitar-tunings.d.ts.map +1 -1
  95. package/script/src/data/tunings/bass-guitar-tunings.js +3 -0
  96. package/script/src/data/tunings/folk-fretted-string-tunings.d.ts +7 -0
  97. package/script/src/data/tunings/folk-fretted-string-tunings.d.ts.map +1 -1
  98. package/script/src/data/tunings/folk-fretted-string-tunings.js +3 -0
  99. package/script/src/data/tunings/guitar-tunings.d.ts +8 -0
  100. package/script/src/data/tunings/guitar-tunings.d.ts.map +1 -1
  101. package/script/src/data/tunings/guitar-tunings.js +3 -0
  102. package/script/src/data/tunings/orchestral-string-tunings.d.ts +6 -0
  103. package/script/src/data/tunings/orchestral-string-tunings.d.ts.map +1 -1
  104. package/script/src/data/tunings/orchestral-string-tunings.js +2 -0
  105. package/script/src/data/tunings/string-instrument-groups.d.ts +8 -0
  106. package/script/src/data/tunings/string-instrument-groups.d.ts.map +1 -1
  107. package/script/src/data/tunings/string-instrument-groups.js +6 -0
  108. package/script/src/data/tunings/string-instrument-tunings.d.ts +10 -0
  109. package/script/src/data/tunings/string-instrument-tunings.d.ts.map +1 -1
  110. package/script/src/data/tunings/string-instrument-tunings.js +5 -0
  111. package/script/src/mod.d.ts +0 -47
  112. package/script/src/mod.d.ts.map +1 -1
  113. package/script/src/mod.js +0 -47
  114. package/script/src/utils/chord-progressions.d.ts +7 -0
  115. package/script/src/utils/chord-progressions.d.ts.map +1 -1
  116. package/script/src/utils/chord-progressions.js +6 -0
@@ -105,7 +105,9 @@ const _guitarTunings = {
105
105
  guitarOpenDMinor,
106
106
  guitarJacobCollierTuning,
107
107
  };
108
+ /** Built-in guitar tunings. */
108
109
  exports.guitarTunings = _guitarTunings;
110
+ /** Ordered keys for the built-in guitar tunings. */
109
111
  exports.guitarTuningKeys = Object.keys(_guitarTunings);
110
112
  const standardGuitarTuningGroup = {
111
113
  displayName: "Standard",
@@ -139,4 +141,5 @@ const _guitarTuningGroups = {
139
141
  modal: modalGuitarTuningGroup,
140
142
  open: openGuitarTuningGroup,
141
143
  };
144
+ /** Built-in guitar tuning groups for standard, drop, modal, and open tunings. */
142
145
  exports.guitarTuningGroups = _guitarTuningGroups;
@@ -1,5 +1,6 @@
1
1
  import type { StringInstrumentKey, StringInstrumentTuning } from "../../types/string-instruments";
2
2
  export { orchestralStringsInstrumentGroup } from "./string-instrument-groups.js";
3
+ /** Instrument keys covered by the orchestral string tuning registry. */
3
4
  export type OrchestralStringInstrumentKey = Extract<StringInstrumentKey, "violin" | "viola" | "cello" | "doubleBass">;
4
5
  declare const _orchestralStringTunings: {
5
6
  readonly violinStandardGdae: StringInstrumentTuning;
@@ -7,9 +8,14 @@ declare const _orchestralStringTunings: {
7
8
  readonly celloStandardCgda: StringInstrumentTuning;
8
9
  readonly doubleBassStandardEadg: StringInstrumentTuning;
9
10
  };
11
+ /** A key for one of the built-in orchestral string tunings. */
10
12
  export type OrchestralStringTuningKey = keyof typeof _orchestralStringTunings;
13
+ /** Dictionary of built-in orchestral string tunings keyed by tuning id. */
11
14
  export type OrchestralStringTunings = Record<OrchestralStringTuningKey, StringInstrumentTuning>;
15
+ /** Built-in violin, viola, cello, and double bass tunings. */
12
16
  export declare const orchestralStringTunings: OrchestralStringTunings;
17
+ /** Orchestral string tuning keys grouped by instrument. */
13
18
  export type OrchestralStringTuningKeysByInstrument = Readonly<Record<OrchestralStringInstrumentKey, readonly OrchestralStringTuningKey[]>>;
19
+ /** Built-in orchestral string tuning keys grouped by instrument. */
14
20
  export declare const orchestralStringTuningKeysByInstrument: OrchestralStringTuningKeysByInstrument;
15
21
  //# sourceMappingURL=orchestral-string-tunings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"orchestral-string-tunings.d.ts","sourceRoot":"","sources":["../../../../src/src/data/tunings/orchestral-string-tunings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AAEjF,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,mBAAmB,EACnB,QAAQ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AAO,MAAM,sCAAsC,EACjD,sCAKC,CAAC"}
@@ -37,7 +37,9 @@ const _orchestralStringTunings = {
37
37
  celloStandardCgda,
38
38
  doubleBassStandardEadg,
39
39
  };
40
+ /** Built-in violin, viola, cello, and double bass tunings. */
40
41
  exports.orchestralStringTunings = _orchestralStringTunings;
42
+ /** Built-in orchestral string tuning keys grouped by instrument. */
41
43
  exports.orchestralStringTuningKeysByInstrument = {
42
44
  violin: ["violinStandardGdae"],
43
45
  viola: ["violaStandardCgda"],
@@ -1,7 +1,11 @@
1
1
  import type { StringInstrumentGroup } from "../../types/string-instruments";
2
+ /** Curated group for guitar tunings and fretboard use cases. */
2
3
  export declare const guitarInstrumentGroup: StringInstrumentGroup;
4
+ /** Curated group for bass guitar tunings and fretboard use cases. */
3
5
  export declare const bassInstrumentGroup: StringInstrumentGroup;
6
+ /** Curated group for mandolin, ukulele, and similar fretted strings. */
4
7
  export declare const folkAndFrettedStringsInstrumentGroup: StringInstrumentGroup;
8
+ /** Curated group for violin, viola, cello, and double bass. */
5
9
  export declare const orchestralStringsInstrumentGroup: StringInstrumentGroup;
6
10
  declare const _stringInstrumentGroups: {
7
11
  readonly guitar: StringInstrumentGroup;
@@ -9,9 +13,13 @@ declare const _stringInstrumentGroups: {
9
13
  readonly folkAndFrettedStrings: StringInstrumentGroup;
10
14
  readonly orchestralStrings: StringInstrumentGroup;
11
15
  };
16
+ /** A key for one of the built-in string instrument groups. */
12
17
  export type StringInstrumentGroupKey = keyof typeof _stringInstrumentGroups;
18
+ /** Dictionary of built-in string instrument groups keyed by group id. */
13
19
  export type StringInstrumentGroups = Record<StringInstrumentGroupKey, StringInstrumentGroup>;
20
+ /** Built-in string instrument groups for navigation and filtering. */
14
21
  export declare const stringInstrumentGroups: StringInstrumentGroups;
22
+ /** Ordered keys for the built-in string instrument groups. */
15
23
  export declare const stringInstrumentGroupKeys: readonly StringInstrumentGroupKey[];
16
24
  export {};
17
25
  //# sourceMappingURL=string-instrument-groups.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"string-instrument-groups.d.ts","sourceRoot":"","sources":["../../../../src/src/data/tunings/string-instrument-groups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,eAAO,MAAM,qBAAqB,EAAE,qBAK1B,CAAC;AAEX,eAAO,MAAM,mBAAmB,EAAE,qBAKxB,CAAC;AAEX,eAAO,MAAM,oCAAoC,EAAE,qBAKzC,CAAC;AAEX,eAAO,MAAM,gCAAgC,EAAE,qBAKrC,CAAC;AAEX,QAAA,MAAM,uBAAuB;;;;;CAKnB,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AAE5E,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACzC,wBAAwB,EACxB,qBAAqB,CACtB,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,sBACZ,CAAC;AAE1B,eAAO,MAAM,yBAAyB,EAAE,SAAS,wBAAwB,EACI,CAAC"}
1
+ {"version":3,"file":"string-instrument-groups.d.ts","sourceRoot":"","sources":["../../../../src/src/data/tunings/string-instrument-groups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,EAAE,qBAK1B,CAAC;AAEX,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,EAAE,qBAKxB,CAAC;AAEX,wEAAwE;AACxE,eAAO,MAAM,oCAAoC,EAAE,qBAKzC,CAAC;AAEX,+DAA+D;AAC/D,eAAO,MAAM,gCAAgC,EAAE,qBAKrC,CAAC;AAEX,QAAA,MAAM,uBAAuB;;;;;CAKnB,CAAC;AAEX,8DAA8D;AAC9D,MAAM,MAAM,wBAAwB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AAE5E,yEAAyE;AACzE,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACzC,wBAAwB,EACxB,qBAAqB,CACtB,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,EAAE,sBACZ,CAAC;AAE1B,8DAA8D;AAC9D,eAAO,MAAM,yBAAyB,EAAE,SAAS,wBAAwB,EACI,CAAC"}
@@ -1,21 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stringInstrumentGroupKeys = exports.stringInstrumentGroups = exports.orchestralStringsInstrumentGroup = exports.folkAndFrettedStringsInstrumentGroup = exports.bassInstrumentGroup = exports.guitarInstrumentGroup = void 0;
4
+ /** Curated group for guitar tunings and fretboard use cases. */
4
5
  exports.guitarInstrumentGroup = {
5
6
  displayName: "Guitar",
6
7
  description: "Guitar fretboards with common standard, alternate, and open tunings.",
7
8
  instrumentKeys: ["guitar"],
8
9
  };
10
+ /** Curated group for bass guitar tunings and fretboard use cases. */
9
11
  exports.bassInstrumentGroup = {
10
12
  displayName: "Bass",
11
13
  description: "Bass guitar fretboards with common standard and extended-range tunings.",
12
14
  instrumentKeys: ["bassGuitar"],
13
15
  };
16
+ /** Curated group for mandolin, ukulele, and similar fretted strings. */
14
17
  exports.folkAndFrettedStringsInstrumentGroup = {
15
18
  displayName: "Folk & Fretted Strings",
16
19
  description: "Mandolin, ukulele, and related fretted string instruments often used in folk, traditional, and popular styles.",
17
20
  instrumentKeys: ["mandolin", "ukulele"],
18
21
  };
22
+ /** Curated group for violin, viola, cello, and double bass. */
19
23
  exports.orchestralStringsInstrumentGroup = {
20
24
  displayName: "Orchestral Strings",
21
25
  description: "Violin, viola, cello, and double bass as the standard bowed string section of the orchestra.",
@@ -27,5 +31,7 @@ const _stringInstrumentGroups = {
27
31
  folkAndFrettedStrings: exports.folkAndFrettedStringsInstrumentGroup,
28
32
  orchestralStrings: exports.orchestralStringsInstrumentGroup,
29
33
  };
34
+ /** Built-in string instrument groups for navigation and filtering. */
30
35
  exports.stringInstrumentGroups = _stringInstrumentGroups;
36
+ /** Ordered keys for the built-in string instrument groups. */
31
37
  exports.stringInstrumentGroupKeys = Object.keys(_stringInstrumentGroups);
@@ -21,10 +21,15 @@ declare const _stringInstrumentTunings: {
21
21
  readonly guitarOpenDMinor: StringInstrumentTuning;
22
22
  readonly guitarJacobCollierTuning: StringInstrumentTuning;
23
23
  };
24
+ /** A key for one of the built-in string instrument tunings. */
24
25
  export type StringInstrumentTuningKey = keyof typeof _stringInstrumentTunings;
26
+ /** Dictionary of all built-in string instrument tunings keyed by tuning id. */
25
27
  export type StringInstrumentTunings = Record<StringInstrumentTuningKey, StringInstrumentTuning>;
28
+ /** All built-in string instrument tunings from every supported instrument family. */
26
29
  export declare const stringInstrumentTunings: StringInstrumentTunings;
30
+ /** Ordered keys for all built-in string instrument tunings. */
27
31
  export declare const stringInstrumentTuningKeys: readonly StringInstrumentTuningKey[];
32
+ /** Metadata for a supported string instrument. */
28
33
  export interface StringInstrument {
29
34
  /** The canonical instrument label to show in app UI. */
30
35
  primaryName: string;
@@ -35,10 +40,15 @@ export interface StringInstrument {
35
40
  /** The tuning key to select when an app needs an initial/default tuning. */
36
41
  defaultTuning: StringInstrumentTuningKey;
37
42
  }
43
+ /** Dictionary of supported string instruments keyed by instrument id. */
38
44
  export type StringInstruments = Readonly<Record<StringInstrumentKey, StringInstrument>>;
45
+ /** Metadata for all supported string instruments. */
39
46
  export declare const stringInstruments: StringInstruments;
47
+ /** Ordered keys for all supported string instruments. */
40
48
  export declare const stringInstrumentKeys: readonly StringInstrumentKey[];
49
+ /** Tuning keys grouped by supported string instrument. */
41
50
  export type StringInstrumentTuningKeysByInstrument = Readonly<Record<StringInstrumentKey, readonly StringInstrumentTuningKey[]>>;
51
+ /** Built-in tuning keys grouped by supported string instrument. */
42
52
  export declare const stringInstrumentTuningKeysByInstrument: StringInstrumentTuningKeysByInstrument;
43
53
  export {};
44
54
  //# sourceMappingURL=string-instrument-tunings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"string-instrument-tunings.d.ts","sourceRoot":"","sources":["../../../../src/src/data/tunings/string-instrument-tunings.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;AAExC,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;CAKpB,CAAC;AAEX,MAAM,MAAM,yBAAyB,GAAG,MAAM,OAAO,wBAAwB,CAAC;AAE9E,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,yBAAyB,EACzB,sBAAsB,CACvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,uBACZ,CAAC;AAE3B,eAAO,MAAM,0BAA0B,EAAE,SAAS,yBAAyB,EAGhC,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,2DAA2D;IAC3D,MAAM,EAAE,sBAAsB,CAAC;IAC/B,4EAA4E;IAC5E,aAAa,EAAE,yBAAyB,CAAC;CAC1C;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CACtC,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAC9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,iBA4C/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,SAAS,mBAAmB,EAE5B,CAAC;AAEpC,MAAM,MAAM,sCAAsC,GAAG,QAAQ,CAC3D,MAAM,CAAC,mBAAmB,EAAE,SAAS,yBAAyB,EAAE,CAAC,CAClE,CAAC;AAEF,eAAO,MAAM,sCAAsC,EACjD,sCAKC,CAAC"}
1
+ {"version":3,"file":"string-instrument-tunings.d.ts","sourceRoot":"","sources":["../../../../src/src/data/tunings/string-instrument-tunings.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;AAExC,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;CAKpB,CAAC;AAEX,+DAA+D;AAC/D,MAAM,MAAM,yBAAyB,GAAG,MAAM,OAAO,wBAAwB,CAAC;AAE9E,+EAA+E;AAC/E,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,yBAAyB,EACzB,sBAAsB,CACvB,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,uBAAuB,EAAE,uBACZ,CAAC;AAE3B,+DAA+D;AAC/D,eAAO,MAAM,0BAA0B,EAAE,SAAS,yBAAyB,EAGhC,CAAC;AAE5C,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,2DAA2D;IAC3D,MAAM,EAAE,sBAAsB,CAAC;IAC/B,4EAA4E;IAC5E,aAAa,EAAE,yBAAyB,CAAC;CAC1C;AAED,yEAAyE;AACzE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CACtC,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAC9C,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,EAAE,iBA4C/B,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,oBAAoB,EAAE,SAAS,mBAAmB,EAE5B,CAAC;AAEpC,0DAA0D;AAC1D,MAAM,MAAM,sCAAsC,GAAG,QAAQ,CAC3D,MAAM,CAAC,mBAAmB,EAAE,SAAS,yBAAyB,EAAE,CAAC,CAClE,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,sCAAsC,EACjD,sCAKC,CAAC"}
@@ -11,8 +11,11 @@ const _stringInstrumentTunings = {
11
11
  ...folk_fretted_string_tunings_js_1.folkFrettedStringTunings,
12
12
  ...orchestral_string_tunings_js_1.orchestralStringTunings,
13
13
  };
14
+ /** All built-in string instrument tunings from every supported instrument family. */
14
15
  exports.stringInstrumentTunings = _stringInstrumentTunings;
16
+ /** Ordered keys for all built-in string instrument tunings. */
15
17
  exports.stringInstrumentTuningKeys = Object.keys(_stringInstrumentTunings);
18
+ /** Metadata for all supported string instruments. */
16
19
  exports.stringInstruments = {
17
20
  guitar: {
18
21
  primaryName: "Guitar",
@@ -58,7 +61,9 @@ exports.stringInstruments = {
58
61
  defaultTuning: "doubleBassStandardEadg",
59
62
  },
60
63
  };
64
+ /** Ordered keys for all supported string instruments. */
61
65
  exports.stringInstrumentKeys = Object.keys(exports.stringInstruments);
66
+ /** Built-in tuning keys grouped by supported string instrument. */
62
67
  exports.stringInstrumentTuningKeysByInstrument = {
63
68
  guitar: guitar_tunings_js_1.guitarTuningKeys,
64
69
  ...bass_guitar_tunings_js_1.bassGuitarTuningKeysByInstrument,
@@ -1,50 +1,3 @@
1
- /**
2
- * A comprehensive library of music theory data, including notes, dyads, scales, chord pitch collections, and chord progressions.
3
- *
4
- * This package provides a collection of datasets and utility functions
5
- * to work with fundamental concepts of music theory. It's designed to be
6
- * a foundational block for music-related applications, educational tools,
7
- * and creative coding projects.
8
- *
9
- * @module
10
- * @example
11
- * ```ts
12
- * import * as music_theory_data from "jsr:@musodojo/music-theory-data";
13
- *
14
- * // Get the notes of A Harmonic Minor
15
- * const notes1 = music_theory_data.getNoteNamesForRootAndNoteCollectionKey(
16
- * "A",
17
- * "harmonicMinor",
18
- * );
19
- * console.log(notes1);
20
- * // ["A", "B", "C", "D", "E", "F", "G♯", "A"]
21
- *
22
- * // Automatically knows whether to use flats or sharps
23
- * const notes2 = music_theory_data.getNoteNamesForRootAndNoteCollectionKey(
24
- * "F",
25
- * "ionian",
26
- * );
27
- * console.log(notes2);
28
- * // ["F", "G", "A", "B♭", "C", "D", "E", "F"];
29
- *
30
- * // Get the full data structure for the Ionian mode (Major Scale)
31
- * const ionian = music_theory_data.noteCollections.ionian;
32
- *
33
- * console.log(ionian.primaryName);
34
- * // "Major"
35
- *
36
- * console.log(ionian.intervals);
37
- * // ["1", "2", "3", "4", "5", "6", "7", "8"]
38
- *
39
- * // Log an array of all available Note Collection Keys
40
- * console.log(Object.keys(music_theory_data.noteCollections));
41
- * // ["ionian", "dorian", "phrygian", ...]
42
- *
43
- * // Log an array of all available Grouped Note Collections Keys
44
- * console.log(Object.keys(music_theory_data.groupedNoteCollections));
45
- * // ["diatonicModes", "pentatonicVariants", ...]
46
- * ```
47
- */
48
1
  export * from "./data/mod.js";
49
2
  export type * from "./types/mod";
50
3
  export * from "./utils/mod.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,cAAc,eAAe,CAAC;AAC9B,mBAAmB,aAAa,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,mBAAmB,aAAa,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
package/script/src/mod.js CHANGED
@@ -14,52 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- /**
18
- * A comprehensive library of music theory data, including notes, dyads, scales, chord pitch collections, and chord progressions.
19
- *
20
- * This package provides a collection of datasets and utility functions
21
- * to work with fundamental concepts of music theory. It's designed to be
22
- * a foundational block for music-related applications, educational tools,
23
- * and creative coding projects.
24
- *
25
- * @module
26
- * @example
27
- * ```ts
28
- * import * as music_theory_data from "jsr:@musodojo/music-theory-data";
29
- *
30
- * // Get the notes of A Harmonic Minor
31
- * const notes1 = music_theory_data.getNoteNamesForRootAndNoteCollectionKey(
32
- * "A",
33
- * "harmonicMinor",
34
- * );
35
- * console.log(notes1);
36
- * // ["A", "B", "C", "D", "E", "F", "G♯", "A"]
37
- *
38
- * // Automatically knows whether to use flats or sharps
39
- * const notes2 = music_theory_data.getNoteNamesForRootAndNoteCollectionKey(
40
- * "F",
41
- * "ionian",
42
- * );
43
- * console.log(notes2);
44
- * // ["F", "G", "A", "B♭", "C", "D", "E", "F"];
45
- *
46
- * // Get the full data structure for the Ionian mode (Major Scale)
47
- * const ionian = music_theory_data.noteCollections.ionian;
48
- *
49
- * console.log(ionian.primaryName);
50
- * // "Major"
51
- *
52
- * console.log(ionian.intervals);
53
- * // ["1", "2", "3", "4", "5", "6", "7", "8"]
54
- *
55
- * // Log an array of all available Note Collection Keys
56
- * console.log(Object.keys(music_theory_data.noteCollections));
57
- * // ["ionian", "dorian", "phrygian", ...]
58
- *
59
- * // Log an array of all available Grouped Note Collections Keys
60
- * console.log(Object.keys(music_theory_data.groupedNoteCollections));
61
- * // ["diatonicModes", "pentatonicVariants", ...]
62
- * ```
63
- */
64
17
  __exportStar(require("./data/mod.js"), exports);
65
18
  __exportStar(require("./utils/mod.js"), exports);
@@ -2,15 +2,21 @@ import { type ChordProgressionKey } from "../data/chord-progressions/mod.js";
2
2
  import type { ChordProgression } from "../types/chord-progressions";
3
3
  import type { RootNote } from "../data/labels/note-labels.js";
4
4
  import type { NoteCollectionKey } from "../data/note-collections/mod.js";
5
+ /** A resolved chord in a progression, including its root and note-collection key. */
5
6
  export interface ChordProgressionChordReference {
6
7
  readonly rootNote: RootNote;
7
8
  readonly chordName: string;
8
9
  readonly noteCollectionKey: NoteCollectionKey;
9
10
  }
11
+ /** Returns whether a string is one of the built-in chord progression keys. */
10
12
  export declare function isValidChordProgressionKey(key: string): key is ChordProgressionKey;
13
+ /** Returns the spelled chord names for a progression in the requested root. */
11
14
  export declare function getChordProgressionChordNames(rootNote: RootNote, progressionOrKey: ChordProgression | ChordProgressionKey): string[];
15
+ /** Returns the roman symbols authored for a chord progression. */
12
16
  export declare function getChordProgressionRomanSymbols(progressionOrKey: ChordProgression | ChordProgressionKey): string[];
17
+ /** Returns all built-in chord progression keys with the requested total bar count. */
13
18
  export declare function getChordProgressionKeysForTotalBars(totalBars: number): ChordProgressionKey[];
19
+ /** Returns each distinct chord name in a progression, preserving first-seen order. */
14
20
  export declare function getChordProgressionUniqueChordNames(rootNote: RootNote, progressionOrKey: ChordProgression | ChordProgressionKey): string[];
15
21
  /**
16
22
  * Returns one chord reference for each authored chord entry in
@@ -39,5 +45,6 @@ export declare function getChordProgressionChordReferencesByBar(rootNote: RootNo
39
45
  * appears twice and split bars preserve their left-to-right order.
40
46
  */
41
47
  export declare function getChordProgressionSongChordReferences(rootNote: RootNote, progressionOrKey: ChordProgression | ChordProgressionKey): ChordProgressionChordReference[];
48
+ /** Returns the sum of authored chord durations in bars for a progression. */
42
49
  export declare function getChordProgressionTotalDurationInBars(progressionOrKey: ChordProgression | ChordProgressionKey): number;
43
50
  //# 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,EAEL,KAAK,mBAAmB,EAEzB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,6BAA6B,CAAC;AACrC,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;AASD,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,GACV,GAAG,IAAI,mBAAmB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,GAAG,mBAAmB,GACvD,8BAA8B,EAAE,EAAE,CAiDpC;AAED;;;;;GAKG;AACH,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,GACvD,8BAA8B,EAAE,CAKlC;AAED,6EAA6E;AAC7E,wBAAgB,sCAAsC,CACpD,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,GACvD,MAAM,CAQR"}
@@ -14,6 +14,7 @@ const mod_js_1 = require("../data/chord-progressions/mod.js");
14
14
  const mod_js_2 = require("../data/chords/mod.js");
15
15
  const note_names_js_1 = require("./note-names.js");
16
16
  const BAR_DURATION_EPSILON = 0.000000001;
17
+ /** Returns whether a string is one of the built-in chord progression keys. */
17
18
  function isValidChordProgressionKey(key) {
18
19
  return Object.prototype.hasOwnProperty.call(mod_js_1.chordProgressions, key);
19
20
  }
@@ -44,6 +45,7 @@ function getResolvedChordProgressionChordReferences(rootNote, progressionOrKey)
44
45
  }];
45
46
  });
46
47
  }
48
+ /** Returns the spelled chord names for a progression in the requested root. */
47
49
  function getChordProgressionChordNames(rootNote, progressionOrKey) {
48
50
  const progression = resolveProgression(progressionOrKey);
49
51
  if (!progression)
@@ -51,16 +53,19 @@ function getChordProgressionChordNames(rootNote, progressionOrKey) {
51
53
  const noteNames = (0, note_names_js_1.getNoteNamesForRootAndIntervals)(rootNote, progression.chords.map((chord) => chord.degree));
52
54
  return progression.chords.map((chord, index) => noteNames[index] + chord.quality);
53
55
  }
56
+ /** Returns the roman symbols authored for a chord progression. */
54
57
  function getChordProgressionRomanSymbols(progressionOrKey) {
55
58
  const progression = resolveProgression(progressionOrKey);
56
59
  if (!progression)
57
60
  return [];
58
61
  return progression.chords.map((chord) => chord.romanSymbol);
59
62
  }
63
+ /** Returns all built-in chord progression keys with the requested total bar count. */
60
64
  function getChordProgressionKeysForTotalBars(totalBars) {
61
65
  return mod_js_1.chordProgressionBarGroups.find((group) => group.totalBars === totalBars)
62
66
  ?.progressionKeys.slice() ?? [];
63
67
  }
68
+ /** Returns each distinct chord name in a progression, preserving first-seen order. */
64
69
  function getChordProgressionUniqueChordNames(rootNote, progressionOrKey) {
65
70
  return Array.from(new Set(getChordProgressionChordNames(rootNote, progressionOrKey)));
66
71
  }
@@ -135,6 +140,7 @@ function getChordProgressionChordReferencesByBar(rootNote, progressionOrKey) {
135
140
  function getChordProgressionSongChordReferences(rootNote, progressionOrKey) {
136
141
  return getChordProgressionChordReferencesByBar(rootNote, progressionOrKey).flat();
137
142
  }
143
+ /** Returns the sum of authored chord durations in bars for a progression. */
138
144
  function getChordProgressionTotalDurationInBars(progressionOrKey) {
139
145
  const progression = resolveProgression(progressionOrKey);
140
146
  if (!progression)