@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
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,60 +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
- GrooveFeel,
55
- GrooveStyle,
56
- Section,
57
- } from './drums/index.js';
58
- 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';
59
13
  export type {
60
14
  BorrowedSource,
61
15
  Cadence,
62
16
  ChordAnalysis,
63
17
  HarmonicFunction,
64
- } from './functional/index.js';
18
+ } from './analyze/functional/index.js';
65
19
  export {
66
20
  analyzeChord,
67
21
  borrowedSource,
@@ -74,24 +28,28 @@ export {
74
28
  parallelKey,
75
29
  romanToChord,
76
30
  secondaryDominant,
77
- } from './functional/index.js';
78
- export type { GrooveSlot, GrooveTemplate, HumanizeOptions } from './groove/index.js';
79
- export { applyGrooveTemplate, extractGrooveTemplate, humanize } from './groove/index.js';
31
+ } from './analyze/functional/index.js';
80
32
  export type {
81
- HarmonizeOptions,
82
- HarmonizeResult,
83
- MelodyNote,
84
- } from './harmonize/index.js';
85
- export { harmonizeMelody } from './harmonize/index.js';
86
- export type { HarmonyRole, LockLevel, VoicedRole } from './harmony/index.js';
87
- 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';
88
46
  export {
89
47
  classifyInterval,
90
48
  IntervalQuality,
91
49
  isConsonantInterval,
92
50
  isPerfectInterval,
93
- } from './interval/index.js';
94
- export type { BarPosition, TimeSignature } from './meter/index.js';
51
+ } from './core/interval/index.js';
52
+ export type { BarPosition, TimeSignature } from './core/meter/index.js';
95
53
  export {
96
54
  barPositionToBeat,
97
55
  beatsPerBar,
@@ -103,17 +61,8 @@ export {
103
61
  parseTimeSignature,
104
62
  pulsesPerBar,
105
63
  tuplet,
106
- } from './meter/index.js';
107
- export { Chord, Interval, Key, Note, Progression } from './model/index.js';
108
- export type {
109
- GenerateMotifOptions,
110
- MotifCell,
111
- MotifContour,
112
- MotifNote,
113
- MotifTransform,
114
- } from './motif/index.js';
115
- export { developMotif, generateMotif, transformMotif } from './motif/index.js';
116
- 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';
117
66
  export {
118
67
  formatNote,
119
68
  midiToNote,
@@ -121,41 +70,127 @@ export {
121
70
  noteToPitchClass,
122
71
  parseNote,
123
72
  spelledInterval,
124
- } 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';
125
93
  export type {
126
- GeneratedChord,
127
- 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,
128
121
  ProgFunction,
122
+ ProgressionOptions,
129
123
  ProgressionPreset,
130
124
  ProgStyle,
131
- } from './progression/index.js';
125
+ } from './generate/progression/index.js';
132
126
  export {
133
127
  generateProgression,
134
128
  progressions,
135
129
  progressionsByStyle,
136
- } from './progression/index.js';
137
- export type { Rng } from './random/index.js';
138
- export { createRng } from './random/index.js';
130
+ } from './generate/progression/index.js';
139
131
  export type {
140
132
  BorrowedChord,
141
133
  SubstituteOptions,
142
134
  Substitution,
143
135
  SubstitutionType,
144
- } from './reharmony/index.js';
136
+ } from './generate/reharmony/index.js';
145
137
  export {
146
138
  modalInterchangePalette,
147
139
  negativeHarmonyMirror,
148
140
  substituteChord,
149
- } from './reharmony/index.js';
150
- export type { RhythmEvent, RhythmOptions } from './rhythm/index.js';
151
- 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';
152
182
  export type {
153
183
  SafetyProfile,
154
184
  SafetyQuery,
155
185
  SafetyResult,
156
186
  VoiceSnapshot,
157
- } from './safety/index.js';
158
- 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';
159
194
  export {
160
195
  BLUES_MASK,
161
196
  CHROMATIC_MASK,
@@ -183,46 +218,25 @@ export {
183
218
  scaleByName,
184
219
  scaleTonesInDegreeOrder,
185
220
  WHOLE_TONE_MASK,
186
- } from './scale/index.js';
221
+ } from './theory/scale/index.js';
187
222
  export {
188
223
  noteNames,
189
224
  spellChord,
190
225
  spellPitchClass,
191
226
  spellPitchClasses,
192
227
  spellScale,
193
- } from './spelling/index.js';
194
- export { formatChordSymbol, parseChordSymbol, transposeChordSymbol } from './symbol/index.js';
195
- export type {
196
- CadenceHit,
197
- ChordSegment,
198
- ChordTimeline,
199
- ChordTimelineOptions,
200
- ChordTimelineResult,
201
- } from './timeline/index.js';
202
- export {
203
- chordTimelineFromChords,
204
- chordTimelineFromNotes,
205
- detectCadences,
206
- } from './timeline/index.js';
207
- export type { Tuning } from './tuning/index.js';
228
+ } from './theory/spelling/index.js';
208
229
  export {
209
- centsBetweenFreq,
210
- centsOfSteps,
211
- edo,
212
- frequencyOf,
213
- JUST_RATIOS,
214
- justDeviationCents,
215
- nearestStep,
216
- ratioToCents,
217
- TWELVE_TET,
218
- } from './tuning/index.js';
219
- export type { KeyScale, NoteEvent } from './types.js';
230
+ formatChordSymbol,
231
+ parseChordSymbol,
232
+ transposeChordSymbol,
233
+ } from './theory/symbol/index.js';
220
234
  export type {
221
235
  StyledVoicingOptions,
222
236
  VoiceRange,
223
237
  VoicingOptions,
224
238
  VoicingStyle,
225
- } from './voicing/index.js';
239
+ } from './theory/voicing/index.js';
226
240
  export {
227
241
  nextVoicing,
228
242
  SATB_RANGES,
@@ -230,4 +244,4 @@ export {
230
244
  voiceChordStyled,
231
245
  voiceLeadingCost,
232
246
  voiceProgression,
233
- } from './voicing/index.js';
247
+ } from './theory/voicing/index.js';