@libraz/libcantus 1.2.0 → 1.4.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/NOTICE +63 -0
- package/README.md +7 -1
- package/README_ja.md +17 -11
- package/dist/analyze/index.cjs +31 -7
- package/dist/analyze/index.cjs.map +1 -1
- package/dist/analyze/index.d.cts +161 -13
- package/dist/analyze/index.d.ts +161 -13
- package/dist/analyze/index.js +37 -13
- package/dist/{chunk-NB25P3EH.js → chunk-2G5MCGYU.js} +33 -11
- package/dist/chunk-2G5MCGYU.js.map +1 -0
- package/dist/{chunk-NM7UAMC3.cjs → chunk-3FDBMIPR.cjs} +64 -64
- package/dist/chunk-3FDBMIPR.cjs.map +1 -0
- package/dist/{chunk-HPVSH7SF.cjs → chunk-3MDOEFIQ.cjs} +618 -954
- package/dist/chunk-3MDOEFIQ.cjs.map +1 -0
- package/dist/{chunk-FBH75DAY.js → chunk-5MWRBYAT.js} +560 -159
- package/dist/chunk-5MWRBYAT.js.map +1 -0
- package/dist/{chunk-J7FHVZII.cjs → chunk-6TTBEON3.cjs} +3074 -740
- package/dist/chunk-6TTBEON3.cjs.map +1 -0
- package/dist/{chunk-UMWZ4ZET.js → chunk-7NQ6AL3H.js} +4 -4
- package/dist/chunk-7NQ6AL3H.js.map +1 -0
- package/dist/{chunk-HWHGOVO6.cjs → chunk-E3QO3UET.cjs} +31 -23
- package/dist/chunk-E3QO3UET.cjs.map +1 -0
- package/dist/{chunk-H2KJHBW4.js → chunk-FJFULJZE.js} +2375 -191
- package/dist/chunk-FJFULJZE.js.map +1 -0
- package/dist/{chunk-Q6LFSAKV.js → chunk-FK3DGAIZ.js} +2657 -323
- package/dist/chunk-FK3DGAIZ.js.map +1 -0
- package/dist/chunk-GEDTJHAC.cjs.map +1 -1
- package/dist/{chunk-RFIBF2RR.js → chunk-H7FVMBUC.js} +138 -65
- package/dist/chunk-H7FVMBUC.js.map +1 -0
- package/dist/{chunk-DSMJRXCZ.cjs → chunk-HYSVSFNI.cjs} +931 -530
- package/dist/chunk-HYSVSFNI.cjs.map +1 -0
- package/dist/{chunk-35NBV2FT.cjs → chunk-KMYGRFZ6.cjs} +47 -24
- package/dist/chunk-KMYGRFZ6.cjs.map +1 -0
- package/dist/chunk-LQZQDBCD.cjs +5513 -0
- package/dist/chunk-LQZQDBCD.cjs.map +1 -0
- package/dist/{chunk-PM4XJE2Y.cjs → chunk-P3CPXAJ5.cjs} +76 -54
- package/dist/chunk-P3CPXAJ5.cjs.map +1 -0
- package/dist/{chunk-S5BKZZGM.cjs → chunk-S3QELJUE.cjs} +72 -56
- package/dist/chunk-S3QELJUE.cjs.map +1 -0
- package/dist/{chunk-PUKJP2Z5.js → chunk-TXFWSU5D.js} +31 -8
- package/dist/chunk-TXFWSU5D.js.map +1 -0
- package/dist/{chunk-76ZBTRG2.cjs → chunk-U4EQTDGN.cjs} +258 -218
- package/dist/chunk-U4EQTDGN.cjs.map +1 -0
- package/dist/chunk-UGLFDG7L.cjs.map +1 -1
- package/dist/{chunk-HYJJ2V2I.js → chunk-UTE5A36R.js} +483 -819
- package/dist/chunk-UTE5A36R.js.map +1 -0
- package/dist/{chunk-NFJ4P6ZZ.js → chunk-UZKQISRF.js} +17 -9
- package/dist/chunk-UZKQISRF.js.map +1 -0
- package/dist/{chunk-7KG3RTYS.js → chunk-VL5NXVCN.js} +281 -155
- package/dist/chunk-VL5NXVCN.js.map +1 -0
- package/dist/{chunk-CGBADIO5.cjs → chunk-WOMCXN2W.cjs} +328 -202
- package/dist/chunk-WOMCXN2W.cjs.map +1 -0
- package/dist/{chunk-3R3QVKY5.cjs → chunk-YDGMWH43.cjs} +397 -324
- package/dist/chunk-YDGMWH43.cjs.map +1 -0
- package/dist/{chunk-AGOVW7U6.js → chunk-YYVXRV3V.js} +72 -56
- package/dist/chunk-YYVXRV3V.js.map +1 -0
- package/dist/{chunk-M5RYMAFI.js → chunk-ZLNSH4UL.js} +71 -31
- package/dist/chunk-ZLNSH4UL.js.map +1 -0
- package/dist/{coerce-DRERzdve.d.cts → coerce-CUhHc3Tu.d.ts} +16 -8
- package/dist/{coerce-DP0vYu-x.d.ts → coerce-Ytt2Eiq9.d.cts} +16 -8
- package/dist/core/index.cjs +5 -5
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +9 -8
- package/dist/core/index.d.ts +9 -8
- package/dist/core/index.js +4 -4
- package/dist/generate/index.cjs +20 -8
- package/dist/generate/index.cjs.map +1 -1
- package/dist/generate/index.d.cts +105 -17
- package/dist/generate/index.d.ts +105 -17
- package/dist/generate/index.js +19 -7
- package/dist/{index-CL4b4gUQ.d.ts → index-5VJgKz_Q.d.cts} +6 -2
- package/dist/{index-B9QLziDe.d.cts → index-BLuDesVG.d.ts} +20 -13
- package/dist/{index-BHIUyjhZ.d.ts → index-BV6APVa6.d.cts} +20 -13
- package/dist/{index-BMweUlm5.d.cts → index-Bf0Sv8a9.d.ts} +6 -2
- package/dist/{index-Dw2DP7vm.d.ts → index-BkT21EMv.d.cts} +3 -2
- package/dist/{index-BL5N2Oyz.d.cts → index-C7KCaTRz.d.ts} +3 -2
- package/dist/{index-Cy15oTvh.d.ts → index-C9MYbuKS.d.cts} +7 -3
- package/dist/{index-Cy15oTvh.d.cts → index-C9MYbuKS.d.ts} +7 -3
- package/dist/{index-BNSM-DSk.d.cts → index-DVInzCDS.d.cts} +533 -28
- package/dist/{index-9eoQs2C1.d.ts → index-Dg-SAfhz.d.ts} +6 -4
- package/dist/{index-BJgP97N1.d.ts → index-jgeug9EA.d.ts} +533 -28
- package/dist/{index-cHvbYgJI.d.cts → index-pQihL4z7.d.cts} +6 -4
- package/dist/index.cjs +49 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +55 -19
- package/dist/{masks-Cc7-MzzY.d.ts → masks-BnzXnBj0.d.cts} +3 -2
- package/dist/{masks-pADfTOiD.d.cts → masks-tycmkrgs.d.ts} +3 -2
- package/dist/model/index.cjs +12 -12
- package/dist/model/index.cjs.map +1 -1
- package/dist/model/index.d.cts +259 -48
- package/dist/model/index.d.ts +259 -48
- package/dist/model/index.js +11 -11
- package/dist/{positional-DJgs6ltD.d.ts → positional-CscpxtlE.d.cts} +3 -2
- package/dist/{positional-DMZer-FM.d.cts → positional-DLnfUgqG.d.ts} +3 -2
- package/dist/{index-BRMbPkHE.d.ts → profile-B4WqcM4H.d.ts} +85 -610
- package/dist/{index-DGCNKAUr.d.cts → profile-BJd1XkPB.d.cts} +85 -610
- package/dist/theory/index.cjs +5 -5
- package/dist/theory/index.cjs.map +1 -1
- package/dist/theory/index.d.cts +18 -14
- package/dist/theory/index.d.ts +18 -14
- package/dist/theory/index.js +4 -4
- package/dist/{index-CJBBiAmU.d.ts → types-7mGFwvMm.d.ts} +1210 -31
- package/dist/{index-BBWNZS0f.d.cts → types-_ofpb2be.d.cts} +1210 -31
- package/package.json +13 -13
- package/dist/chunk-35NBV2FT.cjs.map +0 -1
- package/dist/chunk-3R3QVKY5.cjs.map +0 -1
- package/dist/chunk-76ZBTRG2.cjs.map +0 -1
- package/dist/chunk-7KG3RTYS.js.map +0 -1
- package/dist/chunk-AGOVW7U6.js.map +0 -1
- package/dist/chunk-CGBADIO5.cjs.map +0 -1
- 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-HWHGOVO6.cjs.map +0 -1
- package/dist/chunk-HYJJ2V2I.js.map +0 -1
- package/dist/chunk-J7FHVZII.cjs.map +0 -1
- package/dist/chunk-M5RYMAFI.js.map +0 -1
- package/dist/chunk-NB25P3EH.js.map +0 -1
- package/dist/chunk-NFJ4P6ZZ.js.map +0 -1
- package/dist/chunk-NM7UAMC3.cjs.map +0 -1
- package/dist/chunk-PM4XJE2Y.cjs.map +0 -1
- package/dist/chunk-PUKJP2Z5.js.map +0 -1
- package/dist/chunk-Q6LFSAKV.js.map +0 -1
- package/dist/chunk-RFIBF2RR.js.map +0 -1
- package/dist/chunk-S5BKZZGM.cjs.map +0 -1
- package/dist/chunk-SGLEQVJH.cjs +0 -3329
- package/dist/chunk-SGLEQVJH.cjs.map +0 -1
- package/dist/chunk-UMWZ4ZET.js.map +0 -1
package/dist/generate/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { b as MeterLike } from '../index-Bf0Sv8a9.js';
|
|
2
|
+
export { M as MeterChange, c as MeterMap, T as TimeSignature } from '../index-Bf0Sv8a9.js';
|
|
3
|
+
import { h as NoteEvent, a as Articulation, b as IntervalLike } from '../index-C9MYbuKS.js';
|
|
4
|
+
export { I as IntervalData, c as IntervalQualityLabel, e as KeyScale, g as NoteData, S as SpelledInterval } from '../index-C9MYbuKS.js';
|
|
5
|
+
import { e as ChordSegment, c as ChordLike, K as KeyLike } from '../coerce-CUhHc3Tu.js';
|
|
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-CUhHc3Tu.js';
|
|
7
|
+
import { h as ChordTimeline } from '../types-7mGFwvMm.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-7mGFwvMm.js';
|
|
9
|
+
import { f as StringedProfile, P as PercussionProfile, c as Limb } from '../positional-DLnfUgqG.js';
|
|
10
|
+
export { I as InstrumentProfile, a as InstrumentProfileCommon, d as PositionalRng, S as SeedPath } from '../positional-DLnfUgqG.js';
|
|
11
|
+
export { H as HarmonyRole } from '../index-C7KCaTRz.js';
|
|
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-jgeug9EA.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-jgeug9EA.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* The playing-difficulty ceiling, as the generators apply it.
|
|
@@ -293,7 +294,8 @@ type ImitationOptions = {
|
|
|
293
294
|
* `interval`: literally for a real answer, by scale degree for a tonal one, and
|
|
294
295
|
* upside down first when `invert` is set. Inversion mirrors about the first note
|
|
295
296
|
* of the copied span, so the answer starts where the transposition puts that
|
|
296
|
-
* note either way. In a tonal answer a pitch
|
|
297
|
+
* note either way, whether or not it is in the key. In a tonal answer a pitch
|
|
298
|
+
* outside the key keeps its distance
|
|
297
299
|
* from the scale tone below it, and inversion mirrors that distance too — a
|
|
298
300
|
* chromatic passing note stays a chromatic passing note, on the other side.
|
|
299
301
|
* Where a mirrored chromatic note falls into a diatonic semitone the key leaves
|
|
@@ -332,6 +334,8 @@ declare function imitate(lead: readonly NoteEvent[], opts: ImitationOptions): No
|
|
|
332
334
|
declare const FILL_TYPES: readonly ["snareRoll", "tomDescend", "tomAscend", "snareTomCombo", "simpleCrash", "linearFill", "ghostToAccent", "bdSnareAlternate", "hiHatChoke", "tomShuffle", "breakdownFill", "flamsAndDrags", "halfTimeFill"];
|
|
333
335
|
/** The thirteen fill archetypes for section transitions. */
|
|
334
336
|
type FillType = (typeof FILL_TYPES)[number];
|
|
337
|
+
/** The bases a fill stroke's velocity is read against, in declaration order. */
|
|
338
|
+
declare const FILL_VELOCITY_BASES: readonly ["fill", "accent"];
|
|
335
339
|
/**
|
|
336
340
|
* How loud one stroke of a fill is.
|
|
337
341
|
*
|
|
@@ -342,7 +346,7 @@ type FillType = (typeof FILL_TYPES)[number];
|
|
|
342
346
|
* arithmetic at every beat line falls back in the middle of itself.
|
|
343
347
|
*/
|
|
344
348
|
type FillVelocity = {
|
|
345
|
-
base:
|
|
349
|
+
base: (typeof FILL_VELOCITY_BASES)[number];
|
|
346
350
|
/** Factor on the base, for a crescendo or a ghosted stroke. */
|
|
347
351
|
scale?: number;
|
|
348
352
|
/** Fixed offset in MIDI velocity, for a stroke a little above or below. */
|
|
@@ -651,7 +655,11 @@ type ClassifiedMelodyTone = {
|
|
|
651
655
|
* predecessor and successor has no figure to belong to and stays structural, so
|
|
652
656
|
* the first and last notes of a phrase are always structural.
|
|
653
657
|
*
|
|
654
|
-
*
|
|
658
|
+
* The notes are read in onset order, ties by pitch, whatever order they are
|
|
659
|
+
* listed in. A note of zero length sounds nothing: it is structural and is no
|
|
660
|
+
* other note's neighbour.
|
|
661
|
+
*
|
|
662
|
+
* @param melody The melody, in any order.
|
|
655
663
|
* @param ts Time signature used to weight metric accents.
|
|
656
664
|
* @returns One classification per input note, in input order.
|
|
657
665
|
* @example
|
|
@@ -687,7 +695,9 @@ declare function classifyMelodyTones(melody: readonly NoteEvent[], ts: MeterLike
|
|
|
687
695
|
* the grid.
|
|
688
696
|
*
|
|
689
697
|
* With `placement.transposeSearch` the melody is moved into the key it is
|
|
690
|
-
* harmonized in, and `transposeSemitones` reports how far
|
|
698
|
+
* harmonized in, and `transposeSemitones` reports how far: the shifts that
|
|
699
|
+
* leave the fewest beats of the melody outside the key are kept, and the
|
|
700
|
+
* harmonization cost and the register choose among them; with
|
|
691
701
|
* `placement.octaveSearch` it is moved by octaves into a comfortable register,
|
|
692
702
|
* which leaves the key and the chords untouched. Both may be set, and the
|
|
693
703
|
* reported shift is their sum.
|
|
@@ -717,4 +727,82 @@ declare function classifyMelodyTones(melody: readonly NoteEvent[], ts: MeterLike
|
|
|
717
727
|
*/
|
|
718
728
|
declare function harmonizeMelody(opts: HarmonizeOptions): HarmonizeResult;
|
|
719
729
|
|
|
720
|
-
|
|
730
|
+
/**
|
|
731
|
+
* Reading a {@link CompositionPlan}'s harmony as a chord timeline.
|
|
732
|
+
*
|
|
733
|
+
* Kept apart from the plan types so the public reader can validate its plan
|
|
734
|
+
* without the types module importing the validator that imports it.
|
|
735
|
+
*/
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Read a plan's harmony as a chord timeline.
|
|
739
|
+
*
|
|
740
|
+
* The one way a generator or an evaluator reads chords out of a plan: each
|
|
741
|
+
* entry in `plan.harmony` is resolved against its key and placed at its own
|
|
742
|
+
* beat, so the timeline this returns always agrees with the plan it was built
|
|
743
|
+
* from.
|
|
744
|
+
*
|
|
745
|
+
* @param plan The plan to read harmony from.
|
|
746
|
+
* @returns A chord timeline spanning `plan.span`.
|
|
747
|
+
* @throws {InvalidInputError} If the plan is not a valid composition plan.
|
|
748
|
+
* @example
|
|
749
|
+
* ```ts
|
|
750
|
+
* import { planTimeline, resolveKey } from '@libraz/libcantus';
|
|
751
|
+
* const plan = {
|
|
752
|
+
* planVersion: 1, seed: 0, algorithmVersion: 1,
|
|
753
|
+
* keys: [resolveKey('C major')], meters: [{ startBeat: 0, ts: { numerator: 4, denominator: 4 } }],
|
|
754
|
+
* span: { startBeat: 0, endBeat: 4, bars: 1 }, sections: [], phrases: [],
|
|
755
|
+
* harmony: [{ startBeat: 0, endBeat: 4, key: 0, roman: 'I' }], motifs: [],
|
|
756
|
+
* rhythm: { onsetLevels: [1, 0, 0, 0, 0, 0], interOnsetShares: new Array(17).fill(0).fill(1, 8, 9), syncopation: 0 },
|
|
757
|
+
* };
|
|
758
|
+
* planTimeline(plan).at(0); // the I chord in C major
|
|
759
|
+
* ```
|
|
760
|
+
* @category Composition
|
|
761
|
+
*/
|
|
762
|
+
declare function planTimeline(plan: CompositionPlan): ChordTimeline;
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Boundary validation for {@link CompositionPlan}: a caller can hand this a
|
|
766
|
+
* value restored from JSON, a config file, or a plugin host, and every field
|
|
767
|
+
* is checked before a generator or evaluator reads it. A violation names the
|
|
768
|
+
* path to the offending field, so a malformed document is diagnosed at the
|
|
769
|
+
* field that is wrong rather than wherever the first bad read happens to land.
|
|
770
|
+
*/
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Reject a value that is not a {@link CompositionPlan}.
|
|
774
|
+
*
|
|
775
|
+
* A plan is the shape a caller's stored JSON, a config file, or a plugin host
|
|
776
|
+
* most plausibly hands back malformed: a missing field, a distribution that no
|
|
777
|
+
* longer sums to 1, an index a later edit left dangling, a numeral no reader
|
|
778
|
+
* can parse, a derivation that points at itself or at a later motif. Every
|
|
779
|
+
* field is checked before a generator or evaluator reads it, and a violation
|
|
780
|
+
* names the path to the field that is wrong.
|
|
781
|
+
*
|
|
782
|
+
* @param value The value to check.
|
|
783
|
+
* @param name What the value is, for the error message.
|
|
784
|
+
* @returns The same plan.
|
|
785
|
+
* @throws {InvalidInputError} If the value is not a valid composition plan.
|
|
786
|
+
* @example
|
|
787
|
+
* ```ts
|
|
788
|
+
* import { assertCompositionPlan } from '@libraz/libcantus';
|
|
789
|
+
* import { resolveKey } from '@libraz/libcantus';
|
|
790
|
+
* const plan = {
|
|
791
|
+
* planVersion: 1, seed: 0, algorithmVersion: 1,
|
|
792
|
+
* keys: [resolveKey('C major')],
|
|
793
|
+
* meters: [{ startBeat: 0, ts: { numerator: 4, denominator: 4 } }],
|
|
794
|
+
* span: { startBeat: 0, endBeat: 4, bars: 1 },
|
|
795
|
+
* sections: [{ label: 'A', startBeat: 0, endBeat: 4 }],
|
|
796
|
+
* phrases: [],
|
|
797
|
+
* harmony: [{ startBeat: 0, endBeat: 4, key: 0, roman: 'I' }],
|
|
798
|
+
* motifs: [],
|
|
799
|
+
* rhythm: { onsetLevels: [1, 0, 0, 0, 0, 0], interOnsetShares: new Array(17).fill(0).fill(1, 8, 9), syncopation: 0 },
|
|
800
|
+
* };
|
|
801
|
+
* assertCompositionPlan(plan); // the plan, unchanged
|
|
802
|
+
* ```
|
|
803
|
+
* @category Composition
|
|
804
|
+
*/
|
|
805
|
+
declare function assertCompositionPlan(value: unknown, name?: string): CompositionPlan;
|
|
806
|
+
|
|
807
|
+
export { Articulation, BASS_LICKS, ChordLike, ChordSegment, ChordTimeline, CompositionPlan, DRUM_KIT, DRUM_PATTERNS, DrumHit, DrumStyle, DrumVoice, FILL_ARCHETYPES, FILL_TYPES, GenerationContextInput, Genre, GridEvent, GrooveFeel, HarmonizeOptions, HarmonizeResult, IntervalLike, KICK_FIGURES, KICK_STEPS, KeyLike, Limb, MAX_DIFFICULTY, MIN_DIFFICULTY, MeterLike, NoteEvent, PercussionProfile, Section, StringedProfile, Vocabulary, assertCompositionPlan, classifyMelodyTones, harmonizeMelody, imitate, isDrumPattern, isFillArchetype, isLickMaterial, placeDrumPattern, placeLicks, planTimeline, sustainsShift, sustainsStrokes };
|
|
808
|
+
export type { BassLick, ClassifiedMelodyTone, DrumPattern, DrumPatternOptions, DrumStroke, DrumVocabulary, FillArchetype, FillStroke, FillType, FillVelocity, ImitationAnswer, ImitationOptions, KickFigure, KickPattern, KickSlot, LickMaterial, LickNote, MelodyToneRole, PlaceLicksOptions };
|
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,19 +72,20 @@ import {
|
|
|
66
72
|
transformMotif,
|
|
67
73
|
vocabularyOfKind,
|
|
68
74
|
withinCeiling
|
|
69
|
-
} from "../chunk-
|
|
70
|
-
import "../chunk-
|
|
71
|
-
import "../chunk-
|
|
72
|
-
import "../chunk-
|
|
73
|
-
import "../chunk-
|
|
74
|
-
import "../chunk-
|
|
75
|
-
import "../chunk-
|
|
75
|
+
} from "../chunk-FK3DGAIZ.js";
|
|
76
|
+
import "../chunk-FJFULJZE.js";
|
|
77
|
+
import "../chunk-VL5NXVCN.js";
|
|
78
|
+
import "../chunk-TXFWSU5D.js";
|
|
79
|
+
import "../chunk-2G5MCGYU.js";
|
|
80
|
+
import "../chunk-H7FVMBUC.js";
|
|
81
|
+
import "../chunk-YYVXRV3V.js";
|
|
76
82
|
export {
|
|
77
83
|
BAR_STEPS,
|
|
78
84
|
BASS_LICKS,
|
|
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,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as ParseResult } from './index-
|
|
1
|
+
import { P as ParseResult } from './index-C9MYbuKS.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Meter arithmetic shared by the meter module and the validation guards.
|
|
@@ -87,6 +87,9 @@ type MeterChange = {
|
|
|
87
87
|
* lays its bar lines from beat 0 whatever beat the first entry is written at, so
|
|
88
88
|
* a map opening at the pickup it covers numbers its bars exactly as the bare
|
|
89
89
|
* signature does. Every later entry starts a bar at the beat it takes effect.
|
|
90
|
+
* Bars are numbered so that the bar containing beat 0 is bar 0, so a pickup
|
|
91
|
+
* written as an entry of its own before a change at beat 0 is bar -1 all the
|
|
92
|
+
* same.
|
|
90
93
|
*
|
|
91
94
|
* Pass the whole piece with its map rather than one call per meter span: a
|
|
92
95
|
* split call cannot see a voice move or a key region that crosses the change.
|
|
@@ -507,4 +510,5 @@ declare function isStrongBeat(beatInQuarters: number, meter: MeterLike): boolean
|
|
|
507
510
|
*/
|
|
508
511
|
declare function tuplet(totalBeats: number, count: number): number[];
|
|
509
512
|
|
|
510
|
-
export {
|
|
513
|
+
export { barIndexAt as d, barPositionToBeat as e, barPositionToPulse as f, barStartBeat as g, beatToBarPosition as h, beatsPerBar as i, beatsPerBarAt as j, formatBarPosition as k, formatTimeSignature as l, isCompound as m, isStrongBeat as n, meterAt as o, metricWeight as p, parseTimeSignature as q, pulseBeats as r, pulsesPerBar as s, resolveMeters as t, toMeterData as u, tryParseTimeSignature as v, tuplet as w };
|
|
514
|
+
export type { BarPosition as B, MeterChange as M, TimeSignature as T, MeterData as a, MeterLike as b, MeterMap as c };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { e as KeyScale, i as NoteLike, j as NoteNameOptions, P as ParseResult, g as Note, b as IntervalLike, S as SpelledInterval } from './index-
|
|
2
|
-
import { n as ResolvedKey, K as KeyLike, c as ChordLike, b as Chord, r as SpelledKeyLike } from './coerce-
|
|
3
|
-
import { r as ScaleName, u as WorldScaleName, s as ScaleNameInput } from './masks-
|
|
1
|
+
import { e as KeyScale, i as NoteLike, j as NoteNameOptions, P as ParseResult, g as Note, b as IntervalLike, S as SpelledInterval } from './index-C9MYbuKS.js';
|
|
2
|
+
import { n as ResolvedKey, K as KeyLike, c as ChordLike, b as Chord, r as SpelledKeyLike } from './coerce-CUhHc3Tu.js';
|
|
3
|
+
import { r as ScaleName, u as WorldScaleName, s as ScaleNameInput } from './masks-tycmkrgs.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Which of the two modes a key signature is read in.
|
|
@@ -416,10 +416,12 @@ declare function chordScales(chord: ChordLike): ChordScaleMatch[];
|
|
|
416
416
|
/**
|
|
417
417
|
* Which use an avoid note is judged for: sounding it, or passing through it.
|
|
418
418
|
*
|
|
419
|
-
* `'harmonic'` is the Berklee-style rule
|
|
419
|
+
* `'harmonic'` is the Berklee-style rule — a tone that must not be
|
|
420
420
|
* sounded against the chord. `'melodic'` keeps only what a line cannot pass
|
|
421
421
|
* through either, which is the semitone above the root; every other clash
|
|
422
|
-
* resolves as the line moves on.
|
|
422
|
+
* resolves as the line moves on. Over a chord that sounds a dominant seventh
|
|
423
|
+
* the semitone above the root is the flat ninth, a tension under either use
|
|
424
|
+
* whichever scale supplies it; the flat thirteenth stays a harmonic avoid note.
|
|
423
425
|
*
|
|
424
426
|
* @category Scales
|
|
425
427
|
*/
|
|
@@ -488,8 +490,8 @@ type AvailableTensionsOptions = {
|
|
|
488
490
|
*
|
|
489
491
|
* A tension's availability also depends on what the chord is doing. Pass
|
|
490
492
|
* `resolvesTo` to say which chord this one resolves to: a dominant seventh
|
|
491
|
-
* resolving down a fifth to a minor tonic takes its
|
|
492
|
-
*
|
|
493
|
+
* resolving down a fifth to a minor tonic takes its sharp ninth and flat
|
|
494
|
+
* thirteenth as well as the flat ninth every dominant takes. Only
|
|
493
495
|
* scale tones are ever added, so the result stays within the scale.
|
|
494
496
|
*
|
|
495
497
|
* @param chord The chord providing the chord tones, as a chord symbol, chord
|
|
@@ -505,7 +507,7 @@ type AvailableTensionsOptions = {
|
|
|
505
507
|
* import { makeChord, availableTensions } from '@libraz/libcantus';
|
|
506
508
|
* availableTensions(makeChord(0, 'maj7'), 'ionian'); // [2, 9] — color tones over Cmaj7
|
|
507
509
|
* availableTensions(makeChord(7, 'dom7'), 'phrygianDominant', { resolvesTo: makeChord(0, 'min') });
|
|
508
|
-
* // [3, 8] — the
|
|
510
|
+
* // [3, 8] — the b9, and the b13 the resolution to C minor makes available
|
|
509
511
|
* ```
|
|
510
512
|
*
|
|
511
513
|
* @category Scales
|
|
@@ -865,8 +867,10 @@ type StyledVoicingOptions = {
|
|
|
865
867
|
* {@link VoicingStyle} then transforms the stack, and the result is returned as
|
|
866
868
|
* ascending MIDI pitches (index 0 = lowest).
|
|
867
869
|
*
|
|
868
|
-
* A drop voicing lowers one voice
|
|
869
|
-
*
|
|
870
|
+
* A drop voicing lowers one voice by an octave. On a stack spanning no more than
|
|
871
|
+
* an octave above that voice it becomes the bass — which is what tells the
|
|
872
|
+
* drop-2 voicings of one chord apart; on a wider stack (an eleventh or
|
|
873
|
+
* thirteenth chord) it can land inside the stack. When the chord
|
|
870
874
|
* names a bass tone of its own, the close stack is therefore rotated so the
|
|
871
875
|
* style drops that tone, and the result is the drop voicing whose bass is the
|
|
872
876
|
* tone asked for; the named bass is not lowered under an already dropped voice
|
|
@@ -882,7 +886,8 @@ type StyledVoicingOptions = {
|
|
|
882
886
|
* plain chord data, or a `Chord`.
|
|
883
887
|
* @param opts Styled voicing options; defaults to a close voicing at octave 4.
|
|
884
888
|
* @returns MIDI pitches, ascending, one per retained voice.
|
|
885
|
-
* @throws If the voicing would not fit inside MIDI 0..127 at the given octave
|
|
889
|
+
* @throws If the voicing would not fit inside MIDI 0..127 at the given octave,
|
|
890
|
+
* or `style` is not a {@link VoicingStyle}.
|
|
886
891
|
* @example
|
|
887
892
|
* ```ts
|
|
888
893
|
* import { voiceChordStyled } from '@libraz/libcantus';
|
|
@@ -967,7 +972,8 @@ type SpeciesOptions = {
|
|
|
967
972
|
* @returns Every violation found, in the order the exercise commits them; an
|
|
968
973
|
* empty array for a clean exercise.
|
|
969
974
|
* @throws If the species is not one of the five, either voice is empty, a note
|
|
970
|
-
* carries no octave,
|
|
975
|
+
* carries no octave, the durations are not an array of finite numbers, or the
|
|
976
|
+
* fifth species is given without durations.
|
|
971
977
|
* @example
|
|
972
978
|
* ```ts
|
|
973
979
|
* import { checkSpecies, majorKey, parseNote } from '@libraz/libcantus';
|
|
@@ -1329,4 +1335,5 @@ declare function toSoundingPitch(note: NoteLike, instrument: TransposingInstrume
|
|
|
1329
1335
|
*/
|
|
1330
1336
|
declare function toWrittenPitch(note: NoteLike, instrument: TransposingInstrument): Note;
|
|
1331
1337
|
|
|
1332
|
-
export {
|
|
1338
|
+
export { instrumentTransposition as B, isSignatureKey as D, keyFromFifths as E, keySignatureFifths as F, parseChordSymbol as G, scaleMatchesChord as H, scaleSystemOf as I, scalesForChanges as J, spellVoicing as L, supportsFunctionalHarmony as M, toSoundingPitch as N, toWrittenPitch as O, transposeChordSymbol as Q, tryParseChordSymbol as R, SATB_RANGES as S, TRANSPOSING_INSTRUMENTS as T, voiceChord as U, voiceChordStyled as W, voiceIndependence as X, voiceProgression as Y, SCALE_SYSTEMS as g, availableTensions as t, avoidNotes as u, checkPartWriting as v, checkSpecies as w, chordScaleReport as x, chordScales as y, formatChordSymbol as z };
|
|
1339
|
+
export type { AvailableTensionsOptions as A, ChordScaleMatch as C, KeyMode as K, PartWritingOptions as P, VoiceIndependenceOptions as V, AvoidNoteUse as a, AvoidNotesOptions as b, ChordScaleReportEntry as c, ChordSymbolOptions as d, PartWritingViolation as e, PartWritingViolationKind as f, ScaleChoice as h, ScaleSystem as i, Species as j, SpeciesOptions as k, SpelledVoicing as l, StyledVoicingOptions as m, TransposingInstrument as n, TransposingInstrumentName as o, VoiceIndependenceReport as p, VoiceRange as q, VoicingOptions as r, VoicingStyle as s };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { e as KeyScale, i as NoteLike, j as NoteNameOptions, P as ParseResult, g as Note, b as IntervalLike, S as SpelledInterval } from './index-
|
|
2
|
-
import { n as ResolvedKey, K as KeyLike, c as ChordLike, b as Chord, r as SpelledKeyLike } from './coerce-
|
|
3
|
-
import { r as ScaleName, u as WorldScaleName, s as ScaleNameInput } from './masks-
|
|
1
|
+
import { e as KeyScale, i as NoteLike, j as NoteNameOptions, P as ParseResult, g as Note, b as IntervalLike, S as SpelledInterval } from './index-C9MYbuKS.cjs';
|
|
2
|
+
import { n as ResolvedKey, K as KeyLike, c as ChordLike, b as Chord, r as SpelledKeyLike } from './coerce-Ytt2Eiq9.cjs';
|
|
3
|
+
import { r as ScaleName, u as WorldScaleName, s as ScaleNameInput } from './masks-BnzXnBj0.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Which of the two modes a key signature is read in.
|
|
@@ -416,10 +416,12 @@ declare function chordScales(chord: ChordLike): ChordScaleMatch[];
|
|
|
416
416
|
/**
|
|
417
417
|
* Which use an avoid note is judged for: sounding it, or passing through it.
|
|
418
418
|
*
|
|
419
|
-
* `'harmonic'` is the Berklee-style rule
|
|
419
|
+
* `'harmonic'` is the Berklee-style rule — a tone that must not be
|
|
420
420
|
* sounded against the chord. `'melodic'` keeps only what a line cannot pass
|
|
421
421
|
* through either, which is the semitone above the root; every other clash
|
|
422
|
-
* resolves as the line moves on.
|
|
422
|
+
* resolves as the line moves on. Over a chord that sounds a dominant seventh
|
|
423
|
+
* the semitone above the root is the flat ninth, a tension under either use
|
|
424
|
+
* whichever scale supplies it; the flat thirteenth stays a harmonic avoid note.
|
|
423
425
|
*
|
|
424
426
|
* @category Scales
|
|
425
427
|
*/
|
|
@@ -488,8 +490,8 @@ type AvailableTensionsOptions = {
|
|
|
488
490
|
*
|
|
489
491
|
* A tension's availability also depends on what the chord is doing. Pass
|
|
490
492
|
* `resolvesTo` to say which chord this one resolves to: a dominant seventh
|
|
491
|
-
* resolving down a fifth to a minor tonic takes its
|
|
492
|
-
*
|
|
493
|
+
* resolving down a fifth to a minor tonic takes its sharp ninth and flat
|
|
494
|
+
* thirteenth as well as the flat ninth every dominant takes. Only
|
|
493
495
|
* scale tones are ever added, so the result stays within the scale.
|
|
494
496
|
*
|
|
495
497
|
* @param chord The chord providing the chord tones, as a chord symbol, chord
|
|
@@ -505,7 +507,7 @@ type AvailableTensionsOptions = {
|
|
|
505
507
|
* import { makeChord, availableTensions } from '@libraz/libcantus';
|
|
506
508
|
* availableTensions(makeChord(0, 'maj7'), 'ionian'); // [2, 9] — color tones over Cmaj7
|
|
507
509
|
* availableTensions(makeChord(7, 'dom7'), 'phrygianDominant', { resolvesTo: makeChord(0, 'min') });
|
|
508
|
-
* // [3, 8] — the
|
|
510
|
+
* // [3, 8] — the b9, and the b13 the resolution to C minor makes available
|
|
509
511
|
* ```
|
|
510
512
|
*
|
|
511
513
|
* @category Scales
|
|
@@ -865,8 +867,10 @@ type StyledVoicingOptions = {
|
|
|
865
867
|
* {@link VoicingStyle} then transforms the stack, and the result is returned as
|
|
866
868
|
* ascending MIDI pitches (index 0 = lowest).
|
|
867
869
|
*
|
|
868
|
-
* A drop voicing lowers one voice
|
|
869
|
-
*
|
|
870
|
+
* A drop voicing lowers one voice by an octave. On a stack spanning no more than
|
|
871
|
+
* an octave above that voice it becomes the bass — which is what tells the
|
|
872
|
+
* drop-2 voicings of one chord apart; on a wider stack (an eleventh or
|
|
873
|
+
* thirteenth chord) it can land inside the stack. When the chord
|
|
870
874
|
* names a bass tone of its own, the close stack is therefore rotated so the
|
|
871
875
|
* style drops that tone, and the result is the drop voicing whose bass is the
|
|
872
876
|
* tone asked for; the named bass is not lowered under an already dropped voice
|
|
@@ -882,7 +886,8 @@ type StyledVoicingOptions = {
|
|
|
882
886
|
* plain chord data, or a `Chord`.
|
|
883
887
|
* @param opts Styled voicing options; defaults to a close voicing at octave 4.
|
|
884
888
|
* @returns MIDI pitches, ascending, one per retained voice.
|
|
885
|
-
* @throws If the voicing would not fit inside MIDI 0..127 at the given octave
|
|
889
|
+
* @throws If the voicing would not fit inside MIDI 0..127 at the given octave,
|
|
890
|
+
* or `style` is not a {@link VoicingStyle}.
|
|
886
891
|
* @example
|
|
887
892
|
* ```ts
|
|
888
893
|
* import { voiceChordStyled } from '@libraz/libcantus';
|
|
@@ -967,7 +972,8 @@ type SpeciesOptions = {
|
|
|
967
972
|
* @returns Every violation found, in the order the exercise commits them; an
|
|
968
973
|
* empty array for a clean exercise.
|
|
969
974
|
* @throws If the species is not one of the five, either voice is empty, a note
|
|
970
|
-
* carries no octave,
|
|
975
|
+
* carries no octave, the durations are not an array of finite numbers, or the
|
|
976
|
+
* fifth species is given without durations.
|
|
971
977
|
* @example
|
|
972
978
|
* ```ts
|
|
973
979
|
* import { checkSpecies, majorKey, parseNote } from '@libraz/libcantus';
|
|
@@ -1329,4 +1335,5 @@ declare function toSoundingPitch(note: NoteLike, instrument: TransposingInstrume
|
|
|
1329
1335
|
*/
|
|
1330
1336
|
declare function toWrittenPitch(note: NoteLike, instrument: TransposingInstrument): Note;
|
|
1331
1337
|
|
|
1332
|
-
export {
|
|
1338
|
+
export { instrumentTransposition as B, isSignatureKey as D, keyFromFifths as E, keySignatureFifths as F, parseChordSymbol as G, scaleMatchesChord as H, scaleSystemOf as I, scalesForChanges as J, spellVoicing as L, supportsFunctionalHarmony as M, toSoundingPitch as N, toWrittenPitch as O, transposeChordSymbol as Q, tryParseChordSymbol as R, SATB_RANGES as S, TRANSPOSING_INSTRUMENTS as T, voiceChord as U, voiceChordStyled as W, voiceIndependence as X, voiceProgression as Y, SCALE_SYSTEMS as g, availableTensions as t, avoidNotes as u, checkPartWriting as v, checkSpecies as w, chordScaleReport as x, chordScales as y, formatChordSymbol as z };
|
|
1339
|
+
export type { AvailableTensionsOptions as A, ChordScaleMatch as C, KeyMode as K, PartWritingOptions as P, VoiceIndependenceOptions as V, AvoidNoteUse as a, AvoidNotesOptions as b, ChordScaleReportEntry as c, ChordSymbolOptions as d, PartWritingViolation as e, PartWritingViolationKind as f, ScaleChoice as h, ScaleSystem as i, Species as j, SpeciesOptions as k, SpelledVoicing as l, StyledVoicingOptions as m, TransposingInstrument as n, TransposingInstrumentName as o, VoiceIndependenceReport as p, VoiceRange as q, VoicingOptions as r, VoicingStyle as s };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as ParseResult } from './index-
|
|
1
|
+
import { P as ParseResult } from './index-C9MYbuKS.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Meter arithmetic shared by the meter module and the validation guards.
|
|
@@ -87,6 +87,9 @@ type MeterChange = {
|
|
|
87
87
|
* lays its bar lines from beat 0 whatever beat the first entry is written at, so
|
|
88
88
|
* a map opening at the pickup it covers numbers its bars exactly as the bare
|
|
89
89
|
* signature does. Every later entry starts a bar at the beat it takes effect.
|
|
90
|
+
* Bars are numbered so that the bar containing beat 0 is bar 0, so a pickup
|
|
91
|
+
* written as an entry of its own before a change at beat 0 is bar -1 all the
|
|
92
|
+
* same.
|
|
90
93
|
*
|
|
91
94
|
* Pass the whole piece with its map rather than one call per meter span: a
|
|
92
95
|
* split call cannot see a voice move or a key region that crosses the change.
|
|
@@ -507,4 +510,5 @@ declare function isStrongBeat(beatInQuarters: number, meter: MeterLike): boolean
|
|
|
507
510
|
*/
|
|
508
511
|
declare function tuplet(totalBeats: number, count: number): number[];
|
|
509
512
|
|
|
510
|
-
export {
|
|
513
|
+
export { barIndexAt as d, barPositionToBeat as e, barPositionToPulse as f, barStartBeat as g, beatToBarPosition as h, beatsPerBar as i, beatsPerBarAt as j, formatBarPosition as k, formatTimeSignature as l, isCompound as m, isStrongBeat as n, meterAt as o, metricWeight as p, parseTimeSignature as q, pulseBeats as r, pulsesPerBar as s, resolveMeters as t, toMeterData as u, tryParseTimeSignature as v, tuplet as w };
|
|
514
|
+
export type { BarPosition as B, MeterChange as M, TimeSignature as T, MeterData as a, MeterLike as b, MeterMap as c };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ChordToneRole, c as ChordLike } from './coerce-
|
|
1
|
+
import { i as ChordToneRole, c as ChordLike } from './coerce-Ytt2Eiq9.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Harmonic role a pitch plays within a chord.
|
|
@@ -60,4 +60,5 @@ type VoicedRole = {
|
|
|
60
60
|
*/
|
|
61
61
|
declare function roleOf(pitch: number, chord: ChordLike, chordId?: number): VoicedRole;
|
|
62
62
|
|
|
63
|
-
export {
|
|
63
|
+
export { roleOf as r };
|
|
64
|
+
export type { HarmonyRole as H, LockLevel as L, VoicedRole as V };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ChordToneRole, c as ChordLike } from './coerce-
|
|
1
|
+
import { i as ChordToneRole, c as ChordLike } from './coerce-CUhHc3Tu.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Harmonic role a pitch plays within a chord.
|
|
@@ -60,4 +60,5 @@ type VoicedRole = {
|
|
|
60
60
|
*/
|
|
61
61
|
declare function roleOf(pitch: number, chord: ChordLike, chordId?: number): VoicedRole;
|
|
62
62
|
|
|
63
|
-
export {
|
|
63
|
+
export { roleOf as r };
|
|
64
|
+
export type { HarmonyRole as H, LockLevel as L, VoicedRole as V };
|
|
@@ -781,12 +781,15 @@ declare function transposeByInterval(given: NoteLike, named: IntervalLike): Note
|
|
|
781
781
|
* The spelled interval from one note to another.
|
|
782
782
|
*
|
|
783
783
|
* When both notes carry octaves, the interval reflects their full signed
|
|
784
|
-
* distance (so `C4 -> C5` is a perfect octave). When
|
|
785
|
-
* interval is measured within a single
|
|
784
|
+
* distance (so `C4 -> C5` is a perfect octave). When neither carries an octave
|
|
785
|
+
* the interval is measured within a single octave from `a` to `b`, normally
|
|
786
|
+
* ascending; a chromatic step down on one letter, such as `C -> Cb`, descends
|
|
787
|
+
* (`-A1`). Exactly one octave-bearing note has no defined answer and throws.
|
|
786
788
|
*
|
|
787
789
|
* @param a The lower/first note.
|
|
788
790
|
* @param b The upper/second note.
|
|
789
791
|
* @returns The diatonic number, quality, and semitone span.
|
|
792
|
+
* @throws If exactly one of the notes carries an octave.
|
|
790
793
|
* @example
|
|
791
794
|
* ```ts
|
|
792
795
|
* import { spelledInterval, parseNote } from '@libraz/libcantus';
|
|
@@ -797,4 +800,5 @@ declare function transposeByInterval(given: NoteLike, named: IntervalLike): Note
|
|
|
797
800
|
*/
|
|
798
801
|
declare function spelledInterval(a: Note, b: Note): SpelledInterval;
|
|
799
802
|
|
|
800
|
-
export { ARTICULATIONS as A, BudgetExceededError as B, toNoteData as C, toSpelledInterval as D, transposeByInterval as E, transposeNote as F, tryParseInterval as G, tryParseKeyName as H,
|
|
803
|
+
export { ARTICULATIONS as A, BudgetExceededError as B, toNoteData as C, toSpelledInterval as D, transposeByInterval as E, transposeNote as F, tryParseInterval as G, tryParseKeyName as H, tryParseNote as J, NoSolutionError as N, InvalidInputError as d, detectNoteNameSystem as l, diatonicLetterOf as m, formatKeyName as n, formatNote as o, intervalSemitones as p, isLibcantusError as q, midiToNote as r, naturalPitchClassOf as s, noteToMidi as t, noteToPitchClass as u, parseInterval as v, parseKeyName as w, parseNote as x, pitchClassOf as y, spelledInterval as z };
|
|
804
|
+
export type { IntervalData as I, KeyName as K, LibcantusError as L, ParseResult as P, SpelledInterval as S, Articulation as a, IntervalLike as b, IntervalQualityLabel as c, KeyScale as e, LibcantusErrorCode as f, Note as g, NoteEvent as h, NoteLike as i, NoteNameOptions as j, NoteNameSystem as k };
|
|
@@ -781,12 +781,15 @@ declare function transposeByInterval(given: NoteLike, named: IntervalLike): Note
|
|
|
781
781
|
* The spelled interval from one note to another.
|
|
782
782
|
*
|
|
783
783
|
* When both notes carry octaves, the interval reflects their full signed
|
|
784
|
-
* distance (so `C4 -> C5` is a perfect octave). When
|
|
785
|
-
* interval is measured within a single
|
|
784
|
+
* distance (so `C4 -> C5` is a perfect octave). When neither carries an octave
|
|
785
|
+
* the interval is measured within a single octave from `a` to `b`, normally
|
|
786
|
+
* ascending; a chromatic step down on one letter, such as `C -> Cb`, descends
|
|
787
|
+
* (`-A1`). Exactly one octave-bearing note has no defined answer and throws.
|
|
786
788
|
*
|
|
787
789
|
* @param a The lower/first note.
|
|
788
790
|
* @param b The upper/second note.
|
|
789
791
|
* @returns The diatonic number, quality, and semitone span.
|
|
792
|
+
* @throws If exactly one of the notes carries an octave.
|
|
790
793
|
* @example
|
|
791
794
|
* ```ts
|
|
792
795
|
* import { spelledInterval, parseNote } from '@libraz/libcantus';
|
|
@@ -797,4 +800,5 @@ declare function transposeByInterval(given: NoteLike, named: IntervalLike): Note
|
|
|
797
800
|
*/
|
|
798
801
|
declare function spelledInterval(a: Note, b: Note): SpelledInterval;
|
|
799
802
|
|
|
800
|
-
export { ARTICULATIONS as A, BudgetExceededError as B, toNoteData as C, toSpelledInterval as D, transposeByInterval as E, transposeNote as F, tryParseInterval as G, tryParseKeyName as H,
|
|
803
|
+
export { ARTICULATIONS as A, BudgetExceededError as B, toNoteData as C, toSpelledInterval as D, transposeByInterval as E, transposeNote as F, tryParseInterval as G, tryParseKeyName as H, tryParseNote as J, NoSolutionError as N, InvalidInputError as d, detectNoteNameSystem as l, diatonicLetterOf as m, formatKeyName as n, formatNote as o, intervalSemitones as p, isLibcantusError as q, midiToNote as r, naturalPitchClassOf as s, noteToMidi as t, noteToPitchClass as u, parseInterval as v, parseKeyName as w, parseNote as x, pitchClassOf as y, spelledInterval as z };
|
|
804
|
+
export type { IntervalData as I, KeyName as K, LibcantusError as L, ParseResult as P, SpelledInterval as S, Articulation as a, IntervalLike as b, IntervalQualityLabel as c, KeyScale as e, LibcantusErrorCode as f, Note as g, NoteEvent as h, NoteLike as i, NoteNameOptions as j, NoteNameSystem as k };
|