@libraz/libcantus 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/README_ja.md +4 -0
- package/dist/analyze/index.cjs +28 -4
- package/dist/analyze/index.cjs.map +1 -1
- package/dist/analyze/index.d.cts +151 -5
- package/dist/analyze/index.d.ts +151 -5
- package/dist/analyze/index.js +34 -10
- package/dist/{chunk-DSMJRXCZ.cjs → chunk-4R2LWV7E.cjs} +384 -107
- package/dist/chunk-4R2LWV7E.cjs.map +1 -0
- package/dist/{chunk-J7FHVZII.cjs → chunk-B2PW6EHN.cjs} +2000 -30
- package/dist/chunk-B2PW6EHN.cjs.map +1 -0
- package/dist/{chunk-Q6LFSAKV.js → chunk-CPMB7P75.js} +1973 -3
- package/dist/chunk-CPMB7P75.js.map +1 -0
- package/dist/{chunk-H2KJHBW4.js → chunk-GNVN4PPJ.js} +1871 -5
- package/dist/chunk-GNVN4PPJ.js.map +1 -0
- package/dist/{chunk-SGLEQVJH.cjs → chunk-IFZDWIKM.cjs} +1868 -2
- package/dist/chunk-IFZDWIKM.cjs.map +1 -0
- package/dist/{chunk-FBH75DAY.js → chunk-IPEF6NWB.js} +287 -10
- package/dist/chunk-IPEF6NWB.js.map +1 -0
- package/dist/{chunk-HYJJ2V2I.js → chunk-MLBPXA4Z.js} +300 -720
- package/dist/chunk-MLBPXA4Z.js.map +1 -0
- package/dist/{chunk-HWHGOVO6.cjs → chunk-PWC4CRWT.cjs} +1 -1
- package/dist/{chunk-HWHGOVO6.cjs.map → chunk-PWC4CRWT.cjs.map} +1 -1
- package/dist/{chunk-HPVSH7SF.cjs → chunk-YFA7X2F6.cjs} +350 -770
- package/dist/chunk-YFA7X2F6.cjs.map +1 -0
- package/dist/{chunk-NFJ4P6ZZ.js → chunk-ZBUROTJQ.js} +1 -1
- package/dist/generate/index.cjs +15 -3
- package/dist/generate/index.cjs.map +1 -1
- package/dist/generate/index.d.cts +84 -6
- package/dist/generate/index.d.ts +84 -6
- package/dist/generate/index.js +14 -2
- package/dist/{index-BNSM-DSk.d.cts → index-CY-3NVfy.d.cts} +484 -3
- package/dist/{index-BJgP97N1.d.ts → index-zaZdmnU4.d.ts} +484 -3
- package/dist/index.cjs +43 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +48 -12
- package/dist/model/index.cjs +5 -5
- package/dist/model/index.d.cts +203 -7
- package/dist/model/index.d.ts +203 -7
- package/dist/model/index.js +4 -4
- package/dist/{index-DGCNKAUr.d.cts → profile-CQMEqdH9.d.cts} +65 -598
- package/dist/{index-BRMbPkHE.d.ts → profile-DLdlIpS9.d.ts} +65 -598
- package/dist/{index-BBWNZS0f.d.cts → types-D-XgxGvp.d.cts} +1169 -13
- package/dist/{index-CJBBiAmU.d.ts → types-Dh7C064C.d.ts} +1169 -13
- package/package.json +5 -5
- package/dist/chunk-DSMJRXCZ.cjs.map +0 -1
- package/dist/chunk-FBH75DAY.js.map +0 -1
- package/dist/chunk-H2KJHBW4.js.map +0 -1
- package/dist/chunk-HPVSH7SF.cjs.map +0 -1
- package/dist/chunk-HYJJ2V2I.js.map +0 -1
- package/dist/chunk-J7FHVZII.cjs.map +0 -1
- package/dist/chunk-Q6LFSAKV.js.map +0 -1
- package/dist/chunk-SGLEQVJH.cjs.map +0 -1
- /package/dist/{chunk-NFJ4P6ZZ.js.map → chunk-ZBUROTJQ.js.map} +0 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { b as MeterLike } from '../index-BMweUlm5.cjs';
|
|
2
|
+
export { M as MeterChange, c as MeterMap, T as TimeSignature } from '../index-BMweUlm5.cjs';
|
|
1
3
|
import { h as NoteEvent, a as Articulation, b as IntervalLike } from '../index-Cy15oTvh.cjs';
|
|
2
4
|
export { I as IntervalData, c as IntervalQualityLabel, e as KeyScale, g as NoteData, S as SpelledInterval } from '../index-Cy15oTvh.cjs';
|
|
3
5
|
import { e as ChordSegment, c as ChordLike, K as KeyLike } from '../coerce-DRERzdve.cjs';
|
|
4
6
|
export { b as ChordData, d as ChordQuality, g as ChordSpan, i as ChordToneRole, k as KeyVariant, l as PitchSpelling, m as ProfileWeights, n as ResolvedKey, r as SpelledKeyLike, s as SpelledKeyScale } from '../coerce-DRERzdve.cjs';
|
|
5
|
-
|
|
7
|
+
import { h as ChordTimeline } from '../types-D-XgxGvp.cjs';
|
|
8
|
+
export { B as BarPositionProfile, b as BorrowedSource, e as CadenceType, F as FormSection, o as HarmonicFunction, v as MelodicContourShape, y as MotifGraph, z as MotifGraphEdge, G as MotifGraphNode, P as MotifRelationSummary, X as ReductionLevel, Y as ReferenceCadence, Z as ReferenceChord, _ as ReferenceForm, $ as ReferenceHarmony, a0 as ReferenceKeyRegion, a1 as ReferenceMelody, a2 as ReferenceMotif, a3 as ReferencePhrase, a4 as ReferencePhraseMelody, a5 as ReferenceProfile, a7 as RhythmAnalysis } from '../types-D-XgxGvp.cjs';
|
|
6
9
|
import { f as StringedProfile, P as PercussionProfile, c as Limb } from '../positional-DMZer-FM.cjs';
|
|
7
10
|
export { I as InstrumentProfile, a as InstrumentProfileCommon, d as PositionalRng, S as SeedPath } from '../positional-DMZer-FM.cjs';
|
|
8
|
-
import { b as MeterLike } from '../index-BMweUlm5.cjs';
|
|
9
|
-
export { M as MeterChange, c as MeterMap, T as TimeSignature } from '../index-BMweUlm5.cjs';
|
|
10
11
|
export { H as HarmonyRole } from '../index-BL5N2Oyz.cjs';
|
|
11
|
-
import {
|
|
12
|
-
export { B as BAR_STEPS, a as BASS_STYLES, b as BEAT_STEPS, c as BORROWED_DEGREES, d as BassLineOptions, e as BassSegment, f as BassStyle, g as BorrowedChord, C as
|
|
12
|
+
import { x as Genre, w as GenerationContextInput, ah as Vocabulary, y as GridEvent, r as DrumStyle, ac as Section, s as DrumVoice, z as GrooveFeel, p as DrumHit, I as HarmonizeOptions, K as HarmonizeResult, j as CompositionPlan } from '../index-CY-3NVfy.cjs';
|
|
13
|
+
export { B as BAR_STEPS, a as BASS_STYLES, b as BEAT_STEPS, c as BORROWED_DEGREES, d as BassLineOptions, e as BassSegment, f as BassStyle, g as BorrowedChord, C as COMPOSITION_PLAN_VERSION, h as Complexity, i as CompositionEvaluation, k as CompositionPlanOptions, l as CompositionViolation, m as CounterMelodyOptions, D as DRUM_NOTES, n as DeformOptions, o as Draw, q as DrumRole, t as DrumsOptions, E as EuclideanKick, u as EvaluateCompositionOptions, G as GENRES, v as GenerationContext, A as GrooveSlot, F as GrooveStyle, H as GrooveTemplate, J as HarmonizePlacement, L as HumanizeOptions, M as MelodyNote, N as MelodyOptions, O as MotifCell, P as MotifContour, Q as MotifNote, R as MotifOptions, S as MotifTransform, T as ORNAMENT_STYLES, U as OrnamentOptions, V as OrnamentStyle, W as PROVENANCE_BASES, X as PlannedChord, Y as PlannedMotif, Z as PlannedPhrase, _ as PlannedRhythm, $ as PlannedSection, a0 as PreserveWeights, a1 as ProgFunction, a2 as ProgStyle, a3 as ProgressionDegree, a4 as ProgressionOptions, a5 as ProgressionPreset, a6 as Provenance, a7 as ProvenanceBasis, a8 as ResolvedContext, a9 as RhythmEvent, aa as RhythmOptions, ab as STEP_BEATS, ad as SubstituteOptions, ae as Substitution, af as SubstitutionType, ag as SyncopateOptions, ai as VocabularyQuery, aj as applyGrooveTemplate, ak as assertVocabulary, al as deform, am as deriveCompositionPlan, an as developMotif, ao as double, ap as doubleTime, aq as drumVoiceOf, ar as evaluateComposition, as as extractGrooveTemplate, at as fitsQuery, au as generateBassLine, av as generateCounterMelody, aw as generateDrums, ax as generateMelody, ay as generateMotif, az as generateProgression, aA as generateRhythm, aB as gridMetricWeight, aC as halfTime, aD as humanize, aE as mergeVocabulary, aF as modalInterchangePalette, aG as motifToNoteEvents, aH as negativeHarmonyMirror, aI as onsetWeightCurve, aJ as ornament, aK as ornamentBy, aL as pickProgressionPreset, aM as pickVocabulary, aN as progressions, aO as progressionsByStyle, aP as resolveContext, aQ as rhythmDensity, aR as rhythmToNoteEvents, aS as selectVocabulary, aT as substituteChord, aU as syncopate, aV as thin, aW as transformMotif, aX as vocabularyOfKind, aY as withinCeiling } from '../index-CY-3NVfy.cjs';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* The playing-difficulty ceiling, as the generators apply it.
|
|
@@ -717,4 +718,81 @@ declare function classifyMelodyTones(melody: readonly NoteEvent[], ts: MeterLike
|
|
|
717
718
|
*/
|
|
718
719
|
declare function harmonizeMelody(opts: HarmonizeOptions): HarmonizeResult;
|
|
719
720
|
|
|
720
|
-
|
|
721
|
+
/**
|
|
722
|
+
* Reading a {@link CompositionPlan}'s harmony as a chord timeline.
|
|
723
|
+
*
|
|
724
|
+
* Kept apart from the plan types so the public reader can validate its plan
|
|
725
|
+
* without the types module importing the validator that imports it.
|
|
726
|
+
*/
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Read a plan's harmony as a chord timeline.
|
|
730
|
+
*
|
|
731
|
+
* The one way a generator or an evaluator reads chords out of a plan: each
|
|
732
|
+
* entry in `plan.harmony` is resolved against its key and placed at its own
|
|
733
|
+
* beat, so the timeline this returns always agrees with the plan it was built
|
|
734
|
+
* from.
|
|
735
|
+
*
|
|
736
|
+
* @param plan The plan to read harmony from.
|
|
737
|
+
* @returns A chord timeline spanning `plan.span`.
|
|
738
|
+
* @throws {InvalidInputError} If the plan is not a valid composition plan.
|
|
739
|
+
* @example
|
|
740
|
+
* ```ts
|
|
741
|
+
* import { planTimeline, resolveKey } from '@libraz/libcantus';
|
|
742
|
+
* const plan = {
|
|
743
|
+
* planVersion: 1, seed: 0, algorithmVersion: 1,
|
|
744
|
+
* keys: [resolveKey('C major')], meters: [{ startBeat: 0, ts: { numerator: 4, denominator: 4 } }],
|
|
745
|
+
* span: { startBeat: 0, endBeat: 4, bars: 1 }, sections: [], phrases: [],
|
|
746
|
+
* harmony: [{ startBeat: 0, endBeat: 4, key: 0, roman: 'I' }], motifs: [],
|
|
747
|
+
* rhythm: { onsetLevels: [1, 0, 0, 0, 0, 0], interOnsetShares: new Array(17).fill(0).fill(1, 8, 9), syncopation: 0 },
|
|
748
|
+
* };
|
|
749
|
+
* planTimeline(plan).at(0); // the I chord in C major
|
|
750
|
+
* ```
|
|
751
|
+
* @category Composition
|
|
752
|
+
*/
|
|
753
|
+
declare function planTimeline(plan: CompositionPlan): ChordTimeline;
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Boundary validation for {@link CompositionPlan}: a caller can hand this a
|
|
757
|
+
* value restored from JSON, a config file, or a plugin host, and every field
|
|
758
|
+
* is checked before a generator or evaluator reads it. A violation names the
|
|
759
|
+
* path to the offending field, so a malformed document is diagnosed at the
|
|
760
|
+
* field that is wrong rather than wherever the first bad read happens to land.
|
|
761
|
+
*/
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Reject a value that is not a {@link CompositionPlan}.
|
|
765
|
+
*
|
|
766
|
+
* A plan is the shape a caller's stored JSON, a config file, or a plugin host
|
|
767
|
+
* most plausibly hands back malformed: a missing field, a distribution that no
|
|
768
|
+
* longer sums to 1, an index a later edit left dangling, a numeral no reader
|
|
769
|
+
* can parse, a derivation that points at itself or at a later motif. Every
|
|
770
|
+
* field is checked before a generator or evaluator reads it, and a violation
|
|
771
|
+
* names the path to the field that is wrong.
|
|
772
|
+
*
|
|
773
|
+
* @param value The value to check.
|
|
774
|
+
* @param name What the value is, for the error message.
|
|
775
|
+
* @returns The same plan.
|
|
776
|
+
* @throws {InvalidInputError} If the value is not a valid composition plan.
|
|
777
|
+
* @example
|
|
778
|
+
* ```ts
|
|
779
|
+
* import { assertCompositionPlan } from '@libraz/libcantus';
|
|
780
|
+
* import { resolveKey } from '@libraz/libcantus';
|
|
781
|
+
* const plan = {
|
|
782
|
+
* planVersion: 1, seed: 0, algorithmVersion: 1,
|
|
783
|
+
* keys: [resolveKey('C major')],
|
|
784
|
+
* meters: [{ startBeat: 0, ts: { numerator: 4, denominator: 4 } }],
|
|
785
|
+
* span: { startBeat: 0, endBeat: 4, bars: 1 },
|
|
786
|
+
* sections: [{ label: 'A', startBeat: 0, endBeat: 4 }],
|
|
787
|
+
* phrases: [],
|
|
788
|
+
* harmony: [{ startBeat: 0, endBeat: 4, key: 0, roman: 'I' }],
|
|
789
|
+
* motifs: [],
|
|
790
|
+
* rhythm: { onsetLevels: [1, 0, 0, 0, 0, 0], interOnsetShares: new Array(17).fill(0).fill(1, 8, 9), syncopation: 0 },
|
|
791
|
+
* };
|
|
792
|
+
* assertCompositionPlan(plan); // the plan, unchanged
|
|
793
|
+
* ```
|
|
794
|
+
* @category Composition
|
|
795
|
+
*/
|
|
796
|
+
declare function assertCompositionPlan(value: unknown, name?: string): CompositionPlan;
|
|
797
|
+
|
|
798
|
+
export { Articulation, BASS_LICKS, type BassLick, ChordLike, ChordSegment, ChordTimeline, type ClassifiedMelodyTone, CompositionPlan, DRUM_KIT, DRUM_PATTERNS, DrumHit, type DrumPattern, type DrumPatternOptions, type DrumStroke, DrumStyle, type DrumVocabulary, DrumVoice, FILL_ARCHETYPES, FILL_TYPES, type FillArchetype, type FillStroke, type FillType, type FillVelocity, GenerationContextInput, Genre, GridEvent, GrooveFeel, HarmonizeOptions, HarmonizeResult, type ImitationAnswer, type ImitationOptions, IntervalLike, KICK_FIGURES, KICK_STEPS, KeyLike, type KickFigure, type KickPattern, type KickSlot, type LickMaterial, type LickNote, Limb, MAX_DIFFICULTY, MIN_DIFFICULTY, type MelodyToneRole, MeterLike, NoteEvent, PercussionProfile, type PlaceLicksOptions, Section, StringedProfile, Vocabulary, assertCompositionPlan, classifyMelodyTones, harmonizeMelody, imitate, isDrumPattern, isFillArchetype, isLickMaterial, placeDrumPattern, placeLicks, planTimeline, sustainsShift, sustainsStrokes };
|
package/dist/generate/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { b as MeterLike } from '../index-CL4b4gUQ.js';
|
|
2
|
+
export { M as MeterChange, c as MeterMap, T as TimeSignature } from '../index-CL4b4gUQ.js';
|
|
1
3
|
import { h as NoteEvent, a as Articulation, b as IntervalLike } from '../index-Cy15oTvh.js';
|
|
2
4
|
export { I as IntervalData, c as IntervalQualityLabel, e as KeyScale, g as NoteData, S as SpelledInterval } from '../index-Cy15oTvh.js';
|
|
3
5
|
import { e as ChordSegment, c as ChordLike, K as KeyLike } from '../coerce-DP0vYu-x.js';
|
|
4
6
|
export { b as ChordData, d as ChordQuality, g as ChordSpan, i as ChordToneRole, k as KeyVariant, l as PitchSpelling, m as ProfileWeights, n as ResolvedKey, r as SpelledKeyLike, s as SpelledKeyScale } from '../coerce-DP0vYu-x.js';
|
|
5
|
-
|
|
7
|
+
import { h as ChordTimeline } from '../types-Dh7C064C.js';
|
|
8
|
+
export { B as BarPositionProfile, b as BorrowedSource, e as CadenceType, F as FormSection, o as HarmonicFunction, v as MelodicContourShape, y as MotifGraph, z as MotifGraphEdge, G as MotifGraphNode, P as MotifRelationSummary, X as ReductionLevel, Y as ReferenceCadence, Z as ReferenceChord, _ as ReferenceForm, $ as ReferenceHarmony, a0 as ReferenceKeyRegion, a1 as ReferenceMelody, a2 as ReferenceMotif, a3 as ReferencePhrase, a4 as ReferencePhraseMelody, a5 as ReferenceProfile, a7 as RhythmAnalysis } from '../types-Dh7C064C.js';
|
|
6
9
|
import { f as StringedProfile, P as PercussionProfile, c as Limb } from '../positional-DJgs6ltD.js';
|
|
7
10
|
export { I as InstrumentProfile, a as InstrumentProfileCommon, d as PositionalRng, S as SeedPath } from '../positional-DJgs6ltD.js';
|
|
8
|
-
import { b as MeterLike } from '../index-CL4b4gUQ.js';
|
|
9
|
-
export { M as MeterChange, c as MeterMap, T as TimeSignature } from '../index-CL4b4gUQ.js';
|
|
10
11
|
export { H as HarmonyRole } from '../index-Dw2DP7vm.js';
|
|
11
|
-
import {
|
|
12
|
-
export { B as BAR_STEPS, a as BASS_STYLES, b as BEAT_STEPS, c as BORROWED_DEGREES, d as BassLineOptions, e as BassSegment, f as BassStyle, g as BorrowedChord, C as
|
|
12
|
+
import { x as Genre, w as GenerationContextInput, ah as Vocabulary, y as GridEvent, r as DrumStyle, ac as Section, s as DrumVoice, z as GrooveFeel, p as DrumHit, I as HarmonizeOptions, K as HarmonizeResult, j as CompositionPlan } from '../index-zaZdmnU4.js';
|
|
13
|
+
export { B as BAR_STEPS, a as BASS_STYLES, b as BEAT_STEPS, c as BORROWED_DEGREES, d as BassLineOptions, e as BassSegment, f as BassStyle, g as BorrowedChord, C as COMPOSITION_PLAN_VERSION, h as Complexity, i as CompositionEvaluation, k as CompositionPlanOptions, l as CompositionViolation, m as CounterMelodyOptions, D as DRUM_NOTES, n as DeformOptions, o as Draw, q as DrumRole, t as DrumsOptions, E as EuclideanKick, u as EvaluateCompositionOptions, G as GENRES, v as GenerationContext, A as GrooveSlot, F as GrooveStyle, H as GrooveTemplate, J as HarmonizePlacement, L as HumanizeOptions, M as MelodyNote, N as MelodyOptions, O as MotifCell, P as MotifContour, Q as MotifNote, R as MotifOptions, S as MotifTransform, T as ORNAMENT_STYLES, U as OrnamentOptions, V as OrnamentStyle, W as PROVENANCE_BASES, X as PlannedChord, Y as PlannedMotif, Z as PlannedPhrase, _ as PlannedRhythm, $ as PlannedSection, a0 as PreserveWeights, a1 as ProgFunction, a2 as ProgStyle, a3 as ProgressionDegree, a4 as ProgressionOptions, a5 as ProgressionPreset, a6 as Provenance, a7 as ProvenanceBasis, a8 as ResolvedContext, a9 as RhythmEvent, aa as RhythmOptions, ab as STEP_BEATS, ad as SubstituteOptions, ae as Substitution, af as SubstitutionType, ag as SyncopateOptions, ai as VocabularyQuery, aj as applyGrooveTemplate, ak as assertVocabulary, al as deform, am as deriveCompositionPlan, an as developMotif, ao as double, ap as doubleTime, aq as drumVoiceOf, ar as evaluateComposition, as as extractGrooveTemplate, at as fitsQuery, au as generateBassLine, av as generateCounterMelody, aw as generateDrums, ax as generateMelody, ay as generateMotif, az as generateProgression, aA as generateRhythm, aB as gridMetricWeight, aC as halfTime, aD as humanize, aE as mergeVocabulary, aF as modalInterchangePalette, aG as motifToNoteEvents, aH as negativeHarmonyMirror, aI as onsetWeightCurve, aJ as ornament, aK as ornamentBy, aL as pickProgressionPreset, aM as pickVocabulary, aN as progressions, aO as progressionsByStyle, aP as resolveContext, aQ as rhythmDensity, aR as rhythmToNoteEvents, aS as selectVocabulary, aT as substituteChord, aU as syncopate, aV as thin, aW as transformMotif, aX as vocabularyOfKind, aY as withinCeiling } from '../index-zaZdmnU4.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* The playing-difficulty ceiling, as the generators apply it.
|
|
@@ -717,4 +718,81 @@ declare function classifyMelodyTones(melody: readonly NoteEvent[], ts: MeterLike
|
|
|
717
718
|
*/
|
|
718
719
|
declare function harmonizeMelody(opts: HarmonizeOptions): HarmonizeResult;
|
|
719
720
|
|
|
720
|
-
|
|
721
|
+
/**
|
|
722
|
+
* Reading a {@link CompositionPlan}'s harmony as a chord timeline.
|
|
723
|
+
*
|
|
724
|
+
* Kept apart from the plan types so the public reader can validate its plan
|
|
725
|
+
* without the types module importing the validator that imports it.
|
|
726
|
+
*/
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Read a plan's harmony as a chord timeline.
|
|
730
|
+
*
|
|
731
|
+
* The one way a generator or an evaluator reads chords out of a plan: each
|
|
732
|
+
* entry in `plan.harmony` is resolved against its key and placed at its own
|
|
733
|
+
* beat, so the timeline this returns always agrees with the plan it was built
|
|
734
|
+
* from.
|
|
735
|
+
*
|
|
736
|
+
* @param plan The plan to read harmony from.
|
|
737
|
+
* @returns A chord timeline spanning `plan.span`.
|
|
738
|
+
* @throws {InvalidInputError} If the plan is not a valid composition plan.
|
|
739
|
+
* @example
|
|
740
|
+
* ```ts
|
|
741
|
+
* import { planTimeline, resolveKey } from '@libraz/libcantus';
|
|
742
|
+
* const plan = {
|
|
743
|
+
* planVersion: 1, seed: 0, algorithmVersion: 1,
|
|
744
|
+
* keys: [resolveKey('C major')], meters: [{ startBeat: 0, ts: { numerator: 4, denominator: 4 } }],
|
|
745
|
+
* span: { startBeat: 0, endBeat: 4, bars: 1 }, sections: [], phrases: [],
|
|
746
|
+
* harmony: [{ startBeat: 0, endBeat: 4, key: 0, roman: 'I' }], motifs: [],
|
|
747
|
+
* rhythm: { onsetLevels: [1, 0, 0, 0, 0, 0], interOnsetShares: new Array(17).fill(0).fill(1, 8, 9), syncopation: 0 },
|
|
748
|
+
* };
|
|
749
|
+
* planTimeline(plan).at(0); // the I chord in C major
|
|
750
|
+
* ```
|
|
751
|
+
* @category Composition
|
|
752
|
+
*/
|
|
753
|
+
declare function planTimeline(plan: CompositionPlan): ChordTimeline;
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Boundary validation for {@link CompositionPlan}: a caller can hand this a
|
|
757
|
+
* value restored from JSON, a config file, or a plugin host, and every field
|
|
758
|
+
* is checked before a generator or evaluator reads it. A violation names the
|
|
759
|
+
* path to the offending field, so a malformed document is diagnosed at the
|
|
760
|
+
* field that is wrong rather than wherever the first bad read happens to land.
|
|
761
|
+
*/
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Reject a value that is not a {@link CompositionPlan}.
|
|
765
|
+
*
|
|
766
|
+
* A plan is the shape a caller's stored JSON, a config file, or a plugin host
|
|
767
|
+
* most plausibly hands back malformed: a missing field, a distribution that no
|
|
768
|
+
* longer sums to 1, an index a later edit left dangling, a numeral no reader
|
|
769
|
+
* can parse, a derivation that points at itself or at a later motif. Every
|
|
770
|
+
* field is checked before a generator or evaluator reads it, and a violation
|
|
771
|
+
* names the path to the field that is wrong.
|
|
772
|
+
*
|
|
773
|
+
* @param value The value to check.
|
|
774
|
+
* @param name What the value is, for the error message.
|
|
775
|
+
* @returns The same plan.
|
|
776
|
+
* @throws {InvalidInputError} If the value is not a valid composition plan.
|
|
777
|
+
* @example
|
|
778
|
+
* ```ts
|
|
779
|
+
* import { assertCompositionPlan } from '@libraz/libcantus';
|
|
780
|
+
* import { resolveKey } from '@libraz/libcantus';
|
|
781
|
+
* const plan = {
|
|
782
|
+
* planVersion: 1, seed: 0, algorithmVersion: 1,
|
|
783
|
+
* keys: [resolveKey('C major')],
|
|
784
|
+
* meters: [{ startBeat: 0, ts: { numerator: 4, denominator: 4 } }],
|
|
785
|
+
* span: { startBeat: 0, endBeat: 4, bars: 1 },
|
|
786
|
+
* sections: [{ label: 'A', startBeat: 0, endBeat: 4 }],
|
|
787
|
+
* phrases: [],
|
|
788
|
+
* harmony: [{ startBeat: 0, endBeat: 4, key: 0, roman: 'I' }],
|
|
789
|
+
* motifs: [],
|
|
790
|
+
* rhythm: { onsetLevels: [1, 0, 0, 0, 0, 0], interOnsetShares: new Array(17).fill(0).fill(1, 8, 9), syncopation: 0 },
|
|
791
|
+
* };
|
|
792
|
+
* assertCompositionPlan(plan); // the plan, unchanged
|
|
793
|
+
* ```
|
|
794
|
+
* @category Composition
|
|
795
|
+
*/
|
|
796
|
+
declare function assertCompositionPlan(value: unknown, name?: string): CompositionPlan;
|
|
797
|
+
|
|
798
|
+
export { Articulation, BASS_LICKS, type BassLick, ChordLike, ChordSegment, ChordTimeline, type ClassifiedMelodyTone, CompositionPlan, DRUM_KIT, DRUM_PATTERNS, DrumHit, type DrumPattern, type DrumPatternOptions, type DrumStroke, DrumStyle, type DrumVocabulary, DrumVoice, FILL_ARCHETYPES, FILL_TYPES, type FillArchetype, type FillStroke, type FillType, type FillVelocity, GenerationContextInput, Genre, GridEvent, GrooveFeel, HarmonizeOptions, HarmonizeResult, type ImitationAnswer, type ImitationOptions, IntervalLike, KICK_FIGURES, KICK_STEPS, KeyLike, type KickFigure, type KickPattern, type KickSlot, type LickMaterial, type LickNote, Limb, MAX_DIFFICULTY, MIN_DIFFICULTY, type MelodyToneRole, MeterLike, NoteEvent, PercussionProfile, type PlaceLicksOptions, Section, StringedProfile, Vocabulary, assertCompositionPlan, classifyMelodyTones, harmonizeMelody, imitate, isDrumPattern, isFillArchetype, isLickMaterial, placeDrumPattern, placeLicks, planTimeline, sustainsShift, sustainsStrokes };
|
package/dist/generate/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
BASS_STYLES,
|
|
5
5
|
BEAT_STEPS,
|
|
6
6
|
BORROWED_DEGREES,
|
|
7
|
+
COMPOSITION_PLAN_VERSION,
|
|
7
8
|
DRUM_KIT,
|
|
8
9
|
DRUM_NOTES,
|
|
9
10
|
DRUM_PATTERNS,
|
|
@@ -18,18 +19,22 @@ import {
|
|
|
18
19
|
PROVENANCE_BASES,
|
|
19
20
|
STEP_BEATS,
|
|
20
21
|
applyGrooveTemplate,
|
|
22
|
+
assertCompositionPlan,
|
|
21
23
|
assertVocabulary,
|
|
22
24
|
classifyMelodyTones,
|
|
23
25
|
deform,
|
|
26
|
+
deriveCompositionPlan,
|
|
24
27
|
developMotif,
|
|
25
28
|
double,
|
|
26
29
|
doubleTime,
|
|
27
30
|
drumVoiceOf,
|
|
31
|
+
evaluateComposition,
|
|
28
32
|
extractGrooveTemplate,
|
|
29
33
|
fitsQuery,
|
|
30
34
|
generateBassLine,
|
|
31
35
|
generateCounterMelody,
|
|
32
36
|
generateDrums,
|
|
37
|
+
generateMelody,
|
|
33
38
|
generateMotif,
|
|
34
39
|
generateProgression,
|
|
35
40
|
generateRhythm,
|
|
@@ -52,6 +57,7 @@ import {
|
|
|
52
57
|
pickVocabulary,
|
|
53
58
|
placeDrumPattern,
|
|
54
59
|
placeLicks,
|
|
60
|
+
planTimeline,
|
|
55
61
|
progressions,
|
|
56
62
|
progressionsByStyle,
|
|
57
63
|
resolveContext,
|
|
@@ -66,8 +72,8 @@ import {
|
|
|
66
72
|
transformMotif,
|
|
67
73
|
vocabularyOfKind,
|
|
68
74
|
withinCeiling
|
|
69
|
-
} from "../chunk-
|
|
70
|
-
import "../chunk-
|
|
75
|
+
} from "../chunk-CPMB7P75.js";
|
|
76
|
+
import "../chunk-GNVN4PPJ.js";
|
|
71
77
|
import "../chunk-7KG3RTYS.js";
|
|
72
78
|
import "../chunk-PUKJP2Z5.js";
|
|
73
79
|
import "../chunk-NB25P3EH.js";
|
|
@@ -79,6 +85,7 @@ export {
|
|
|
79
85
|
BASS_STYLES,
|
|
80
86
|
BEAT_STEPS,
|
|
81
87
|
BORROWED_DEGREES,
|
|
88
|
+
COMPOSITION_PLAN_VERSION,
|
|
82
89
|
DRUM_KIT,
|
|
83
90
|
DRUM_NOTES,
|
|
84
91
|
DRUM_PATTERNS,
|
|
@@ -93,18 +100,22 @@ export {
|
|
|
93
100
|
PROVENANCE_BASES,
|
|
94
101
|
STEP_BEATS,
|
|
95
102
|
applyGrooveTemplate,
|
|
103
|
+
assertCompositionPlan,
|
|
96
104
|
assertVocabulary,
|
|
97
105
|
classifyMelodyTones,
|
|
98
106
|
deform,
|
|
107
|
+
deriveCompositionPlan,
|
|
99
108
|
developMotif,
|
|
100
109
|
double,
|
|
101
110
|
doubleTime,
|
|
102
111
|
drumVoiceOf,
|
|
112
|
+
evaluateComposition,
|
|
103
113
|
extractGrooveTemplate,
|
|
104
114
|
fitsQuery,
|
|
105
115
|
generateBassLine,
|
|
106
116
|
generateCounterMelody,
|
|
107
117
|
generateDrums,
|
|
118
|
+
generateMelody,
|
|
108
119
|
generateMotif,
|
|
109
120
|
generateProgression,
|
|
110
121
|
generateRhythm,
|
|
@@ -127,6 +138,7 @@ export {
|
|
|
127
138
|
pickVocabulary,
|
|
128
139
|
placeDrumPattern,
|
|
129
140
|
placeLicks,
|
|
141
|
+
planTimeline,
|
|
130
142
|
progressions,
|
|
131
143
|
progressionsByStyle,
|
|
132
144
|
resolveContext,
|