@libraz/libcantus 0.9.1 → 0.9.2

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 (154) hide show
  1. package/README.md +15 -0
  2. package/dist/analyze/index.cjs +1697 -0
  3. package/dist/analyze/index.cjs.map +1 -0
  4. package/dist/analyze/index.d.cts +429 -0
  5. package/dist/analyze/index.d.ts +429 -0
  6. package/dist/analyze/index.js +51 -0
  7. package/dist/analyze/index.js.map +1 -0
  8. package/dist/chunk-5HTNMQW4.js +653 -0
  9. package/dist/chunk-5HTNMQW4.js.map +1 -0
  10. package/dist/chunk-7Y7WF64D.js +410 -0
  11. package/dist/chunk-7Y7WF64D.js.map +1 -0
  12. package/dist/chunk-A4532ZFR.js +259 -0
  13. package/dist/chunk-A4532ZFR.js.map +1 -0
  14. package/dist/chunk-BHUT2S5G.js +22 -0
  15. package/dist/chunk-BHUT2S5G.js.map +1 -0
  16. package/dist/chunk-CCBLVAPK.js +42 -0
  17. package/dist/chunk-CCBLVAPK.js.map +1 -0
  18. package/dist/chunk-COKTX2G5.js +907 -0
  19. package/dist/chunk-COKTX2G5.js.map +1 -0
  20. package/dist/chunk-DYWFNC4A.js +152 -0
  21. package/dist/chunk-DYWFNC4A.js.map +1 -0
  22. package/dist/chunk-GQKN5KDT.js +159 -0
  23. package/dist/chunk-GQKN5KDT.js.map +1 -0
  24. package/dist/chunk-LN7ZZMD2.js +530 -0
  25. package/dist/chunk-LN7ZZMD2.js.map +1 -0
  26. package/dist/chunk-MSWFZF7J.js +118 -0
  27. package/dist/chunk-MSWFZF7J.js.map +1 -0
  28. package/dist/chunk-R3S2LUBH.js +2722 -0
  29. package/dist/chunk-R3S2LUBH.js.map +1 -0
  30. package/dist/chunk-SDM3VJJ5.js +41 -0
  31. package/dist/chunk-SDM3VJJ5.js.map +1 -0
  32. package/dist/chunk-XTC3X6MS.js +816 -0
  33. package/dist/chunk-XTC3X6MS.js.map +1 -0
  34. package/dist/chunk-ZXW5YIWK.js +55 -0
  35. package/dist/chunk-ZXW5YIWK.js.map +1 -0
  36. package/dist/core/index.cjs +432 -0
  37. package/dist/core/index.cjs.map +1 -0
  38. package/dist/core/index.d.cts +210 -0
  39. package/dist/core/index.d.ts +210 -0
  40. package/dist/core/index.js +73 -0
  41. package/dist/core/index.js.map +1 -0
  42. package/dist/function-2bJW1Zp_.d.ts +187 -0
  43. package/dist/function-r2sh-jOO.d.cts +187 -0
  44. package/dist/generate/index.cjs +3787 -0
  45. package/dist/generate/index.cjs.map +1 -0
  46. package/dist/generate/index.d.cts +980 -0
  47. package/dist/generate/index.d.ts +980 -0
  48. package/dist/generate/index.js +52 -0
  49. package/dist/generate/index.js.map +1 -0
  50. package/dist/index-BMPxwjwV.d.ts +151 -0
  51. package/dist/index-BOBXBNwP.d.cts +157 -0
  52. package/dist/index-BdeQ1r_p.d.cts +56 -0
  53. package/dist/index-BreoJRw0.d.ts +127 -0
  54. package/dist/index-CGMZNCx6.d.cts +140 -0
  55. package/dist/index-CGMZNCx6.d.ts +140 -0
  56. package/dist/index-CM5W4rcm.d.ts +157 -0
  57. package/dist/index-CP3wAfEH.d.ts +56 -0
  58. package/dist/index-Cl7mhOFM.d.cts +164 -0
  59. package/dist/index-Cl7mhOFM.d.ts +164 -0
  60. package/dist/index-DZ1M21do.d.cts +127 -0
  61. package/dist/index-D_ZTUNKp.d.cts +151 -0
  62. package/dist/index.cjs +3016 -2984
  63. package/dist/index.cjs.map +1 -1
  64. package/dist/index.d.cts +14 -3982
  65. package/dist/index.d.ts +14 -3982
  66. package/dist/index.js +170 -6504
  67. package/dist/index.js.map +1 -1
  68. package/dist/model/index.cjs +2435 -0
  69. package/dist/model/index.cjs.map +1 -0
  70. package/dist/model/index.d.cts +630 -0
  71. package/dist/model/index.d.ts +630 -0
  72. package/dist/model/index.js +21 -0
  73. package/dist/model/index.js.map +1 -0
  74. package/dist/styled-BjXtOFNk.d.cts +282 -0
  75. package/dist/styled-D7BAx3S3.d.ts +282 -0
  76. package/dist/theory/index.cjs +1677 -0
  77. package/dist/theory/index.cjs.map +1 -0
  78. package/dist/theory/index.d.cts +535 -0
  79. package/dist/theory/index.d.ts +535 -0
  80. package/dist/theory/index.js +149 -0
  81. package/dist/theory/index.js.map +1 -0
  82. package/dist/types-MGP29r3t.d.cts +30 -0
  83. package/dist/types-MGP29r3t.d.ts +30 -0
  84. package/package.json +27 -2
  85. package/src/analyze/arrange/index.ts +21 -0
  86. package/src/analyze/arrange/internal.ts +125 -0
  87. package/src/analyze/arrange/tension.ts +187 -0
  88. package/src/analyze/arrange/tracks.ts +279 -0
  89. package/src/{detect → analyze/detect}/index.ts +4 -4
  90. package/src/analyze/functional/borrowed.ts +84 -0
  91. package/src/analyze/functional/cadence.ts +66 -0
  92. package/src/analyze/functional/function.ts +184 -0
  93. package/src/analyze/functional/index.ts +23 -0
  94. package/src/analyze/functional/internal.ts +29 -0
  95. package/src/{functional/index.ts → analyze/functional/roman.ts} +9 -327
  96. package/src/analyze/index.ts +49 -0
  97. package/src/{timeline → analyze/timeline}/index.ts +7 -11
  98. package/src/{analysis → analyze/voice}/index.ts +8 -5
  99. package/src/core/index.ts +47 -0
  100. package/src/{bass → generate/bass}/index.ts +5 -5
  101. package/src/{countermelody → generate/countermelody}/index.ts +11 -11
  102. package/src/{drums → generate/drums}/index.ts +2 -2
  103. package/src/{drums → generate/drums}/rng.ts +2 -2
  104. package/src/{groove → generate/groove}/index.ts +3 -3
  105. package/src/{harmonize → generate/harmonize}/index.ts +13 -13
  106. package/src/generate/index.ts +59 -0
  107. package/src/{motif → generate/motif}/index.ts +7 -7
  108. package/src/{progression → generate/progression}/index.ts +11 -25
  109. package/src/{reharmony → generate/reharmony}/index.ts +11 -11
  110. package/src/{rhythm → generate/rhythm}/index.ts +2 -2
  111. package/src/index.ts +130 -117
  112. package/src/model/chord.ts +423 -0
  113. package/src/model/index.ts +5 -1096
  114. package/src/model/interval.ts +82 -0
  115. package/src/model/key.ts +266 -0
  116. package/src/model/note.ts +176 -0
  117. package/src/model/progression.ts +161 -0
  118. package/src/model/shared.ts +12 -0
  119. package/src/{chord → theory/chord}/index.ts +19 -1
  120. package/src/{counterpoint → theory/counterpoint}/index.ts +2 -2
  121. package/src/theory/index.ts +107 -0
  122. package/src/{safety → theory/safety}/index.ts +1 -1
  123. package/src/theory/scale/degrees.ts +123 -0
  124. package/src/theory/scale/index.ts +28 -0
  125. package/src/theory/scale/key.ts +56 -0
  126. package/src/theory/scale/masks.ts +153 -0
  127. package/src/{spelling → theory/spelling}/index.ts +3 -3
  128. package/src/{symbol → theory/symbol}/index.ts +8 -1
  129. package/src/theory/voicing/index.ts +5 -0
  130. package/src/theory/voicing/internal.ts +168 -0
  131. package/src/theory/voicing/leading.ts +112 -0
  132. package/src/theory/voicing/satb.ts +195 -0
  133. package/src/theory/voicing/styled.ts +176 -0
  134. package/src/arrange/index.ts +0 -571
  135. package/src/scale/index.ts +0 -331
  136. package/src/voicing/index.ts +0 -623
  137. /package/src/{interval → core/interval}/index.ts +0 -0
  138. /package/src/{meter → core/meter}/index.ts +0 -0
  139. /package/src/{pitch → core/pitch}/index.ts +0 -0
  140. /package/src/{random → core/random}/index.ts +0 -0
  141. /package/src/{tuning → core/tuning}/index.ts +0 -0
  142. /package/src/{types.ts → core/types.ts} +0 -0
  143. /package/src/{drums → generate/drums}/beat.ts +0 -0
  144. /package/src/{drums → generate/drums}/euclid.ts +0 -0
  145. /package/src/{drums → generate/drums}/fills.ts +0 -0
  146. /package/src/{drums → generate/drums}/ghost.ts +0 -0
  147. /package/src/{drums → generate/drums}/hihat.ts +0 -0
  148. /package/src/{drums → generate/drums}/hit.ts +0 -0
  149. /package/src/{drums → generate/drums}/internal.ts +0 -0
  150. /package/src/{drums → generate/drums}/kick.ts +0 -0
  151. /package/src/{drums → generate/drums}/percussion.ts +0 -0
  152. /package/src/{drums → generate/drums}/swing.ts +0 -0
  153. /package/src/{chordscale → theory/chordscale}/index.ts +0 -0
  154. /package/src/{harmony → theory/harmony}/index.ts +0 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Public API of the generate layer. Re-exports every generate-layer module;
3
+ * also available from the package root.
4
+ */
5
+ export type { BassLineOptions, BassSegment, BassStyle } from './bass/index.js';
6
+ export { generateBassLine } from './bass/index.js';
7
+ export type { CounterMelodyOptions } from './countermelody/index.js';
8
+ export { generateCounterMelody } from './countermelody/index.js';
9
+ export type {
10
+ DrumHit,
11
+ DrumRole,
12
+ DrumsOptions,
13
+ EuclideanKick,
14
+ GrooveFeel,
15
+ GrooveStyle,
16
+ Section,
17
+ } from './drums/index.js';
18
+ export { generateDrums } from './drums/index.js';
19
+ export type { GrooveSlot, GrooveTemplate, HumanizeOptions } from './groove/index.js';
20
+ export { applyGrooveTemplate, extractGrooveTemplate, humanize } from './groove/index.js';
21
+ export type {
22
+ HarmonizeOptions,
23
+ HarmonizeResult,
24
+ MelodyNote,
25
+ } from './harmonize/index.js';
26
+ export { harmonizeMelody } from './harmonize/index.js';
27
+ export type {
28
+ MotifCell,
29
+ MotifContour,
30
+ MotifNote,
31
+ MotifOptions,
32
+ MotifTransform,
33
+ } from './motif/index.js';
34
+ export { developMotif, generateMotif, transformMotif } from './motif/index.js';
35
+ export type {
36
+ ChordSpan,
37
+ ProgFunction,
38
+ ProgressionOptions,
39
+ ProgressionPreset,
40
+ ProgStyle,
41
+ } from './progression/index.js';
42
+ export {
43
+ generateProgression,
44
+ progressions,
45
+ progressionsByStyle,
46
+ } from './progression/index.js';
47
+ export type {
48
+ BorrowedChord,
49
+ SubstituteOptions,
50
+ Substitution,
51
+ SubstitutionType,
52
+ } from './reharmony/index.js';
53
+ export {
54
+ modalInterchangePalette,
55
+ negativeHarmonyMirror,
56
+ substituteChord,
57
+ } from './reharmony/index.js';
58
+ export type { RhythmEvent, RhythmOptions } from './rhythm/index.js';
59
+ export { generateRhythm, onsetWeightCurve, rhythmDensity } from './rhythm/index.js';
@@ -1,8 +1,8 @@
1
- import type { Chord } from '../chord/index.js';
2
- import { chordPitchClasses } from '../chord/index.js';
3
- import { isScaleTone, nearestScaleTone } from '../scale/index.js';
4
- import type { ChordTimeline } from '../timeline/index.js';
5
- import type { KeyScale } from '../types.js';
1
+ import type { ChordTimeline } from '../../analyze/timeline/index.js';
2
+ import type { KeyScale } from '../../core/types.js';
3
+ import type { Chord } from '../../theory/chord/index.js';
4
+ import { chordPitchClasses } from '../../theory/chord/index.js';
5
+ import { isScaleTone, nearestScaleTone } from '../../theory/scale/index.js';
6
6
 
7
7
  /**
8
8
  * A transformation applicable to a motif cell.
@@ -50,7 +50,7 @@ export type MotifContour = 'arch' | 'ascending' | 'descending' | 'wave';
50
50
  *
51
51
  * @category Composition
52
52
  */
53
- export type GenerateMotifOptions = {
53
+ export type MotifOptions = {
54
54
  key: KeyScale;
55
55
  chord?: Chord | null;
56
56
  bars: number;
@@ -207,7 +207,7 @@ function contourOffsets(contour: MotifContour, count: number): number[] {
207
207
  *
208
208
  * @category Composition
209
209
  */
210
- export function generateMotif(opts: GenerateMotifOptions): MotifCell {
210
+ export function generateMotif(opts: MotifOptions): MotifCell {
211
211
  const contour = opts.contour ?? 'arch';
212
212
  const bars = Math.max(1, Math.trunc(opts.bars));
213
213
  const totalBeats = bars * 4;
@@ -1,7 +1,9 @@
1
- import type { ChordQuality } from '../chord/index.js';
2
- import { diatonicTriad } from '../chord/index.js';
3
- import { scaleTonesInDegreeOrder } from '../scale/index.js';
4
- import type { KeyScale } from '../types.js';
1
+ import type { KeyScale } from '../../core/types.js';
2
+ import type { ChordQuality, ChordSpan } from '../../theory/chord/index.js';
3
+ import { diatonicTriad } from '../../theory/chord/index.js';
4
+ import { scaleTonesInDegreeOrder } from '../../theory/scale/index.js';
5
+
6
+ export type { ChordSpan } from '../../theory/chord/index.js';
5
7
 
6
8
  /**
7
9
  * Broad production style a progression preset suits.
@@ -30,28 +32,12 @@ export type ProgressionPreset = {
30
32
  styles: ProgStyle[];
31
33
  };
32
34
 
33
- /**
34
- * A chord placed on the timeline by {@link generateProgression}.
35
- *
36
- * @category Composition
37
- */
38
- export type GeneratedChord = {
39
- rootPc: number;
40
- quality: ChordQuality;
41
- startBeat: number;
42
- bassPc?: number;
43
- /** 0-based scale degree of the chord root, when known. */
44
- degree?: number;
45
- /** True when the chord is a secondary dominant tonicizing another degree. */
46
- secondaryDominant?: boolean;
47
- };
48
-
49
35
  /**
50
36
  * Options controlling {@link generateProgression}.
51
37
  *
52
38
  * @category Composition
53
39
  */
54
- export type GenerateProgressionOptions = {
40
+ export type ProgressionOptions = {
55
41
  key: KeyScale;
56
42
  style: ProgStyle;
57
43
  bars: number;
@@ -315,12 +301,12 @@ function autoQuality(degree: number, key: KeyScale): ChordQuality {
315
301
  * ```ts
316
302
  * import { generateProgression, majorKey } from '@libraz/libcantus';
317
303
  * const chords = generateProgression({ key: majorKey(0), style: 'dance', bars: 4 });
318
- * // Deterministic for a given seed (defaults to 0); one GeneratedChord per bar.
304
+ * // Deterministic for a given seed (defaults to 0); one ChordSpan per bar.
319
305
  * ```
320
306
  *
321
307
  * @category Composition
322
308
  */
323
- export function generateProgression(opts: GenerateProgressionOptions): GeneratedChord[] {
309
+ export function generateProgression(opts: ProgressionOptions): ChordSpan[] {
324
310
  const seed = opts.seed ?? 0;
325
311
  let preset: ProgressionPreset | undefined;
326
312
  if (opts.presetId !== undefined) {
@@ -337,12 +323,12 @@ export function generateProgression(opts: GenerateProgressionOptions): Generated
337
323
  preset = candidates[index] ?? PRESETS[0];
338
324
  }
339
325
  const degrees = preset?.degrees ?? [0];
340
- const chords: GeneratedChord[] = [];
326
+ const chords: ChordSpan[] = [];
341
327
  for (let bar = 0; bar < opts.bars; bar += 1) {
342
328
  const degree = degrees[bar % degrees.length] ?? 0;
343
329
  const quality =
344
330
  opts.ext !== undefined && opts.ext !== 'auto' ? opts.ext : autoQuality(degree, opts.key);
345
- const chord: GeneratedChord = {
331
+ const chord: ChordSpan = {
346
332
  rootPc: degreeToRootPc(degree, opts.key),
347
333
  quality,
348
334
  startBeat: bar * 4,
@@ -7,14 +7,7 @@
7
7
  * Roots are pitch classes (0..11); no spelled key signature is required.
8
8
  */
9
9
 
10
- import {
11
- type Chord,
12
- type ChordQuality,
13
- chordPitchClasses,
14
- diatonicTriad,
15
- makeChord,
16
- } from '../chord/index.js';
17
- import { detectChordBest } from '../detect/index.js';
10
+ import { detectChordBest } from '../../analyze/detect/index.js';
18
11
  import {
19
12
  type BorrowedSource,
20
13
  borrowedSource,
@@ -23,9 +16,16 @@ import {
23
16
  type HarmonicFunction,
24
17
  isDiatonic,
25
18
  parallelKey,
26
- } from '../functional/index.js';
27
- import { scaleTonesInDegreeOrder } from '../scale/index.js';
28
- import type { KeyScale } from '../types.js';
19
+ } from '../../analyze/functional/index.js';
20
+ import type { KeyScale } from '../../core/types.js';
21
+ import {
22
+ type Chord,
23
+ type ChordQuality,
24
+ chordPitchClasses,
25
+ diatonicTriad,
26
+ makeChord,
27
+ } from '../../theory/chord/index.js';
28
+ import { scaleTonesInDegreeOrder } from '../../theory/scale/index.js';
29
29
 
30
30
  /** Reduce a value to a pitch class in [0, 11]. */
31
31
  function mod12(n: number): number {
@@ -11,8 +11,8 @@
11
11
  * library-wide convention.
12
12
  */
13
13
 
14
- import { beatsPerBar, metricWeight, type TimeSignature } from '../meter/index.js';
15
- import { createRng } from '../random/index.js';
14
+ import { beatsPerBar, metricWeight, type TimeSignature } from '../../core/meter/index.js';
15
+ import { createRng } from '../../core/random/index.js';
16
16
 
17
17
  /**
18
18
  * A single rhythmic note: an onset position and how long it sounds.
package/src/index.ts CHANGED
@@ -1,5 +1,3 @@
1
- export type { AnalyzedNote, TheoryLabel, VoiceNote } from './analysis/index.js';
2
- export { analyzeVoice } from './analysis/index.js';
3
1
  export type {
4
2
  ArrangementAnalysis,
5
3
  ArrangementOptions,
@@ -8,61 +6,16 @@ export type {
8
6
  TensionPoint,
9
7
  TrackAnalysis,
10
8
  TrackRole,
11
- } from './arrange/index.js';
12
- export { analyzeArrangement, tensionCurve } from './arrange/index.js';
13
- export type { BassLineOptions, BassSegment, BassStyle } from './bass/index.js';
14
- export { generateBassLine } from './bass/index.js';
15
- export type { Chord as ChordData, ChordQuality } from './chord/index.js';
16
- export {
17
- chordFromDegree,
18
- chordPitchClasses,
19
- chordQualities,
20
- chordToneRole,
21
- diatonicSeventh,
22
- diatonicTriad,
23
- makeChord,
24
- } from './chord/index.js';
25
- export type { ChordScaleMatch, ChordScaleReportEntry, ScaleChoice } from './chordscale/index.js';
26
- export {
27
- availableTensions,
28
- avoidNotes,
29
- chordScaleReport,
30
- chordScales,
31
- scaleMatchesChord,
32
- scalesForChanges,
33
- } from './chordscale/index.js';
34
- export type { CounterMelodyOptions } from './countermelody/index.js';
35
- export { generateCounterMelody } from './countermelody/index.js';
36
- export {
37
- createsHiddenParallelPerfect,
38
- createsParallelOctave,
39
- createsParallelPerfect,
40
- createsParallelUnison,
41
- createsVerticalDissonance,
42
- createsVoiceCrossing,
43
- createsVoiceOverlap,
44
- exceedsSpacing,
45
- isForbiddenMelodicLeap,
46
- isLeadingToneResolution,
47
- } from './counterpoint/index.js';
48
- export type { ChordMatch, KeyMatch } from './detect/index.js';
49
- export { detectChord, detectChordBest, detectKey } from './detect/index.js';
50
- export type {
51
- DrumGenOptions,
52
- DrumHit,
53
- DrumRole,
54
- EuclideanKick,
55
- GrooveFeel,
56
- GrooveStyle,
57
- Section,
58
- } from './drums/index.js';
59
- export { generateDrums } from './drums/index.js';
9
+ } from './analyze/arrange/index.js';
10
+ export { analyzeArrangement, tensionCurve } from './analyze/arrange/index.js';
11
+ export type { ChordMatch, KeyMatch } from './analyze/detect/index.js';
12
+ export { detectChord, detectChordBest, detectKey } from './analyze/detect/index.js';
60
13
  export type {
61
14
  BorrowedSource,
62
15
  Cadence,
63
16
  ChordAnalysis,
64
17
  HarmonicFunction,
65
- } from './functional/index.js';
18
+ } from './analyze/functional/index.js';
66
19
  export {
67
20
  analyzeChord,
68
21
  borrowedSource,
@@ -75,24 +28,28 @@ export {
75
28
  parallelKey,
76
29
  romanToChord,
77
30
  secondaryDominant,
78
- } from './functional/index.js';
79
- export type { GrooveSlot, GrooveTemplate, HumanizeOptions } from './groove/index.js';
80
- export { applyGrooveTemplate, extractGrooveTemplate, humanize } from './groove/index.js';
31
+ } from './analyze/functional/index.js';
81
32
  export type {
82
- HarmonizeOptions,
83
- HarmonizeResult,
84
- MelodyNote,
85
- } from './harmonize/index.js';
86
- export { harmonizeMelody } from './harmonize/index.js';
87
- export type { HarmonyRole, LockLevel, VoicedRole } from './harmony/index.js';
88
- export { roleOf } from './harmony/index.js';
33
+ CadenceHit,
34
+ ChordSegment,
35
+ ChordTimeline,
36
+ ChordTimelineOptions,
37
+ ChordTimelineResult,
38
+ } from './analyze/timeline/index.js';
39
+ export {
40
+ chordTimelineFromChords,
41
+ chordTimelineFromNotes,
42
+ detectCadences,
43
+ } from './analyze/timeline/index.js';
44
+ export type { AnalyzedNote, TheoryLabel, VoiceNote } from './analyze/voice/index.js';
45
+ export { analyzeVoice } from './analyze/voice/index.js';
89
46
  export {
90
47
  classifyInterval,
91
48
  IntervalQuality,
92
49
  isConsonantInterval,
93
50
  isPerfectInterval,
94
- } from './interval/index.js';
95
- export type { BarPosition, TimeSignature } from './meter/index.js';
51
+ } from './core/interval/index.js';
52
+ export type { BarPosition, TimeSignature } from './core/meter/index.js';
96
53
  export {
97
54
  barPositionToBeat,
98
55
  beatsPerBar,
@@ -104,17 +61,8 @@ export {
104
61
  parseTimeSignature,
105
62
  pulsesPerBar,
106
63
  tuplet,
107
- } from './meter/index.js';
108
- export { Chord, Interval, Key, Note, Progression } from './model/index.js';
109
- export type {
110
- GenerateMotifOptions,
111
- MotifCell,
112
- MotifContour,
113
- MotifNote,
114
- MotifTransform,
115
- } from './motif/index.js';
116
- export { developMotif, generateMotif, transformMotif } from './motif/index.js';
117
- export type { Note as NoteData, SpelledInterval } from './pitch/index.js';
64
+ } from './core/meter/index.js';
65
+ export type { Note as NoteData, SpelledInterval } from './core/pitch/index.js';
118
66
  export {
119
67
  formatNote,
120
68
  midiToNote,
@@ -122,41 +70,127 @@ export {
122
70
  noteToPitchClass,
123
71
  parseNote,
124
72
  spelledInterval,
125
- } from './pitch/index.js';
73
+ } from './core/pitch/index.js';
74
+ export type { Rng } from './core/random/index.js';
75
+ export { createRng } from './core/random/index.js';
76
+ export type { Tuning } from './core/tuning/index.js';
77
+ export {
78
+ centsBetweenFreq,
79
+ centsOfSteps,
80
+ edo,
81
+ frequencyOf,
82
+ JUST_RATIOS,
83
+ justDeviationCents,
84
+ nearestStep,
85
+ ratioToCents,
86
+ TWELVE_TET,
87
+ } from './core/tuning/index.js';
88
+ export type { KeyScale, NoteEvent } from './core/types.js';
89
+ export type { BassLineOptions, BassSegment, BassStyle } from './generate/bass/index.js';
90
+ export { generateBassLine } from './generate/bass/index.js';
91
+ export type { CounterMelodyOptions } from './generate/countermelody/index.js';
92
+ export { generateCounterMelody } from './generate/countermelody/index.js';
126
93
  export type {
127
- GeneratedChord,
128
- GenerateProgressionOptions,
94
+ DrumHit,
95
+ DrumRole,
96
+ DrumsOptions,
97
+ EuclideanKick,
98
+ GrooveFeel,
99
+ GrooveStyle,
100
+ Section,
101
+ } from './generate/drums/index.js';
102
+ export { generateDrums } from './generate/drums/index.js';
103
+ export type { GrooveSlot, GrooveTemplate, HumanizeOptions } from './generate/groove/index.js';
104
+ export { applyGrooveTemplate, extractGrooveTemplate, humanize } from './generate/groove/index.js';
105
+ export type {
106
+ HarmonizeOptions,
107
+ HarmonizeResult,
108
+ MelodyNote,
109
+ } from './generate/harmonize/index.js';
110
+ export { harmonizeMelody } from './generate/harmonize/index.js';
111
+ export type {
112
+ MotifCell,
113
+ MotifContour,
114
+ MotifNote,
115
+ MotifOptions,
116
+ MotifTransform,
117
+ } from './generate/motif/index.js';
118
+ export { developMotif, generateMotif, transformMotif } from './generate/motif/index.js';
119
+ export type {
120
+ ChordSpan,
129
121
  ProgFunction,
122
+ ProgressionOptions,
130
123
  ProgressionPreset,
131
124
  ProgStyle,
132
- } from './progression/index.js';
125
+ } from './generate/progression/index.js';
133
126
  export {
134
127
  generateProgression,
135
128
  progressions,
136
129
  progressionsByStyle,
137
- } from './progression/index.js';
138
- export type { Rng } from './random/index.js';
139
- export { createRng } from './random/index.js';
130
+ } from './generate/progression/index.js';
140
131
  export type {
141
132
  BorrowedChord,
142
133
  SubstituteOptions,
143
134
  Substitution,
144
135
  SubstitutionType,
145
- } from './reharmony/index.js';
136
+ } from './generate/reharmony/index.js';
146
137
  export {
147
138
  modalInterchangePalette,
148
139
  negativeHarmonyMirror,
149
140
  substituteChord,
150
- } from './reharmony/index.js';
151
- export type { RhythmEvent, RhythmOptions } from './rhythm/index.js';
152
- export { generateRhythm, onsetWeightCurve, rhythmDensity } from './rhythm/index.js';
141
+ } from './generate/reharmony/index.js';
142
+ export type { RhythmEvent, RhythmOptions } from './generate/rhythm/index.js';
143
+ export { generateRhythm, onsetWeightCurve, rhythmDensity } from './generate/rhythm/index.js';
144
+ export { Chord, Interval, Key, Note, Progression } from './model/index.js';
145
+ export type { Chord as ChordData, ChordQuality } from './theory/chord/index.js';
146
+ export {
147
+ chordFromDegree,
148
+ chordPitchClasses,
149
+ chordQualities,
150
+ chordToneRole,
151
+ diatonicSeventh,
152
+ diatonicTriad,
153
+ makeChord,
154
+ } from './theory/chord/index.js';
155
+ export type {
156
+ ChordScaleMatch,
157
+ ChordScaleReportEntry,
158
+ ScaleChoice,
159
+ } from './theory/chordscale/index.js';
160
+ export {
161
+ availableTensions,
162
+ avoidNotes,
163
+ chordScaleReport,
164
+ chordScales,
165
+ scaleMatchesChord,
166
+ scalesForChanges,
167
+ } from './theory/chordscale/index.js';
168
+ export {
169
+ createsHiddenParallelPerfect,
170
+ createsParallelOctave,
171
+ createsParallelPerfect,
172
+ createsParallelUnison,
173
+ createsVerticalDissonance,
174
+ createsVoiceCrossing,
175
+ createsVoiceOverlap,
176
+ exceedsSpacing,
177
+ isForbiddenMelodicLeap,
178
+ isLeadingToneResolution,
179
+ } from './theory/counterpoint/index.js';
180
+ export type { HarmonyRole, LockLevel, VoicedRole } from './theory/harmony/index.js';
181
+ export { roleOf } from './theory/harmony/index.js';
153
182
  export type {
154
183
  SafetyProfile,
155
184
  SafetyQuery,
156
185
  SafetyResult,
157
186
  VoiceSnapshot,
158
- } from './safety/index.js';
159
- export { enumerateSafePitches, evaluateSafety, NoteSafety, ReasonFlag } from './safety/index.js';
187
+ } from './theory/safety/index.js';
188
+ export {
189
+ enumerateSafePitches,
190
+ evaluateSafety,
191
+ NoteSafety,
192
+ ReasonFlag,
193
+ } from './theory/safety/index.js';
160
194
  export {
161
195
  BLUES_MASK,
162
196
  CHROMATIC_MASK,
@@ -184,46 +218,25 @@ export {
184
218
  scaleByName,
185
219
  scaleTonesInDegreeOrder,
186
220
  WHOLE_TONE_MASK,
187
- } from './scale/index.js';
221
+ } from './theory/scale/index.js';
188
222
  export {
189
223
  noteNames,
190
224
  spellChord,
191
225
  spellPitchClass,
192
226
  spellPitchClasses,
193
227
  spellScale,
194
- } from './spelling/index.js';
195
- export { formatChordSymbol, parseChordSymbol, transposeChordSymbol } from './symbol/index.js';
196
- export type {
197
- CadenceHit,
198
- ChordSegment,
199
- ChordTimeline,
200
- ChordTimelineOptions,
201
- ChordTimelineResult,
202
- } from './timeline/index.js';
203
- export {
204
- chordTimelineFromChords,
205
- chordTimelineFromNotes,
206
- detectCadences,
207
- } from './timeline/index.js';
208
- export type { Tuning } from './tuning/index.js';
228
+ } from './theory/spelling/index.js';
209
229
  export {
210
- centsBetweenFreq,
211
- centsOfSteps,
212
- edo,
213
- frequencyOf,
214
- JUST_RATIOS,
215
- justDeviationCents,
216
- nearestStep,
217
- ratioToCents,
218
- TWELVE_TET,
219
- } from './tuning/index.js';
220
- export type { KeyScale, NoteEvent } from './types.js';
230
+ formatChordSymbol,
231
+ parseChordSymbol,
232
+ transposeChordSymbol,
233
+ } from './theory/symbol/index.js';
221
234
  export type {
222
235
  StyledVoicingOptions,
223
236
  VoiceRange,
224
237
  VoicingOptions,
225
238
  VoicingStyle,
226
- } from './voicing/index.js';
239
+ } from './theory/voicing/index.js';
227
240
  export {
228
241
  nextVoicing,
229
242
  SATB_RANGES,
@@ -231,4 +244,4 @@ export {
231
244
  voiceChordStyled,
232
245
  voiceLeadingCost,
233
246
  voiceProgression,
234
- } from './voicing/index.js';
247
+ } from './theory/voicing/index.js';