@libraz/libcantus 0.9.0 → 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 (155) hide show
  1. package/README.md +25 -2
  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 +5277 -4893
  63. package/dist/index.cjs.map +1 -1
  64. package/dist/index.d.cts +14 -2621
  65. package/dist/index.d.ts +14 -2621
  66. package/dist/index.js +170 -6152
  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 +31 -1
  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 +82 -23
  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/analyze/functional/roman.ts +393 -0
  96. package/src/analyze/index.ts +49 -0
  97. package/src/{timeline → analyze/timeline}/index.ts +87 -24
  98. package/src/{analysis → analyze/voice}/index.ts +81 -12
  99. package/src/core/index.ts +47 -0
  100. package/src/{interval → core/interval}/index.ts +15 -1
  101. package/src/{meter → core/meter}/index.ts +108 -5
  102. package/src/{pitch → core/pitch}/index.ts +58 -3
  103. package/src/{random → core/random}/index.ts +13 -1
  104. package/src/{tuning → core/tuning}/index.ts +28 -1
  105. package/src/{bass → generate/bass}/index.ts +66 -17
  106. package/src/{countermelody → generate/countermelody}/index.ts +54 -24
  107. package/src/{drums → generate/drums}/fills.ts +31 -20
  108. package/src/{drums → generate/drums}/index.ts +127 -9
  109. package/src/{drums → generate/drums}/internal.ts +7 -1
  110. package/src/{drums → generate/drums}/rng.ts +2 -2
  111. package/src/{drums → generate/drums}/swing.ts +7 -2
  112. package/src/{groove → generate/groove}/index.ts +118 -22
  113. package/src/{harmonize → generate/harmonize}/index.ts +96 -23
  114. package/src/generate/index.ts +59 -0
  115. package/src/{motif → generate/motif}/index.ts +94 -17
  116. package/src/{progression → generate/progression}/index.ts +61 -27
  117. package/src/{reharmony → generate/reharmony}/index.ts +46 -15
  118. package/src/{rhythm → generate/rhythm}/index.ts +47 -13
  119. package/src/index.ts +130 -116
  120. package/src/model/chord.ts +423 -0
  121. package/src/model/index.ts +5 -947
  122. package/src/model/interval.ts +82 -0
  123. package/src/model/key.ts +266 -0
  124. package/src/model/note.ts +176 -0
  125. package/src/model/progression.ts +161 -0
  126. package/src/model/shared.ts +12 -0
  127. package/src/{chord → theory/chord}/index.ts +85 -4
  128. package/src/{chordscale → theory/chordscale}/index.ts +67 -9
  129. package/src/{counterpoint → theory/counterpoint}/index.ts +23 -2
  130. package/src/{harmony → theory/harmony}/index.ts +19 -2
  131. package/src/theory/index.ts +107 -0
  132. package/src/{safety → theory/safety}/index.ts +59 -12
  133. package/src/theory/scale/degrees.ts +123 -0
  134. package/src/theory/scale/index.ts +28 -0
  135. package/src/theory/scale/key.ts +56 -0
  136. package/src/theory/scale/masks.ts +153 -0
  137. package/src/{spelling → theory/spelling}/index.ts +21 -3
  138. package/src/{symbol → theory/symbol}/index.ts +91 -36
  139. package/src/theory/voicing/index.ts +5 -0
  140. package/src/theory/voicing/internal.ts +168 -0
  141. package/src/theory/voicing/leading.ts +112 -0
  142. package/src/theory/voicing/satb.ts +195 -0
  143. package/src/theory/voicing/styled.ts +176 -0
  144. package/src/arrange/index.ts +0 -409
  145. package/src/functional/index.ts +0 -602
  146. package/src/scale/index.ts +0 -215
  147. package/src/voicing/index.ts +0 -523
  148. /package/src/{types.ts → core/types.ts} +0 -0
  149. /package/src/{drums → generate/drums}/beat.ts +0 -0
  150. /package/src/{drums → generate/drums}/euclid.ts +0 -0
  151. /package/src/{drums → generate/drums}/ghost.ts +0 -0
  152. /package/src/{drums → generate/drums}/hihat.ts +0 -0
  153. /package/src/{drums → generate/drums}/hit.ts +0 -0
  154. /package/src/{drums → generate/drums}/kick.ts +0 -0
  155. /package/src/{drums → generate/drums}/percussion.ts +0 -0
@@ -0,0 +1,187 @@
1
+ import { K as KeyScale } from './types-MGP29r3t.js';
2
+ import { C as Chord } from './index-CM5W4rcm.js';
3
+
4
+ /**
5
+ * Borrowed chords (modal interchange) and the Neapolitan.
6
+ *
7
+ * Roots are pitch classes measured against the key tonic, so borrowed and
8
+ * chromatic chords are handled by their semitone offset rather than requiring a
9
+ * spelled key signature.
10
+ */
11
+
12
+ /**
13
+ * The origin of a recognized non-diatonic chord, or null when none applies.
14
+ *
15
+ * @category Functional Harmony
16
+ */
17
+ type BorrowedSource = 'parallel-minor' | 'parallel-major' | 'neapolitan' | null;
18
+ /**
19
+ * Whether a chord is borrowed from the parallel mode (modal interchange).
20
+ *
21
+ * True when the chord is not diatonic to `key` but is diatonic to its
22
+ * {@link parallelKey} — e.g. iv, bVI, or bVII in a major key, or the Picardy
23
+ * tonic and major IV in a minor key. Two non-diatonic families are excluded:
24
+ * chords diatonic to neither mode (they are chromatic, not borrowed), and, in
25
+ * a minor key, chords explained by the harmonic minor scale (the major
26
+ * dominant and raised-leading-tone chords), which are in-key alterations
27
+ * rather than interchange even though they happen to fit the parallel major.
28
+ *
29
+ * @param chord The chord to test.
30
+ * @param key The prevailing key.
31
+ * @returns True if the chord is borrowed from the parallel mode.
32
+ * @category Functional Harmony
33
+ */
34
+ declare function isBorrowedChord(chord: Chord, key: KeyScale): boolean;
35
+ /**
36
+ * Identify where a non-diatonic chord comes from.
37
+ *
38
+ * The Neapolitan (major triad on b2) is recognized first, since it sits
39
+ * outside both parallel modes; parallel-mode borrowing follows the
40
+ * {@link isBorrowedChord} rules. Diatonic chords, harmonic-minor alterations,
41
+ * and unrecognized chromatic chords all yield null.
42
+ *
43
+ * @param chord The chord to classify.
44
+ * @param key The prevailing key.
45
+ * @returns The borrowing source, or null.
46
+ * @category Functional Harmony
47
+ */
48
+ declare function borrowedSource(chord: Chord, key: KeyScale): BorrowedSource;
49
+
50
+ /**
51
+ * Cadence detection between two successive chords.
52
+ *
53
+ * Roots are pitch classes measured against the key tonic, so borrowed and
54
+ * chromatic chords are handled by their semitone offset rather than requiring a
55
+ * spelled key signature.
56
+ */
57
+
58
+ /**
59
+ * A recognized cadence type, or null when a chord pair forms none.
60
+ *
61
+ * @category Functional Harmony
62
+ */
63
+ type Cadence = 'authentic' | 'plagal' | 'half' | 'deceptive' | null;
64
+ /**
65
+ * Classify the cadence formed by moving from one chord to the next.
66
+ *
67
+ * - authentic: V (dominant a fifth above the tonic) to I
68
+ * - plagal: IV (a fourth above the tonic) to I
69
+ * - deceptive: V to the submediant (diatonic vi or borrowed bVI in major, VI in
70
+ * minor)
71
+ * - half: any chord other than the dominant itself to V
72
+ *
73
+ * A static V-to-V repeat with no root motion is not a cadence and yields null.
74
+ *
75
+ * @param from The penultimate chord.
76
+ * @param to The final chord.
77
+ * @param key The prevailing key.
78
+ * @returns The cadence type, or null.
79
+ * @example
80
+ * ```ts
81
+ * import { detectCadence, makeChord, majorKey } from '@libraz/libcantus';
82
+ * detectCadence(makeChord(7, 'maj'), makeChord(0, 'maj'), majorKey(0)); // => 'authentic'
83
+ * ```
84
+ * @category Functional Harmony
85
+ */
86
+ declare function detectCadence(from: Chord, to: Chord, key: KeyScale): Cadence;
87
+
88
+ /**
89
+ * Harmonic function (tonic / subdominant / dominant), diatonicity, parallel-key
90
+ * mirroring, and full chord analysis.
91
+ *
92
+ * Roots are pitch classes measured against the key tonic, so borrowed and
93
+ * chromatic chords are handled by their semitone offset rather than requiring a
94
+ * spelled key signature.
95
+ */
96
+
97
+ /**
98
+ * The three broad harmonic functions of tonal music.
99
+ *
100
+ * @category Functional Harmony
101
+ */
102
+ type HarmonicFunction = 'tonic' | 'subdominant' | 'dominant';
103
+ /**
104
+ * Whether a key's scale has a minor third and no major third (a minor key).
105
+ *
106
+ * @category Functional Harmony
107
+ */
108
+ declare function isMinorKey(key: KeyScale): boolean;
109
+ /**
110
+ * The harmonic function of a chord in a key, from its root's offset above the
111
+ * tonic. The mapping follows common-practice major-key function and is a useful
112
+ * approximation in minor and for borrowed chords.
113
+ *
114
+ * @param chord The chord.
115
+ * @param key The prevailing key.
116
+ * @returns The harmonic function.
117
+ * @category Functional Harmony
118
+ */
119
+ declare function functionOf(chord: Chord, key: KeyScale): HarmonicFunction;
120
+ /**
121
+ * The result of {@link analyzeChord}: function, borrowing, and Roman numeral.
122
+ *
123
+ * @category Functional Harmony
124
+ */
125
+ type ChordAnalysis = {
126
+ function: HarmonicFunction;
127
+ borrowed: boolean;
128
+ source: BorrowedSource;
129
+ roman: string;
130
+ };
131
+ /**
132
+ * Whether every pitch class of a chord belongs to the key's scale.
133
+ *
134
+ * The test is strict against the key's own mode mask: in a natural-minor key
135
+ * the harmonic-minor dominant (major V) is *not* diatonic, since the raised
136
+ * leading tone lies outside the mask. Borrowing predicates treat that case as
137
+ * an in-key alteration separately (see {@link isBorrowedChord}).
138
+ *
139
+ * @param chord The chord to test.
140
+ * @param key The prevailing key.
141
+ * @returns True if all chord pitch classes are scale tones.
142
+ * @category Functional Harmony
143
+ */
144
+ declare function isDiatonic(chord: Chord, key: KeyScale): boolean;
145
+ /**
146
+ * The parallel key: same tonic, opposite mode.
147
+ *
148
+ * A key with a minor third (natural/harmonic/melodic minor, dorian, phrygian)
149
+ * maps to the parallel major; any other key maps to the parallel natural minor.
150
+ *
151
+ * @param key The key to mirror.
152
+ * @returns The parallel major or natural-minor key on the same tonic.
153
+ * @category Functional Harmony
154
+ */
155
+ declare function parallelKey(key: KeyScale): KeyScale;
156
+ /**
157
+ * Analyze a chord in a key: harmonic function, borrowing, and Roman numeral.
158
+ *
159
+ * The function is quality-aware (see the predicates behind it), the source
160
+ * follows {@link borrowedSource}, and the numeral comes from
161
+ * {@link chordToRoman}. `borrowed` is true whenever a source is identified —
162
+ * including the Neapolitan, which the stricter parallel-mode predicate
163
+ * {@link isBorrowedChord} does not count.
164
+ *
165
+ * @param chord The chord to analyze.
166
+ * @param key The prevailing key.
167
+ * @returns The chord analysis.
168
+ * @example
169
+ * ```ts
170
+ * import { analyzeChord, makeChord, majorKey } from '@libraz/libcantus';
171
+ * analyzeChord(makeChord(7, 'dom7'), majorKey(0));
172
+ * // { function: 'dominant', borrowed: false, source: null, roman: 'V7' }
173
+ * ```
174
+ * @category Functional Harmony
175
+ */
176
+ declare function analyzeChord(chord: Chord, key: KeyScale): ChordAnalysis;
177
+ /**
178
+ * The secondary dominant (V7) that tonicizes a scale degree.
179
+ *
180
+ * @param targetDegree 0-based scale degree to tonicize.
181
+ * @param key The prevailing key.
182
+ * @returns A dominant-seventh chord a fifth above the target's root.
183
+ * @category Functional Harmony
184
+ */
185
+ declare function secondaryDominant(targetDegree: number, key: KeyScale): Chord;
186
+
187
+ export { type BorrowedSource as B, type Cadence as C, type HarmonicFunction as H, type ChordAnalysis as a, analyzeChord as b, borrowedSource as c, detectCadence as d, isDiatonic as e, functionOf as f, isMinorKey as g, isBorrowedChord as i, parallelKey as p, secondaryDominant as s };
@@ -0,0 +1,187 @@
1
+ import { K as KeyScale } from './types-MGP29r3t.cjs';
2
+ import { C as Chord } from './index-BOBXBNwP.cjs';
3
+
4
+ /**
5
+ * Borrowed chords (modal interchange) and the Neapolitan.
6
+ *
7
+ * Roots are pitch classes measured against the key tonic, so borrowed and
8
+ * chromatic chords are handled by their semitone offset rather than requiring a
9
+ * spelled key signature.
10
+ */
11
+
12
+ /**
13
+ * The origin of a recognized non-diatonic chord, or null when none applies.
14
+ *
15
+ * @category Functional Harmony
16
+ */
17
+ type BorrowedSource = 'parallel-minor' | 'parallel-major' | 'neapolitan' | null;
18
+ /**
19
+ * Whether a chord is borrowed from the parallel mode (modal interchange).
20
+ *
21
+ * True when the chord is not diatonic to `key` but is diatonic to its
22
+ * {@link parallelKey} — e.g. iv, bVI, or bVII in a major key, or the Picardy
23
+ * tonic and major IV in a minor key. Two non-diatonic families are excluded:
24
+ * chords diatonic to neither mode (they are chromatic, not borrowed), and, in
25
+ * a minor key, chords explained by the harmonic minor scale (the major
26
+ * dominant and raised-leading-tone chords), which are in-key alterations
27
+ * rather than interchange even though they happen to fit the parallel major.
28
+ *
29
+ * @param chord The chord to test.
30
+ * @param key The prevailing key.
31
+ * @returns True if the chord is borrowed from the parallel mode.
32
+ * @category Functional Harmony
33
+ */
34
+ declare function isBorrowedChord(chord: Chord, key: KeyScale): boolean;
35
+ /**
36
+ * Identify where a non-diatonic chord comes from.
37
+ *
38
+ * The Neapolitan (major triad on b2) is recognized first, since it sits
39
+ * outside both parallel modes; parallel-mode borrowing follows the
40
+ * {@link isBorrowedChord} rules. Diatonic chords, harmonic-minor alterations,
41
+ * and unrecognized chromatic chords all yield null.
42
+ *
43
+ * @param chord The chord to classify.
44
+ * @param key The prevailing key.
45
+ * @returns The borrowing source, or null.
46
+ * @category Functional Harmony
47
+ */
48
+ declare function borrowedSource(chord: Chord, key: KeyScale): BorrowedSource;
49
+
50
+ /**
51
+ * Cadence detection between two successive chords.
52
+ *
53
+ * Roots are pitch classes measured against the key tonic, so borrowed and
54
+ * chromatic chords are handled by their semitone offset rather than requiring a
55
+ * spelled key signature.
56
+ */
57
+
58
+ /**
59
+ * A recognized cadence type, or null when a chord pair forms none.
60
+ *
61
+ * @category Functional Harmony
62
+ */
63
+ type Cadence = 'authentic' | 'plagal' | 'half' | 'deceptive' | null;
64
+ /**
65
+ * Classify the cadence formed by moving from one chord to the next.
66
+ *
67
+ * - authentic: V (dominant a fifth above the tonic) to I
68
+ * - plagal: IV (a fourth above the tonic) to I
69
+ * - deceptive: V to the submediant (diatonic vi or borrowed bVI in major, VI in
70
+ * minor)
71
+ * - half: any chord other than the dominant itself to V
72
+ *
73
+ * A static V-to-V repeat with no root motion is not a cadence and yields null.
74
+ *
75
+ * @param from The penultimate chord.
76
+ * @param to The final chord.
77
+ * @param key The prevailing key.
78
+ * @returns The cadence type, or null.
79
+ * @example
80
+ * ```ts
81
+ * import { detectCadence, makeChord, majorKey } from '@libraz/libcantus';
82
+ * detectCadence(makeChord(7, 'maj'), makeChord(0, 'maj'), majorKey(0)); // => 'authentic'
83
+ * ```
84
+ * @category Functional Harmony
85
+ */
86
+ declare function detectCadence(from: Chord, to: Chord, key: KeyScale): Cadence;
87
+
88
+ /**
89
+ * Harmonic function (tonic / subdominant / dominant), diatonicity, parallel-key
90
+ * mirroring, and full chord analysis.
91
+ *
92
+ * Roots are pitch classes measured against the key tonic, so borrowed and
93
+ * chromatic chords are handled by their semitone offset rather than requiring a
94
+ * spelled key signature.
95
+ */
96
+
97
+ /**
98
+ * The three broad harmonic functions of tonal music.
99
+ *
100
+ * @category Functional Harmony
101
+ */
102
+ type HarmonicFunction = 'tonic' | 'subdominant' | 'dominant';
103
+ /**
104
+ * Whether a key's scale has a minor third and no major third (a minor key).
105
+ *
106
+ * @category Functional Harmony
107
+ */
108
+ declare function isMinorKey(key: KeyScale): boolean;
109
+ /**
110
+ * The harmonic function of a chord in a key, from its root's offset above the
111
+ * tonic. The mapping follows common-practice major-key function and is a useful
112
+ * approximation in minor and for borrowed chords.
113
+ *
114
+ * @param chord The chord.
115
+ * @param key The prevailing key.
116
+ * @returns The harmonic function.
117
+ * @category Functional Harmony
118
+ */
119
+ declare function functionOf(chord: Chord, key: KeyScale): HarmonicFunction;
120
+ /**
121
+ * The result of {@link analyzeChord}: function, borrowing, and Roman numeral.
122
+ *
123
+ * @category Functional Harmony
124
+ */
125
+ type ChordAnalysis = {
126
+ function: HarmonicFunction;
127
+ borrowed: boolean;
128
+ source: BorrowedSource;
129
+ roman: string;
130
+ };
131
+ /**
132
+ * Whether every pitch class of a chord belongs to the key's scale.
133
+ *
134
+ * The test is strict against the key's own mode mask: in a natural-minor key
135
+ * the harmonic-minor dominant (major V) is *not* diatonic, since the raised
136
+ * leading tone lies outside the mask. Borrowing predicates treat that case as
137
+ * an in-key alteration separately (see {@link isBorrowedChord}).
138
+ *
139
+ * @param chord The chord to test.
140
+ * @param key The prevailing key.
141
+ * @returns True if all chord pitch classes are scale tones.
142
+ * @category Functional Harmony
143
+ */
144
+ declare function isDiatonic(chord: Chord, key: KeyScale): boolean;
145
+ /**
146
+ * The parallel key: same tonic, opposite mode.
147
+ *
148
+ * A key with a minor third (natural/harmonic/melodic minor, dorian, phrygian)
149
+ * maps to the parallel major; any other key maps to the parallel natural minor.
150
+ *
151
+ * @param key The key to mirror.
152
+ * @returns The parallel major or natural-minor key on the same tonic.
153
+ * @category Functional Harmony
154
+ */
155
+ declare function parallelKey(key: KeyScale): KeyScale;
156
+ /**
157
+ * Analyze a chord in a key: harmonic function, borrowing, and Roman numeral.
158
+ *
159
+ * The function is quality-aware (see the predicates behind it), the source
160
+ * follows {@link borrowedSource}, and the numeral comes from
161
+ * {@link chordToRoman}. `borrowed` is true whenever a source is identified —
162
+ * including the Neapolitan, which the stricter parallel-mode predicate
163
+ * {@link isBorrowedChord} does not count.
164
+ *
165
+ * @param chord The chord to analyze.
166
+ * @param key The prevailing key.
167
+ * @returns The chord analysis.
168
+ * @example
169
+ * ```ts
170
+ * import { analyzeChord, makeChord, majorKey } from '@libraz/libcantus';
171
+ * analyzeChord(makeChord(7, 'dom7'), majorKey(0));
172
+ * // { function: 'dominant', borrowed: false, source: null, roman: 'V7' }
173
+ * ```
174
+ * @category Functional Harmony
175
+ */
176
+ declare function analyzeChord(chord: Chord, key: KeyScale): ChordAnalysis;
177
+ /**
178
+ * The secondary dominant (V7) that tonicizes a scale degree.
179
+ *
180
+ * @param targetDegree 0-based scale degree to tonicize.
181
+ * @param key The prevailing key.
182
+ * @returns A dominant-seventh chord a fifth above the target's root.
183
+ * @category Functional Harmony
184
+ */
185
+ declare function secondaryDominant(targetDegree: number, key: KeyScale): Chord;
186
+
187
+ export { type BorrowedSource as B, type Cadence as C, type HarmonicFunction as H, type ChordAnalysis as a, analyzeChord as b, borrowedSource as c, detectCadence as d, isDiatonic as e, functionOf as f, isMinorKey as g, isBorrowedChord as i, parallelKey as p, secondaryDominant as s };