@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.
- package/README.md +15 -0
- package/dist/analyze/index.cjs +1697 -0
- package/dist/analyze/index.cjs.map +1 -0
- package/dist/analyze/index.d.cts +429 -0
- package/dist/analyze/index.d.ts +429 -0
- package/dist/analyze/index.js +51 -0
- package/dist/analyze/index.js.map +1 -0
- package/dist/chunk-5HTNMQW4.js +653 -0
- package/dist/chunk-5HTNMQW4.js.map +1 -0
- package/dist/chunk-7Y7WF64D.js +410 -0
- package/dist/chunk-7Y7WF64D.js.map +1 -0
- package/dist/chunk-A4532ZFR.js +259 -0
- package/dist/chunk-A4532ZFR.js.map +1 -0
- package/dist/chunk-BHUT2S5G.js +22 -0
- package/dist/chunk-BHUT2S5G.js.map +1 -0
- package/dist/chunk-CCBLVAPK.js +42 -0
- package/dist/chunk-CCBLVAPK.js.map +1 -0
- package/dist/chunk-COKTX2G5.js +907 -0
- package/dist/chunk-COKTX2G5.js.map +1 -0
- package/dist/chunk-DYWFNC4A.js +152 -0
- package/dist/chunk-DYWFNC4A.js.map +1 -0
- package/dist/chunk-GQKN5KDT.js +159 -0
- package/dist/chunk-GQKN5KDT.js.map +1 -0
- package/dist/chunk-LN7ZZMD2.js +530 -0
- package/dist/chunk-LN7ZZMD2.js.map +1 -0
- package/dist/chunk-MSWFZF7J.js +118 -0
- package/dist/chunk-MSWFZF7J.js.map +1 -0
- package/dist/chunk-R3S2LUBH.js +2722 -0
- package/dist/chunk-R3S2LUBH.js.map +1 -0
- package/dist/chunk-SDM3VJJ5.js +41 -0
- package/dist/chunk-SDM3VJJ5.js.map +1 -0
- package/dist/chunk-XTC3X6MS.js +816 -0
- package/dist/chunk-XTC3X6MS.js.map +1 -0
- package/dist/chunk-ZXW5YIWK.js +55 -0
- package/dist/chunk-ZXW5YIWK.js.map +1 -0
- package/dist/core/index.cjs +432 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +210 -0
- package/dist/core/index.d.ts +210 -0
- package/dist/core/index.js +73 -0
- package/dist/core/index.js.map +1 -0
- package/dist/function-2bJW1Zp_.d.ts +187 -0
- package/dist/function-r2sh-jOO.d.cts +187 -0
- package/dist/generate/index.cjs +3787 -0
- package/dist/generate/index.cjs.map +1 -0
- package/dist/generate/index.d.cts +980 -0
- package/dist/generate/index.d.ts +980 -0
- package/dist/generate/index.js +52 -0
- package/dist/generate/index.js.map +1 -0
- package/dist/index-BMPxwjwV.d.ts +151 -0
- package/dist/index-BOBXBNwP.d.cts +157 -0
- package/dist/index-BdeQ1r_p.d.cts +56 -0
- package/dist/index-BreoJRw0.d.ts +127 -0
- package/dist/index-CGMZNCx6.d.cts +140 -0
- package/dist/index-CGMZNCx6.d.ts +140 -0
- package/dist/index-CM5W4rcm.d.ts +157 -0
- package/dist/index-CP3wAfEH.d.ts +56 -0
- package/dist/index-Cl7mhOFM.d.cts +164 -0
- package/dist/index-Cl7mhOFM.d.ts +164 -0
- package/dist/index-DZ1M21do.d.cts +127 -0
- package/dist/index-D_ZTUNKp.d.cts +151 -0
- package/dist/index.cjs +3016 -2984
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -3982
- package/dist/index.d.ts +14 -3982
- package/dist/index.js +170 -6504
- package/dist/index.js.map +1 -1
- package/dist/model/index.cjs +2435 -0
- package/dist/model/index.cjs.map +1 -0
- package/dist/model/index.d.cts +630 -0
- package/dist/model/index.d.ts +630 -0
- package/dist/model/index.js +21 -0
- package/dist/model/index.js.map +1 -0
- package/dist/styled-BjXtOFNk.d.cts +282 -0
- package/dist/styled-D7BAx3S3.d.ts +282 -0
- package/dist/theory/index.cjs +1677 -0
- package/dist/theory/index.cjs.map +1 -0
- package/dist/theory/index.d.cts +535 -0
- package/dist/theory/index.d.ts +535 -0
- package/dist/theory/index.js +149 -0
- package/dist/theory/index.js.map +1 -0
- package/dist/types-MGP29r3t.d.cts +30 -0
- package/dist/types-MGP29r3t.d.ts +30 -0
- package/package.json +27 -2
- package/src/analyze/arrange/index.ts +21 -0
- package/src/analyze/arrange/internal.ts +125 -0
- package/src/analyze/arrange/tension.ts +187 -0
- package/src/analyze/arrange/tracks.ts +279 -0
- package/src/{detect → analyze/detect}/index.ts +4 -4
- package/src/analyze/functional/borrowed.ts +84 -0
- package/src/analyze/functional/cadence.ts +66 -0
- package/src/analyze/functional/function.ts +184 -0
- package/src/analyze/functional/index.ts +23 -0
- package/src/analyze/functional/internal.ts +29 -0
- package/src/{functional/index.ts → analyze/functional/roman.ts} +9 -327
- package/src/analyze/index.ts +49 -0
- package/src/{timeline → analyze/timeline}/index.ts +7 -11
- package/src/{analysis → analyze/voice}/index.ts +8 -5
- package/src/core/index.ts +47 -0
- package/src/{bass → generate/bass}/index.ts +5 -5
- package/src/{countermelody → generate/countermelody}/index.ts +11 -11
- package/src/{drums → generate/drums}/index.ts +2 -2
- package/src/{drums → generate/drums}/rng.ts +2 -2
- package/src/{groove → generate/groove}/index.ts +3 -3
- package/src/{harmonize → generate/harmonize}/index.ts +13 -13
- package/src/generate/index.ts +59 -0
- package/src/{motif → generate/motif}/index.ts +7 -7
- package/src/{progression → generate/progression}/index.ts +11 -25
- package/src/{reharmony → generate/reharmony}/index.ts +11 -11
- package/src/{rhythm → generate/rhythm}/index.ts +2 -2
- package/src/index.ts +130 -117
- package/src/model/chord.ts +423 -0
- package/src/model/index.ts +5 -1096
- package/src/model/interval.ts +82 -0
- package/src/model/key.ts +266 -0
- package/src/model/note.ts +176 -0
- package/src/model/progression.ts +161 -0
- package/src/model/shared.ts +12 -0
- package/src/{chord → theory/chord}/index.ts +19 -1
- package/src/{counterpoint → theory/counterpoint}/index.ts +2 -2
- package/src/theory/index.ts +107 -0
- package/src/{safety → theory/safety}/index.ts +1 -1
- package/src/theory/scale/degrees.ts +123 -0
- package/src/theory/scale/index.ts +28 -0
- package/src/theory/scale/key.ts +56 -0
- package/src/theory/scale/masks.ts +153 -0
- package/src/{spelling → theory/spelling}/index.ts +3 -3
- package/src/{symbol → theory/symbol}/index.ts +8 -1
- package/src/theory/voicing/index.ts +5 -0
- package/src/theory/voicing/internal.ts +168 -0
- package/src/theory/voicing/leading.ts +112 -0
- package/src/theory/voicing/satb.ts +195 -0
- package/src/theory/voicing/styled.ts +176 -0
- package/src/arrange/index.ts +0 -571
- package/src/scale/index.ts +0 -331
- package/src/voicing/index.ts +0 -623
- /package/src/{interval → core/interval}/index.ts +0 -0
- /package/src/{meter → core/meter}/index.ts +0 -0
- /package/src/{pitch → core/pitch}/index.ts +0 -0
- /package/src/{random → core/random}/index.ts +0 -0
- /package/src/{tuning → core/tuning}/index.ts +0 -0
- /package/src/{types.ts → core/types.ts} +0 -0
- /package/src/{drums → generate/drums}/beat.ts +0 -0
- /package/src/{drums → generate/drums}/euclid.ts +0 -0
- /package/src/{drums → generate/drums}/fills.ts +0 -0
- /package/src/{drums → generate/drums}/ghost.ts +0 -0
- /package/src/{drums → generate/drums}/hihat.ts +0 -0
- /package/src/{drums → generate/drums}/hit.ts +0 -0
- /package/src/{drums → generate/drums}/internal.ts +0 -0
- /package/src/{drums → generate/drums}/kick.ts +0 -0
- /package/src/{drums → generate/drums}/percussion.ts +0 -0
- /package/src/{drums → generate/drums}/swing.ts +0 -0
- /package/src/{chordscale → theory/chordscale}/index.ts +0 -0
- /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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
|
|
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:
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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 '
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
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 '
|
|
15
|
-
import { createRng } from '
|
|
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 {
|
|
14
|
-
export {
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
export {
|
|
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 {
|
|
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
|
-
|
|
128
|
-
|
|
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 {
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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';
|