@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.
Files changed (56) hide show
  1. package/README.md +4 -0
  2. package/README_ja.md +4 -0
  3. package/dist/analyze/index.cjs +28 -4
  4. package/dist/analyze/index.cjs.map +1 -1
  5. package/dist/analyze/index.d.cts +151 -5
  6. package/dist/analyze/index.d.ts +151 -5
  7. package/dist/analyze/index.js +34 -10
  8. package/dist/{chunk-DSMJRXCZ.cjs → chunk-4R2LWV7E.cjs} +384 -107
  9. package/dist/chunk-4R2LWV7E.cjs.map +1 -0
  10. package/dist/{chunk-J7FHVZII.cjs → chunk-B2PW6EHN.cjs} +2000 -30
  11. package/dist/chunk-B2PW6EHN.cjs.map +1 -0
  12. package/dist/{chunk-Q6LFSAKV.js → chunk-CPMB7P75.js} +1973 -3
  13. package/dist/chunk-CPMB7P75.js.map +1 -0
  14. package/dist/{chunk-H2KJHBW4.js → chunk-GNVN4PPJ.js} +1871 -5
  15. package/dist/chunk-GNVN4PPJ.js.map +1 -0
  16. package/dist/{chunk-SGLEQVJH.cjs → chunk-IFZDWIKM.cjs} +1868 -2
  17. package/dist/chunk-IFZDWIKM.cjs.map +1 -0
  18. package/dist/{chunk-FBH75DAY.js → chunk-IPEF6NWB.js} +287 -10
  19. package/dist/chunk-IPEF6NWB.js.map +1 -0
  20. package/dist/{chunk-HYJJ2V2I.js → chunk-MLBPXA4Z.js} +300 -720
  21. package/dist/chunk-MLBPXA4Z.js.map +1 -0
  22. package/dist/{chunk-HWHGOVO6.cjs → chunk-PWC4CRWT.cjs} +1 -1
  23. package/dist/{chunk-HWHGOVO6.cjs.map → chunk-PWC4CRWT.cjs.map} +1 -1
  24. package/dist/{chunk-HPVSH7SF.cjs → chunk-YFA7X2F6.cjs} +350 -770
  25. package/dist/chunk-YFA7X2F6.cjs.map +1 -0
  26. package/dist/{chunk-NFJ4P6ZZ.js → chunk-ZBUROTJQ.js} +1 -1
  27. package/dist/generate/index.cjs +15 -3
  28. package/dist/generate/index.cjs.map +1 -1
  29. package/dist/generate/index.d.cts +84 -6
  30. package/dist/generate/index.d.ts +84 -6
  31. package/dist/generate/index.js +14 -2
  32. package/dist/{index-BNSM-DSk.d.cts → index-CY-3NVfy.d.cts} +484 -3
  33. package/dist/{index-BJgP97N1.d.ts → index-zaZdmnU4.d.ts} +484 -3
  34. package/dist/index.cjs +43 -7
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +5 -5
  37. package/dist/index.d.ts +5 -5
  38. package/dist/index.js +48 -12
  39. package/dist/model/index.cjs +5 -5
  40. package/dist/model/index.d.cts +203 -7
  41. package/dist/model/index.d.ts +203 -7
  42. package/dist/model/index.js +4 -4
  43. package/dist/{index-DGCNKAUr.d.cts → profile-CQMEqdH9.d.cts} +65 -598
  44. package/dist/{index-BRMbPkHE.d.ts → profile-DLdlIpS9.d.ts} +65 -598
  45. package/dist/{index-BBWNZS0f.d.cts → types-D-XgxGvp.d.cts} +1169 -13
  46. package/dist/{index-CJBBiAmU.d.ts → types-Dh7C064C.d.ts} +1169 -13
  47. package/package.json +5 -5
  48. package/dist/chunk-DSMJRXCZ.cjs.map +0 -1
  49. package/dist/chunk-FBH75DAY.js.map +0 -1
  50. package/dist/chunk-H2KJHBW4.js.map +0 -1
  51. package/dist/chunk-HPVSH7SF.cjs.map +0 -1
  52. package/dist/chunk-HYJJ2V2I.js.map +0 -1
  53. package/dist/chunk-J7FHVZII.cjs.map +0 -1
  54. package/dist/chunk-Q6LFSAKV.js.map +0 -1
  55. package/dist/chunk-SGLEQVJH.cjs.map +0 -1
  56. /package/dist/{chunk-NFJ4P6ZZ.js.map → chunk-ZBUROTJQ.js.map} +0 -0
@@ -1,7 +1,7 @@
1
- import { R as ReduceProgressionOptions, v as ReducedChord, D as DetectChordOptions, C as ChordMatch, h as DetectKeyOptions, K as KeyMatch, d as AugmentedSixthKind, t as PhraseOptions, P as Phrase, S as StructuralCadence, i as FormSectionOptions, F as FormSection, j as HypermeterOptions, H as Hypermeter, E as ExtractMotifsOptions, p as MotifData, k as MelodicContour, c as ArrangementTrack, a as ArrangementOptions, A as ArrangementAnalysis, e as Conflict, z as TrackEdit, T as TensionPoint, r as MotifRelation } from '../index-DGCNKAUr.cjs';
2
- export { b as ArrangementSession, f as ConflictPartner, g as ContourDirection, l as MelodicContourShape, o as ModalScaleName, q as MotifOccurrence, s as MotifRelationKind, u as PhraseSignal, w as ReductionBasis, x as ReductionLevel, y as TrackAnalysis, B as TrackRole } from '../index-DGCNKAUr.cjs';
3
- import { k as KeyRegion, f as ChordTimelineOptions, C as CadenceHit, l as KeyTimelineOptions, h as ChordToRomanOptions, e as ChordTimeline, H as HarmonicFunction, A as AnalyzeChordOptions, D as DetectCadenceOptions, c as ChordAnalysis, b as CadenceResult, E as ExplainRomanOptions, m as RomanExplanation, B as BorrowedSource, a as AnalyzedNote, I as IdentifiedVoiceNote } from '../index-BBWNZS0f.cjs';
4
- export { d as ChordSegmentation, g as ChordTimelineResult, K as KeyContext, i as KeyProfileName, j as KeyProfilePair, P as PivotChord, R as RejectedCandidate, S as SuspensionFigure, T as TheoryLabel, V as VoiceNote } from '../index-BBWNZS0f.cjs';
1
+ import { D as DetectChordOptions, C as ChordMatch, g as DetectKeyOptions, K as KeyMatch, d as AugmentedSixthKind, k as PhraseOptions, P as Phrase, S as StructuralCadence, h as HypermeterOptions, H as Hypermeter, R as ReferenceProfileOptions, c as ArrangementTrack, a as ArrangementOptions, A as ArrangementAnalysis, e as Conflict, n as TrackEdit, T as TensionPoint } from '../profile-CQMEqdH9.cjs';
2
+ export { b as ArrangementSession, f as ConflictPartner, j as ModalScaleName, l as PhraseSignal, m as TrackAnalysis, o as TrackRole } from '../profile-CQMEqdH9.cjs';
3
+ import { r as KeyRegion, i as ChordTimelineOptions, U as ReduceProgressionOptions, V as ReducedChord, c as CadenceHit, s as KeyTimelineOptions, k as ChordToRomanOptions, h as ChordTimeline, o as HarmonicFunction, A as AnalyzeChordOptions, D as DetectCadenceOptions, f as ChordAnalysis, d as CadenceResult, E as ExplainRomanOptions, a9 as RomanExplanation, b as BorrowedSource, n as FormSectionOptions, F as FormSection, m as ExtractMotifsOptions, x as MotifData, u as MelodicContour, a5 as ReferenceProfile, a8 as RhythmAnalysisOptions, a7 as RhythmAnalysis, J as MotifGraphOptions, y as MotifGraph, a as AnalyzedNote, I as IdentifiedVoiceNote, N as MotifRelation } from '../types-D-XgxGvp.cjs';
4
+ export { B as BarPositionProfile, e as CadenceType, g as ChordSegmentation, j as ChordTimelineResult, l as ContourDirection, K as KeyContext, p as KeyProfileName, q as KeyProfilePair, v as MelodicContourShape, z as MotifGraphEdge, G as MotifGraphNode, L as MotifOccurrence, O as MotifRelationKind, P as MotifRelationSummary, Q as PivotChord, W as ReductionBasis, 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, a6 as RejectedCandidate, aa as SuspensionFigure, ab as TheoryLabel, ac as VoiceNote } from '../types-D-XgxGvp.cjs';
5
5
  import { c as IntervalQualityLabel, I as IntervalData, P as ParseResult, S as SpelledInterval, g as Note$1, j as NoteNameOptions, b as IntervalLike, h as NoteEvent, i as NoteLike, e as KeyScale, a as Articulation } from '../index-Cy15oTvh.cjs';
6
6
  export { B as BudgetExceededError, d as InvalidInputError, L as LibcantusError, N as NoSolutionError, k as NoteNameSystem } from '../index-Cy15oTvh.cjs';
7
7
  import { K as KeyLike, e as ChordSegment, g as ChordSpan, b as Chord$1, d as ChordQuality, h as ChordSpec, i as ChordToneRole, n as ResolvedKey, k as KeyVariant, j as KeyRelation, c as ChordLike, r as SpelledKeyLike, p as SafetyQuery, E as EvaluateSafetyOptions, q as SafetyResult } from '../coerce-DRERzdve.cjs';
@@ -15,8 +15,8 @@ export { M as MeterChange } from '../index-BMweUlm5.cjs';
15
15
  import { s as ScaleNameInput, r as ScaleName } from '../masks-pADfTOiD.cjs';
16
16
  import { n as TransposingInstrument, r as VoicingOptions, h as ScaleChoice, d as ChordSymbolOptions, m as StyledVoicingOptions, C as ChordScaleMatch, c as ChordScaleReportEntry, A as AvailableTensionsOptions, b as AvoidNotesOptions, K as KeyMode, i as ScaleSystem, q as VoiceRange, P as PartWritingOptions, e as PartWritingViolation, j as Species, k as SpeciesOptions, V as VoiceIndependenceOptions, p as VoiceIndependenceReport } from '../index-B9QLziDe.cjs';
17
17
  export { a as AvoidNoteUse, f as PartWritingViolationKind, o as TransposingInstrumentName, s as VoicingStyle } from '../index-B9QLziDe.cjs';
18
- import { a2 as SubstitutionType, a0 as SubstituteOptions, a1 as Substitution, g as BorrowedChord, z as HumanizeOptions, L as OrnamentOptions, w as GrooveTemplate, d as BassLineOptions, C as Complexity, a4 as Vocabulary, T as ProgressionOptions, o as DrumsOptions, e as BassSegment, h as CounterMelodyOptions, H as HarmonizeOptions, p as GenerationContext, A as MotifCell, F as MotifContour, q as GenerationContextInput, I as MotifNote, K as MotifTransform, Y as RhythmEvent, Z as RhythmOptions } from '../index-BNSM-DSk.cjs';
19
- export { f as BassStyle, l as DrumRole, E as EuclideanKick, r as Genre, s as GridEvent, t as GrooveFeel, u as GrooveSlot, v as GrooveStyle, x as HarmonizePlacement, M as MelodyNote, N as OrnamentStyle, Q as ProgFunction, R as ProgStyle, S as ProgressionDegree, U as ProgressionPreset, V as Provenance, W as ProvenanceBasis, $ as Section } from '../index-BNSM-DSk.cjs';
18
+ import { af as SubstitutionType, ad as SubstituteOptions, ae as Substitution, g as BorrowedChord, L as HumanizeOptions, U as OrnamentOptions, H as GrooveTemplate, j as CompositionPlan, u as EvaluateCompositionOptions, i as CompositionEvaluation, d as BassLineOptions, h as Complexity, ah as Vocabulary, a4 as ProgressionOptions, t as DrumsOptions, e as BassSegment, m as CounterMelodyOptions, I as HarmonizeOptions, k as CompositionPlanOptions, N as MelodyOptions, v as GenerationContext, O as MotifCell, P as MotifContour, w as GenerationContextInput, Q as MotifNote, S as MotifTransform, a9 as RhythmEvent, aa as RhythmOptions } from '../index-CY-3NVfy.cjs';
19
+ export { f as BassStyle, l as CompositionViolation, q as DrumRole, E as EuclideanKick, x as Genre, y as GridEvent, z as GrooveFeel, A as GrooveSlot, F as GrooveStyle, J as HarmonizePlacement, M as MelodyNote, V as OrnamentStyle, 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, a5 as ProgressionPreset, a6 as Provenance, a7 as ProvenanceBasis, ac as Section } from '../index-CY-3NVfy.cjs';
20
20
  import '../index-BL5N2Oyz.cjs';
21
21
 
22
22
  /**
@@ -3236,6 +3236,113 @@ declare class Score {
3236
3236
  * answered for; {@link Score.voices} is what reads the polyphony as polyphony.
3237
3237
  */
3238
3238
  contour(): MelodicContour;
3239
+ /**
3240
+ * The score's structural fingerprint: form, phrase shape, harmonic function
3241
+ * and rhythm, and how its motifs derive from one another.
3242
+ *
3243
+ * The harmony is the score's own kept chord analysis, read once whether this
3244
+ * is asked before or after {@link Score.timeline} — unless `opts.timeline`
3245
+ * gives the harmony directly, in which case the reading runs fresh through
3246
+ * {@link analyzeReference} rather than the harmony this score already holds.
3247
+ * The meter, the key and the span are the score's own and are not on offer
3248
+ * here: a caller wanting another meter reads through {@link
3249
+ * Score.withMeters}, and one wanting another key or span calls {@link
3250
+ * analyzeReference} directly.
3251
+ *
3252
+ * Asked with no options, the answer is kept and a copy of it handed back, as
3253
+ * {@link Score.timeline} keeps its own reading; asked with options, the
3254
+ * answer is read afresh and not kept.
3255
+ *
3256
+ * @param opts The harmony, the melody, and the budget; see {@link
3257
+ * ReferenceProfileOptions}. Meter, key and span are the score's own.
3258
+ * @returns The profile.
3259
+ * @example
3260
+ * ```ts
3261
+ * import { Score } from '@libraz/libcantus';
3262
+ * const triad = (pitches: number[], startBeat: number) =>
3263
+ * pitches.map((pitch) => ({ pitch, startBeat, durationBeat: 4 }));
3264
+ * const score = Score.of(
3265
+ * [
3266
+ * ...triad([60, 64, 67], 0),
3267
+ * ...triad([65, 69, 72], 4),
3268
+ * ...triad([67, 71, 74], 8),
3269
+ * ...triad([60, 64, 67], 12),
3270
+ * ],
3271
+ * { key: 'C major' },
3272
+ * );
3273
+ * score.reference().harmony.chords.map((chord) => chord.roman); // ['I', 'IV', 'V', 'I']
3274
+ * ```
3275
+ */
3276
+ reference(opts?: Omit<ReferenceProfileOptions, 'ts' | 'meters' | 'key' | 'totalBeats'>): ReferenceProfile;
3277
+ /**
3278
+ * The onset placement of the score's melodic line.
3279
+ *
3280
+ * A melody is one line, so a score holding several is read as its top voice,
3281
+ * as {@link Score.motifs} and {@link Score.contour} are.
3282
+ *
3283
+ * @param opts The span's end and the budget; see {@link
3284
+ * RhythmAnalysisOptions}. The meter is the score's own.
3285
+ * @returns The rhythm reading.
3286
+ * @example
3287
+ * ```ts
3288
+ * import { Score } from '@libraz/libcantus';
3289
+ * const score = Score.of([
3290
+ * { pitch: 60, startBeat: 0, durationBeat: 1 },
3291
+ * { pitch: 62, startBeat: 1, durationBeat: 1 },
3292
+ * { pitch: 64, startBeat: 2, durationBeat: 1 },
3293
+ * { pitch: 65, startBeat: 3, durationBeat: 1 },
3294
+ * ]);
3295
+ * score.rhythm().onsetDensity; // 4
3296
+ * ```
3297
+ */
3298
+ rhythm(opts?: Omit<RhythmAnalysisOptions, 'ts' | 'meters'>): RhythmAnalysis;
3299
+ /**
3300
+ * How the score's motifs derive from one another: which statement grew out
3301
+ * of which, and by what transformation.
3302
+ *
3303
+ * {@link Score.motifs} finds the cells; this reads across their occurrences
3304
+ * and names, for every statement after the first, the earlier one it most
3305
+ * plausibly grew out of. A melody is one line, so a score holding several is
3306
+ * read as its top voice, as {@link Score.motifs} is.
3307
+ *
3308
+ * @param opts Cell-length bounds and the recurrence threshold {@link
3309
+ * Score.motifs} takes, plus the variation threshold and the budget; see
3310
+ * {@link MotifGraphOptions} and {@link ExtractMotifsOptions}.
3311
+ * @returns The derivation forest.
3312
+ * @example
3313
+ * ```ts
3314
+ * import { Score } from '@libraz/libcantus';
3315
+ * const score = Score.of([
3316
+ * { pitch: 60, startBeat: 0, durationBeat: 1 },
3317
+ * { pitch: 62, startBeat: 1, durationBeat: 1 },
3318
+ * { pitch: 64, startBeat: 2, durationBeat: 1 },
3319
+ * { pitch: 60, startBeat: 3, durationBeat: 1 },
3320
+ * { pitch: 62, startBeat: 4, durationBeat: 1 },
3321
+ * { pitch: 64, startBeat: 5, durationBeat: 1 },
3322
+ * ]);
3323
+ * score.motifGraph().edges.length; // 1
3324
+ * ```
3325
+ */
3326
+ motifGraph(opts?: MotifGraphOptions & ExtractMotifsOptions): MotifGraph;
3327
+ /**
3328
+ * How this score, read as a melody, keeps to a composition plan.
3329
+ *
3330
+ * @param plan The plan the melody was written for.
3331
+ * @param opts The budget; see {@link EvaluateCompositionOptions}.
3332
+ * @returns The violations found and the fit reading; see {@link
3333
+ * evaluateComposition}.
3334
+ * @example
3335
+ * ```ts
3336
+ * import { Composer, Score } from '@libraz/libcantus';
3337
+ * const notes = [60, 62, 64, 65, 67, 65, 64, 62, 60, 62, 64, 65, 67, 65, 64, 60].map(
3338
+ * (pitch, startBeat) => ({ pitch, startBeat, durationBeat: 1 }),
3339
+ * );
3340
+ * const composer = Composer.of({ key: 'C major', seed: 5 });
3341
+ * const plan = composer.plan(Score.of(notes, { key: 'C major' }).reference());
3342
+ * composer.melody(plan).evaluate(plan).violations.some((v) => v.severity === 'error'); // false
3343
+ * ```
3344
+ */
3345
+ evaluate(plan: CompositionPlan, opts?: EvaluateCompositionOptions): CompositionEvaluation;
3239
3346
  /**
3240
3347
  * Each note's role in the harmony sounding under it.
3241
3348
  *
@@ -3577,6 +3684,47 @@ declare class Arrangement {
3577
3684
  * found under it.
3578
3685
  */
3579
3686
  timeline(): Timeline;
3687
+ /**
3688
+ * The arrangement's structural fingerprint: form, phrase shape, harmonic
3689
+ * function and rhythm, and how its melody's motifs derive from one another.
3690
+ *
3691
+ * The harmony reads the arrangement's own session analysis directly — the
3692
+ * tracks `settings.harmonyTracks` names, or else every track but the
3693
+ * percussion ones — so the harmony is never inferred a second time. The
3694
+ * melody is the notes of the tracks played with `role: 'melody'`, joined in
3695
+ * the order the tracks were given; an arrangement naming none reads the top
3696
+ * line of the harmony notes instead, as {@link analyzeReference} does
3697
+ * without a `melody` option. Meter, key, harmony and melody are the
3698
+ * arrangement's own and are not on offer here: a caller wanting others calls
3699
+ * {@link analyzeReference} directly, with the same notes {@link
3700
+ * Arrangement.tracks} hands out.
3701
+ *
3702
+ * @param opts The budget; see {@link ReferenceProfileOptions}.
3703
+ * @returns The profile.
3704
+ * @example
3705
+ * ```ts
3706
+ * import { Arrangement } from '@libraz/libcantus';
3707
+ * const triad = (pitches: number[], startBeat: number) =>
3708
+ * pitches.map((pitch) => ({ pitch, startBeat, durationBeat: 4 }));
3709
+ * const arrangement = Arrangement.of(
3710
+ * [
3711
+ * {
3712
+ * name: 'lead',
3713
+ * role: 'melody',
3714
+ * notes: [
3715
+ * ...triad([60, 64, 67], 0),
3716
+ * ...triad([65, 69, 72], 4),
3717
+ * ...triad([67, 71, 74], 8),
3718
+ * ...triad([60, 64, 67], 12),
3719
+ * ],
3720
+ * },
3721
+ * ],
3722
+ * { key: 'C major' },
3723
+ * );
3724
+ * arrangement.reference().harmony.chords.map((chord) => chord.roman); // ['I', 'IV', 'V', 'I']
3725
+ * ```
3726
+ */
3727
+ reference(opts?: Omit<ReferenceProfileOptions, 'ts' | 'meters' | 'key' | 'melody' | 'timeline' | 'totalBeats'>): ReferenceProfile;
3580
3728
  /**
3581
3729
  * Whether another arrangement holds the same tracks under the same settings.
3582
3730
  *
@@ -3844,6 +3992,54 @@ declare class Composer {
3844
3992
  * ```
3845
3993
  */
3846
3994
  harmonize(melody: Score, opts?: Omit<HarmonizeOptions, 'melody' | 'key' | 'ts' | 'ctx'>): HarmonizedMelody;
3995
+ /**
3996
+ * A composition plan derived from a reference profile.
3997
+ *
3998
+ * The composer's key is the plan's home key unless `opts.key` names another,
3999
+ * and its seed and algorithm version are the ones the plan records, so the
4000
+ * plan is written under the same recipe as the composer's other parts.
4001
+ *
4002
+ * @param reference The reference profile to derive from.
4003
+ * @param opts Everything {@link deriveCompositionPlan} takes but the context,
4004
+ * which is the composer's.
4005
+ * @returns The plan.
4006
+ * @throws If the composer draws from a caller-held `rng`: a plan records its
4007
+ * seed, and a source cannot be written into it.
4008
+ * @example
4009
+ * ```ts
4010
+ * import { Composer, Score } from '@libraz/libcantus';
4011
+ * const notes = [60, 62, 64, 65, 67, 65, 64, 62, 60, 62, 64, 65, 67, 65, 64, 60].map(
4012
+ * (pitch, startBeat) => ({ pitch, startBeat, durationBeat: 1 }),
4013
+ * );
4014
+ * const reference = Score.of(notes, { key: 'C major' }).reference();
4015
+ * const plan = Composer.of({ key: 'D major', seed: 5 }).plan(reference);
4016
+ * plan.seed; // 5
4017
+ * plan.keys[0].scale.rootPc; // 2
4018
+ * ```
4019
+ */
4020
+ plan(reference: ReferenceProfile, opts?: Omit<CompositionPlanOptions, 'ctx'>): CompositionPlan;
4021
+ /**
4022
+ * A melody written to a composition plan.
4023
+ *
4024
+ * The plan is the reproduction recipe, so its seed and algorithm version are
4025
+ * the ones the melody is drawn under, not the composer's. The score is read
4026
+ * in the plan's meter and home key, at the composer's tempo.
4027
+ *
4028
+ * @param plan The plan to follow.
4029
+ * @param opts The budget; see {@link MelodyOptions}.
4030
+ * @returns The melody, as a score.
4031
+ * @example
4032
+ * ```ts
4033
+ * import { Composer, Score } from '@libraz/libcantus';
4034
+ * const notes = [60, 62, 64, 65, 67, 65, 64, 62, 60, 62, 64, 65, 67, 65, 64, 60].map(
4035
+ * (pitch, startBeat) => ({ pitch, startBeat, durationBeat: 1 }),
4036
+ * );
4037
+ * const composer = Composer.of({ key: 'C major', seed: 5 });
4038
+ * const plan = composer.plan(Score.of(notes, { key: 'C major' }).reference());
4039
+ * composer.melody(plan).notes.length > 0; // true
4040
+ * ```
4041
+ */
4042
+ melody(plan: CompositionPlan, opts?: Omit<MelodyOptions, 'ctx'>): Score;
3847
4043
  /**
3848
4044
  * Whether another composer holds the same settings.
3849
4045
  *
@@ -5750,4 +5946,4 @@ declare class Voicing {
5750
5946
  toString(): string;
5751
5947
  }
5752
5948
 
5753
- export { AnalyzeChordOptions, AnalyzedNote, Arrangement, ArrangementAnalysis, type ArrangementData, ArrangementOptions, type ArrangementSettings, type ArrangementSetup, type ArrangementTensionOptions, ArrangementTrack, Articulation, AugmentedSixthKind, AvailableTensionsOptions, AvoidNotesOptions, BarPosition, BassLineOptions, type BassLineSettings, BassSegment, BorrowedChord, BorrowedSource, CadenceHit, CadenceResult, Chord, ChordAnalysis, Chord$1 as ChordData, ChordLike, ChordMatch, ChordQuality, ChordScaleMatch, ChordScaleReportEntry, ChordSegment, ChordSpan, ChordSpec, ChordSymbolOptions, ChordTimeline, ChordTimelineOptions, ChordToRomanOptions, ChordToneRole, Complexity, Composer, type ComposerOptions, Conflict, CounterMelodyOptions, type CounterMelodySettings, DetectCadenceOptions, DetectChordOptions, DetectKeyOptions, type DetectedKeyMatch, DrumsOptions, Duration, DurationData, EvaluateSafetyOptions, ExplainRomanOptions, ExtractMotifsOptions, FormSection, FormSectionOptions, GenerationContext, GenerationContextInput, GrooveTemplate, HarmonicFunction, HarmonizeOptions, type HarmonizedMelody, HumanizeOptions, Hypermeter, HypermeterOptions, IdentifiedVoiceNote, Instrument, InstrumentProfile, InstrumentProfileLike, Interval, IntervalData, IntervalLike, IntervalQualityLabel, Key, type KeyData, KeyLike, KeyMatch, KeyMode, KeyRegion, KeyRelation, KeyScale, KeyTimelineOptions, KeyVariant, MelodicContour, Meter, MeterLike, MeterMap, Motif, MotifCell, MotifContour, MotifData, type MotifGenerateOptions, MotifNote, MotifRelation, MotifTransform, Note, Note$1 as NoteData, NoteEvent, NoteEventIndex, NoteEventIndexOptions, NoteLike, NoteNameOptions, NoteValue, OrnamentOptions, ParseResult, PartWritingOptions, PartWritingViolation, Phrase, PhraseOptions, PlayabilityReport, PositionalRng, Progression, type ProgressionData, ProgressionOptions, ReduceProgressionOptions, ReducedChord, ResolvedKey, Rhythm, type RhythmData, type RhythmDeformOptions, RhythmEvent, RhythmOptions, RomanExplanation, SafetyQuery, SafetyResult, ScaleChoice, ScaleName, ScaleNameInput, ScaleSystem, Score, type ScoreData, type ScoreOptions, Species, SpeciesOptions, SpelledDuration, SpelledInterval, SpelledKeyLike, StringFingering, StructuralCadence, StyledVoicingOptions, SubstituteOptions, Substitution, SubstitutionType, Tempo, type TempoData, TempoMap, TensionPoint, TimeSignature, Timeline, type TimelineData, type TimelineRoman, TrackEdit, TransposingInstrument, Tuning, TuningTable, Tuplet, Vocabulary, VoiceIndependenceOptions, VoiceIndependenceReport, VoiceRange, Voicing, type VoicingData, type VoicingIndependenceOptions, VoicingOptions, type VoicingSafetyQuery };
5949
+ export { AnalyzeChordOptions, AnalyzedNote, Arrangement, ArrangementAnalysis, type ArrangementData, ArrangementOptions, type ArrangementSettings, type ArrangementSetup, type ArrangementTensionOptions, ArrangementTrack, Articulation, AugmentedSixthKind, AvailableTensionsOptions, AvoidNotesOptions, BarPosition, BassLineOptions, type BassLineSettings, BassSegment, BorrowedChord, BorrowedSource, CadenceHit, CadenceResult, Chord, ChordAnalysis, Chord$1 as ChordData, ChordLike, ChordMatch, ChordQuality, ChordScaleMatch, ChordScaleReportEntry, ChordSegment, ChordSpan, ChordSpec, ChordSymbolOptions, ChordTimeline, ChordTimelineOptions, ChordToRomanOptions, ChordToneRole, Complexity, Composer, type ComposerOptions, CompositionEvaluation, CompositionPlan, CompositionPlanOptions, Conflict, CounterMelodyOptions, type CounterMelodySettings, DetectCadenceOptions, DetectChordOptions, DetectKeyOptions, type DetectedKeyMatch, DrumsOptions, Duration, DurationData, EvaluateCompositionOptions, EvaluateSafetyOptions, ExplainRomanOptions, ExtractMotifsOptions, FormSection, FormSectionOptions, GenerationContext, GenerationContextInput, GrooveTemplate, HarmonicFunction, HarmonizeOptions, type HarmonizedMelody, HumanizeOptions, Hypermeter, HypermeterOptions, IdentifiedVoiceNote, Instrument, InstrumentProfile, InstrumentProfileLike, Interval, IntervalData, IntervalLike, IntervalQualityLabel, Key, type KeyData, KeyLike, KeyMatch, KeyMode, KeyRegion, KeyRelation, KeyScale, KeyTimelineOptions, KeyVariant, MelodicContour, MelodyOptions, Meter, MeterLike, MeterMap, Motif, MotifCell, MotifContour, MotifData, type MotifGenerateOptions, MotifGraph, MotifGraphOptions, MotifNote, MotifRelation, MotifTransform, Note, Note$1 as NoteData, NoteEvent, NoteEventIndex, NoteEventIndexOptions, NoteLike, NoteNameOptions, NoteValue, OrnamentOptions, ParseResult, PartWritingOptions, PartWritingViolation, Phrase, PhraseOptions, PlayabilityReport, PositionalRng, Progression, type ProgressionData, ProgressionOptions, ReduceProgressionOptions, ReducedChord, ReferenceProfile, ReferenceProfileOptions, ResolvedKey, Rhythm, RhythmAnalysis, RhythmAnalysisOptions, type RhythmData, type RhythmDeformOptions, RhythmEvent, RhythmOptions, RomanExplanation, SafetyQuery, SafetyResult, ScaleChoice, ScaleName, ScaleNameInput, ScaleSystem, Score, type ScoreData, type ScoreOptions, Species, SpeciesOptions, SpelledDuration, SpelledInterval, SpelledKeyLike, StringFingering, StructuralCadence, StyledVoicingOptions, SubstituteOptions, Substitution, SubstitutionType, Tempo, type TempoData, TempoMap, TensionPoint, TimeSignature, Timeline, type TimelineData, type TimelineRoman, TrackEdit, TransposingInstrument, Tuning, TuningTable, Tuplet, Vocabulary, VoiceIndependenceOptions, VoiceIndependenceReport, VoiceRange, Voicing, type VoicingData, type VoicingIndependenceOptions, VoicingOptions, type VoicingSafetyQuery };
@@ -1,7 +1,7 @@
1
- import { R as ReduceProgressionOptions, v as ReducedChord, D as DetectChordOptions, C as ChordMatch, h as DetectKeyOptions, K as KeyMatch, d as AugmentedSixthKind, t as PhraseOptions, P as Phrase, S as StructuralCadence, i as FormSectionOptions, F as FormSection, j as HypermeterOptions, H as Hypermeter, E as ExtractMotifsOptions, p as MotifData, k as MelodicContour, c as ArrangementTrack, a as ArrangementOptions, A as ArrangementAnalysis, e as Conflict, z as TrackEdit, T as TensionPoint, r as MotifRelation } from '../index-BRMbPkHE.js';
2
- export { b as ArrangementSession, f as ConflictPartner, g as ContourDirection, l as MelodicContourShape, o as ModalScaleName, q as MotifOccurrence, s as MotifRelationKind, u as PhraseSignal, w as ReductionBasis, x as ReductionLevel, y as TrackAnalysis, B as TrackRole } from '../index-BRMbPkHE.js';
3
- import { k as KeyRegion, f as ChordTimelineOptions, C as CadenceHit, l as KeyTimelineOptions, h as ChordToRomanOptions, e as ChordTimeline, H as HarmonicFunction, A as AnalyzeChordOptions, D as DetectCadenceOptions, c as ChordAnalysis, b as CadenceResult, E as ExplainRomanOptions, m as RomanExplanation, B as BorrowedSource, a as AnalyzedNote, I as IdentifiedVoiceNote } from '../index-CJBBiAmU.js';
4
- export { d as ChordSegmentation, g as ChordTimelineResult, K as KeyContext, i as KeyProfileName, j as KeyProfilePair, P as PivotChord, R as RejectedCandidate, S as SuspensionFigure, T as TheoryLabel, V as VoiceNote } from '../index-CJBBiAmU.js';
1
+ import { D as DetectChordOptions, C as ChordMatch, g as DetectKeyOptions, K as KeyMatch, d as AugmentedSixthKind, k as PhraseOptions, P as Phrase, S as StructuralCadence, h as HypermeterOptions, H as Hypermeter, R as ReferenceProfileOptions, c as ArrangementTrack, a as ArrangementOptions, A as ArrangementAnalysis, e as Conflict, n as TrackEdit, T as TensionPoint } from '../profile-DLdlIpS9.js';
2
+ export { b as ArrangementSession, f as ConflictPartner, j as ModalScaleName, l as PhraseSignal, m as TrackAnalysis, o as TrackRole } from '../profile-DLdlIpS9.js';
3
+ import { r as KeyRegion, i as ChordTimelineOptions, U as ReduceProgressionOptions, V as ReducedChord, c as CadenceHit, s as KeyTimelineOptions, k as ChordToRomanOptions, h as ChordTimeline, o as HarmonicFunction, A as AnalyzeChordOptions, D as DetectCadenceOptions, f as ChordAnalysis, d as CadenceResult, E as ExplainRomanOptions, a9 as RomanExplanation, b as BorrowedSource, n as FormSectionOptions, F as FormSection, m as ExtractMotifsOptions, x as MotifData, u as MelodicContour, a5 as ReferenceProfile, a8 as RhythmAnalysisOptions, a7 as RhythmAnalysis, J as MotifGraphOptions, y as MotifGraph, a as AnalyzedNote, I as IdentifiedVoiceNote, N as MotifRelation } from '../types-Dh7C064C.js';
4
+ export { B as BarPositionProfile, e as CadenceType, g as ChordSegmentation, j as ChordTimelineResult, l as ContourDirection, K as KeyContext, p as KeyProfileName, q as KeyProfilePair, v as MelodicContourShape, z as MotifGraphEdge, G as MotifGraphNode, L as MotifOccurrence, O as MotifRelationKind, P as MotifRelationSummary, Q as PivotChord, W as ReductionBasis, 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, a6 as RejectedCandidate, aa as SuspensionFigure, ab as TheoryLabel, ac as VoiceNote } from '../types-Dh7C064C.js';
5
5
  import { c as IntervalQualityLabel, I as IntervalData, P as ParseResult, S as SpelledInterval, g as Note$1, j as NoteNameOptions, b as IntervalLike, h as NoteEvent, i as NoteLike, e as KeyScale, a as Articulation } from '../index-Cy15oTvh.js';
6
6
  export { B as BudgetExceededError, d as InvalidInputError, L as LibcantusError, N as NoSolutionError, k as NoteNameSystem } from '../index-Cy15oTvh.js';
7
7
  import { K as KeyLike, e as ChordSegment, g as ChordSpan, b as Chord$1, d as ChordQuality, h as ChordSpec, i as ChordToneRole, n as ResolvedKey, k as KeyVariant, j as KeyRelation, c as ChordLike, r as SpelledKeyLike, p as SafetyQuery, E as EvaluateSafetyOptions, q as SafetyResult } from '../coerce-DP0vYu-x.js';
@@ -15,8 +15,8 @@ export { M as MeterChange } from '../index-CL4b4gUQ.js';
15
15
  import { s as ScaleNameInput, r as ScaleName } from '../masks-Cc7-MzzY.js';
16
16
  import { n as TransposingInstrument, r as VoicingOptions, h as ScaleChoice, d as ChordSymbolOptions, m as StyledVoicingOptions, C as ChordScaleMatch, c as ChordScaleReportEntry, A as AvailableTensionsOptions, b as AvoidNotesOptions, K as KeyMode, i as ScaleSystem, q as VoiceRange, P as PartWritingOptions, e as PartWritingViolation, j as Species, k as SpeciesOptions, V as VoiceIndependenceOptions, p as VoiceIndependenceReport } from '../index-BHIUyjhZ.js';
17
17
  export { a as AvoidNoteUse, f as PartWritingViolationKind, o as TransposingInstrumentName, s as VoicingStyle } from '../index-BHIUyjhZ.js';
18
- import { a2 as SubstitutionType, a0 as SubstituteOptions, a1 as Substitution, g as BorrowedChord, z as HumanizeOptions, L as OrnamentOptions, w as GrooveTemplate, d as BassLineOptions, C as Complexity, a4 as Vocabulary, T as ProgressionOptions, o as DrumsOptions, e as BassSegment, h as CounterMelodyOptions, H as HarmonizeOptions, p as GenerationContext, A as MotifCell, F as MotifContour, q as GenerationContextInput, I as MotifNote, K as MotifTransform, Y as RhythmEvent, Z as RhythmOptions } from '../index-BJgP97N1.js';
19
- export { f as BassStyle, l as DrumRole, E as EuclideanKick, r as Genre, s as GridEvent, t as GrooveFeel, u as GrooveSlot, v as GrooveStyle, x as HarmonizePlacement, M as MelodyNote, N as OrnamentStyle, Q as ProgFunction, R as ProgStyle, S as ProgressionDegree, U as ProgressionPreset, V as Provenance, W as ProvenanceBasis, $ as Section } from '../index-BJgP97N1.js';
18
+ import { af as SubstitutionType, ad as SubstituteOptions, ae as Substitution, g as BorrowedChord, L as HumanizeOptions, U as OrnamentOptions, H as GrooveTemplate, j as CompositionPlan, u as EvaluateCompositionOptions, i as CompositionEvaluation, d as BassLineOptions, h as Complexity, ah as Vocabulary, a4 as ProgressionOptions, t as DrumsOptions, e as BassSegment, m as CounterMelodyOptions, I as HarmonizeOptions, k as CompositionPlanOptions, N as MelodyOptions, v as GenerationContext, O as MotifCell, P as MotifContour, w as GenerationContextInput, Q as MotifNote, S as MotifTransform, a9 as RhythmEvent, aa as RhythmOptions } from '../index-zaZdmnU4.js';
19
+ export { f as BassStyle, l as CompositionViolation, q as DrumRole, E as EuclideanKick, x as Genre, y as GridEvent, z as GrooveFeel, A as GrooveSlot, F as GrooveStyle, J as HarmonizePlacement, M as MelodyNote, V as OrnamentStyle, 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, a5 as ProgressionPreset, a6 as Provenance, a7 as ProvenanceBasis, ac as Section } from '../index-zaZdmnU4.js';
20
20
  import '../index-Dw2DP7vm.js';
21
21
 
22
22
  /**
@@ -3236,6 +3236,113 @@ declare class Score {
3236
3236
  * answered for; {@link Score.voices} is what reads the polyphony as polyphony.
3237
3237
  */
3238
3238
  contour(): MelodicContour;
3239
+ /**
3240
+ * The score's structural fingerprint: form, phrase shape, harmonic function
3241
+ * and rhythm, and how its motifs derive from one another.
3242
+ *
3243
+ * The harmony is the score's own kept chord analysis, read once whether this
3244
+ * is asked before or after {@link Score.timeline} — unless `opts.timeline`
3245
+ * gives the harmony directly, in which case the reading runs fresh through
3246
+ * {@link analyzeReference} rather than the harmony this score already holds.
3247
+ * The meter, the key and the span are the score's own and are not on offer
3248
+ * here: a caller wanting another meter reads through {@link
3249
+ * Score.withMeters}, and one wanting another key or span calls {@link
3250
+ * analyzeReference} directly.
3251
+ *
3252
+ * Asked with no options, the answer is kept and a copy of it handed back, as
3253
+ * {@link Score.timeline} keeps its own reading; asked with options, the
3254
+ * answer is read afresh and not kept.
3255
+ *
3256
+ * @param opts The harmony, the melody, and the budget; see {@link
3257
+ * ReferenceProfileOptions}. Meter, key and span are the score's own.
3258
+ * @returns The profile.
3259
+ * @example
3260
+ * ```ts
3261
+ * import { Score } from '@libraz/libcantus';
3262
+ * const triad = (pitches: number[], startBeat: number) =>
3263
+ * pitches.map((pitch) => ({ pitch, startBeat, durationBeat: 4 }));
3264
+ * const score = Score.of(
3265
+ * [
3266
+ * ...triad([60, 64, 67], 0),
3267
+ * ...triad([65, 69, 72], 4),
3268
+ * ...triad([67, 71, 74], 8),
3269
+ * ...triad([60, 64, 67], 12),
3270
+ * ],
3271
+ * { key: 'C major' },
3272
+ * );
3273
+ * score.reference().harmony.chords.map((chord) => chord.roman); // ['I', 'IV', 'V', 'I']
3274
+ * ```
3275
+ */
3276
+ reference(opts?: Omit<ReferenceProfileOptions, 'ts' | 'meters' | 'key' | 'totalBeats'>): ReferenceProfile;
3277
+ /**
3278
+ * The onset placement of the score's melodic line.
3279
+ *
3280
+ * A melody is one line, so a score holding several is read as its top voice,
3281
+ * as {@link Score.motifs} and {@link Score.contour} are.
3282
+ *
3283
+ * @param opts The span's end and the budget; see {@link
3284
+ * RhythmAnalysisOptions}. The meter is the score's own.
3285
+ * @returns The rhythm reading.
3286
+ * @example
3287
+ * ```ts
3288
+ * import { Score } from '@libraz/libcantus';
3289
+ * const score = Score.of([
3290
+ * { pitch: 60, startBeat: 0, durationBeat: 1 },
3291
+ * { pitch: 62, startBeat: 1, durationBeat: 1 },
3292
+ * { pitch: 64, startBeat: 2, durationBeat: 1 },
3293
+ * { pitch: 65, startBeat: 3, durationBeat: 1 },
3294
+ * ]);
3295
+ * score.rhythm().onsetDensity; // 4
3296
+ * ```
3297
+ */
3298
+ rhythm(opts?: Omit<RhythmAnalysisOptions, 'ts' | 'meters'>): RhythmAnalysis;
3299
+ /**
3300
+ * How the score's motifs derive from one another: which statement grew out
3301
+ * of which, and by what transformation.
3302
+ *
3303
+ * {@link Score.motifs} finds the cells; this reads across their occurrences
3304
+ * and names, for every statement after the first, the earlier one it most
3305
+ * plausibly grew out of. A melody is one line, so a score holding several is
3306
+ * read as its top voice, as {@link Score.motifs} is.
3307
+ *
3308
+ * @param opts Cell-length bounds and the recurrence threshold {@link
3309
+ * Score.motifs} takes, plus the variation threshold and the budget; see
3310
+ * {@link MotifGraphOptions} and {@link ExtractMotifsOptions}.
3311
+ * @returns The derivation forest.
3312
+ * @example
3313
+ * ```ts
3314
+ * import { Score } from '@libraz/libcantus';
3315
+ * const score = Score.of([
3316
+ * { pitch: 60, startBeat: 0, durationBeat: 1 },
3317
+ * { pitch: 62, startBeat: 1, durationBeat: 1 },
3318
+ * { pitch: 64, startBeat: 2, durationBeat: 1 },
3319
+ * { pitch: 60, startBeat: 3, durationBeat: 1 },
3320
+ * { pitch: 62, startBeat: 4, durationBeat: 1 },
3321
+ * { pitch: 64, startBeat: 5, durationBeat: 1 },
3322
+ * ]);
3323
+ * score.motifGraph().edges.length; // 1
3324
+ * ```
3325
+ */
3326
+ motifGraph(opts?: MotifGraphOptions & ExtractMotifsOptions): MotifGraph;
3327
+ /**
3328
+ * How this score, read as a melody, keeps to a composition plan.
3329
+ *
3330
+ * @param plan The plan the melody was written for.
3331
+ * @param opts The budget; see {@link EvaluateCompositionOptions}.
3332
+ * @returns The violations found and the fit reading; see {@link
3333
+ * evaluateComposition}.
3334
+ * @example
3335
+ * ```ts
3336
+ * import { Composer, Score } from '@libraz/libcantus';
3337
+ * const notes = [60, 62, 64, 65, 67, 65, 64, 62, 60, 62, 64, 65, 67, 65, 64, 60].map(
3338
+ * (pitch, startBeat) => ({ pitch, startBeat, durationBeat: 1 }),
3339
+ * );
3340
+ * const composer = Composer.of({ key: 'C major', seed: 5 });
3341
+ * const plan = composer.plan(Score.of(notes, { key: 'C major' }).reference());
3342
+ * composer.melody(plan).evaluate(plan).violations.some((v) => v.severity === 'error'); // false
3343
+ * ```
3344
+ */
3345
+ evaluate(plan: CompositionPlan, opts?: EvaluateCompositionOptions): CompositionEvaluation;
3239
3346
  /**
3240
3347
  * Each note's role in the harmony sounding under it.
3241
3348
  *
@@ -3577,6 +3684,47 @@ declare class Arrangement {
3577
3684
  * found under it.
3578
3685
  */
3579
3686
  timeline(): Timeline;
3687
+ /**
3688
+ * The arrangement's structural fingerprint: form, phrase shape, harmonic
3689
+ * function and rhythm, and how its melody's motifs derive from one another.
3690
+ *
3691
+ * The harmony reads the arrangement's own session analysis directly — the
3692
+ * tracks `settings.harmonyTracks` names, or else every track but the
3693
+ * percussion ones — so the harmony is never inferred a second time. The
3694
+ * melody is the notes of the tracks played with `role: 'melody'`, joined in
3695
+ * the order the tracks were given; an arrangement naming none reads the top
3696
+ * line of the harmony notes instead, as {@link analyzeReference} does
3697
+ * without a `melody` option. Meter, key, harmony and melody are the
3698
+ * arrangement's own and are not on offer here: a caller wanting others calls
3699
+ * {@link analyzeReference} directly, with the same notes {@link
3700
+ * Arrangement.tracks} hands out.
3701
+ *
3702
+ * @param opts The budget; see {@link ReferenceProfileOptions}.
3703
+ * @returns The profile.
3704
+ * @example
3705
+ * ```ts
3706
+ * import { Arrangement } from '@libraz/libcantus';
3707
+ * const triad = (pitches: number[], startBeat: number) =>
3708
+ * pitches.map((pitch) => ({ pitch, startBeat, durationBeat: 4 }));
3709
+ * const arrangement = Arrangement.of(
3710
+ * [
3711
+ * {
3712
+ * name: 'lead',
3713
+ * role: 'melody',
3714
+ * notes: [
3715
+ * ...triad([60, 64, 67], 0),
3716
+ * ...triad([65, 69, 72], 4),
3717
+ * ...triad([67, 71, 74], 8),
3718
+ * ...triad([60, 64, 67], 12),
3719
+ * ],
3720
+ * },
3721
+ * ],
3722
+ * { key: 'C major' },
3723
+ * );
3724
+ * arrangement.reference().harmony.chords.map((chord) => chord.roman); // ['I', 'IV', 'V', 'I']
3725
+ * ```
3726
+ */
3727
+ reference(opts?: Omit<ReferenceProfileOptions, 'ts' | 'meters' | 'key' | 'melody' | 'timeline' | 'totalBeats'>): ReferenceProfile;
3580
3728
  /**
3581
3729
  * Whether another arrangement holds the same tracks under the same settings.
3582
3730
  *
@@ -3844,6 +3992,54 @@ declare class Composer {
3844
3992
  * ```
3845
3993
  */
3846
3994
  harmonize(melody: Score, opts?: Omit<HarmonizeOptions, 'melody' | 'key' | 'ts' | 'ctx'>): HarmonizedMelody;
3995
+ /**
3996
+ * A composition plan derived from a reference profile.
3997
+ *
3998
+ * The composer's key is the plan's home key unless `opts.key` names another,
3999
+ * and its seed and algorithm version are the ones the plan records, so the
4000
+ * plan is written under the same recipe as the composer's other parts.
4001
+ *
4002
+ * @param reference The reference profile to derive from.
4003
+ * @param opts Everything {@link deriveCompositionPlan} takes but the context,
4004
+ * which is the composer's.
4005
+ * @returns The plan.
4006
+ * @throws If the composer draws from a caller-held `rng`: a plan records its
4007
+ * seed, and a source cannot be written into it.
4008
+ * @example
4009
+ * ```ts
4010
+ * import { Composer, Score } from '@libraz/libcantus';
4011
+ * const notes = [60, 62, 64, 65, 67, 65, 64, 62, 60, 62, 64, 65, 67, 65, 64, 60].map(
4012
+ * (pitch, startBeat) => ({ pitch, startBeat, durationBeat: 1 }),
4013
+ * );
4014
+ * const reference = Score.of(notes, { key: 'C major' }).reference();
4015
+ * const plan = Composer.of({ key: 'D major', seed: 5 }).plan(reference);
4016
+ * plan.seed; // 5
4017
+ * plan.keys[0].scale.rootPc; // 2
4018
+ * ```
4019
+ */
4020
+ plan(reference: ReferenceProfile, opts?: Omit<CompositionPlanOptions, 'ctx'>): CompositionPlan;
4021
+ /**
4022
+ * A melody written to a composition plan.
4023
+ *
4024
+ * The plan is the reproduction recipe, so its seed and algorithm version are
4025
+ * the ones the melody is drawn under, not the composer's. The score is read
4026
+ * in the plan's meter and home key, at the composer's tempo.
4027
+ *
4028
+ * @param plan The plan to follow.
4029
+ * @param opts The budget; see {@link MelodyOptions}.
4030
+ * @returns The melody, as a score.
4031
+ * @example
4032
+ * ```ts
4033
+ * import { Composer, Score } from '@libraz/libcantus';
4034
+ * const notes = [60, 62, 64, 65, 67, 65, 64, 62, 60, 62, 64, 65, 67, 65, 64, 60].map(
4035
+ * (pitch, startBeat) => ({ pitch, startBeat, durationBeat: 1 }),
4036
+ * );
4037
+ * const composer = Composer.of({ key: 'C major', seed: 5 });
4038
+ * const plan = composer.plan(Score.of(notes, { key: 'C major' }).reference());
4039
+ * composer.melody(plan).notes.length > 0; // true
4040
+ * ```
4041
+ */
4042
+ melody(plan: CompositionPlan, opts?: Omit<MelodyOptions, 'ctx'>): Score;
3847
4043
  /**
3848
4044
  * Whether another composer holds the same settings.
3849
4045
  *
@@ -5750,4 +5946,4 @@ declare class Voicing {
5750
5946
  toString(): string;
5751
5947
  }
5752
5948
 
5753
- export { AnalyzeChordOptions, AnalyzedNote, Arrangement, ArrangementAnalysis, type ArrangementData, ArrangementOptions, type ArrangementSettings, type ArrangementSetup, type ArrangementTensionOptions, ArrangementTrack, Articulation, AugmentedSixthKind, AvailableTensionsOptions, AvoidNotesOptions, BarPosition, BassLineOptions, type BassLineSettings, BassSegment, BorrowedChord, BorrowedSource, CadenceHit, CadenceResult, Chord, ChordAnalysis, Chord$1 as ChordData, ChordLike, ChordMatch, ChordQuality, ChordScaleMatch, ChordScaleReportEntry, ChordSegment, ChordSpan, ChordSpec, ChordSymbolOptions, ChordTimeline, ChordTimelineOptions, ChordToRomanOptions, ChordToneRole, Complexity, Composer, type ComposerOptions, Conflict, CounterMelodyOptions, type CounterMelodySettings, DetectCadenceOptions, DetectChordOptions, DetectKeyOptions, type DetectedKeyMatch, DrumsOptions, Duration, DurationData, EvaluateSafetyOptions, ExplainRomanOptions, ExtractMotifsOptions, FormSection, FormSectionOptions, GenerationContext, GenerationContextInput, GrooveTemplate, HarmonicFunction, HarmonizeOptions, type HarmonizedMelody, HumanizeOptions, Hypermeter, HypermeterOptions, IdentifiedVoiceNote, Instrument, InstrumentProfile, InstrumentProfileLike, Interval, IntervalData, IntervalLike, IntervalQualityLabel, Key, type KeyData, KeyLike, KeyMatch, KeyMode, KeyRegion, KeyRelation, KeyScale, KeyTimelineOptions, KeyVariant, MelodicContour, Meter, MeterLike, MeterMap, Motif, MotifCell, MotifContour, MotifData, type MotifGenerateOptions, MotifNote, MotifRelation, MotifTransform, Note, Note$1 as NoteData, NoteEvent, NoteEventIndex, NoteEventIndexOptions, NoteLike, NoteNameOptions, NoteValue, OrnamentOptions, ParseResult, PartWritingOptions, PartWritingViolation, Phrase, PhraseOptions, PlayabilityReport, PositionalRng, Progression, type ProgressionData, ProgressionOptions, ReduceProgressionOptions, ReducedChord, ResolvedKey, Rhythm, type RhythmData, type RhythmDeformOptions, RhythmEvent, RhythmOptions, RomanExplanation, SafetyQuery, SafetyResult, ScaleChoice, ScaleName, ScaleNameInput, ScaleSystem, Score, type ScoreData, type ScoreOptions, Species, SpeciesOptions, SpelledDuration, SpelledInterval, SpelledKeyLike, StringFingering, StructuralCadence, StyledVoicingOptions, SubstituteOptions, Substitution, SubstitutionType, Tempo, type TempoData, TempoMap, TensionPoint, TimeSignature, Timeline, type TimelineData, type TimelineRoman, TrackEdit, TransposingInstrument, Tuning, TuningTable, Tuplet, Vocabulary, VoiceIndependenceOptions, VoiceIndependenceReport, VoiceRange, Voicing, type VoicingData, type VoicingIndependenceOptions, VoicingOptions, type VoicingSafetyQuery };
5949
+ export { AnalyzeChordOptions, AnalyzedNote, Arrangement, ArrangementAnalysis, type ArrangementData, ArrangementOptions, type ArrangementSettings, type ArrangementSetup, type ArrangementTensionOptions, ArrangementTrack, Articulation, AugmentedSixthKind, AvailableTensionsOptions, AvoidNotesOptions, BarPosition, BassLineOptions, type BassLineSettings, BassSegment, BorrowedChord, BorrowedSource, CadenceHit, CadenceResult, Chord, ChordAnalysis, Chord$1 as ChordData, ChordLike, ChordMatch, ChordQuality, ChordScaleMatch, ChordScaleReportEntry, ChordSegment, ChordSpan, ChordSpec, ChordSymbolOptions, ChordTimeline, ChordTimelineOptions, ChordToRomanOptions, ChordToneRole, Complexity, Composer, type ComposerOptions, CompositionEvaluation, CompositionPlan, CompositionPlanOptions, Conflict, CounterMelodyOptions, type CounterMelodySettings, DetectCadenceOptions, DetectChordOptions, DetectKeyOptions, type DetectedKeyMatch, DrumsOptions, Duration, DurationData, EvaluateCompositionOptions, EvaluateSafetyOptions, ExplainRomanOptions, ExtractMotifsOptions, FormSection, FormSectionOptions, GenerationContext, GenerationContextInput, GrooveTemplate, HarmonicFunction, HarmonizeOptions, type HarmonizedMelody, HumanizeOptions, Hypermeter, HypermeterOptions, IdentifiedVoiceNote, Instrument, InstrumentProfile, InstrumentProfileLike, Interval, IntervalData, IntervalLike, IntervalQualityLabel, Key, type KeyData, KeyLike, KeyMatch, KeyMode, KeyRegion, KeyRelation, KeyScale, KeyTimelineOptions, KeyVariant, MelodicContour, MelodyOptions, Meter, MeterLike, MeterMap, Motif, MotifCell, MotifContour, MotifData, type MotifGenerateOptions, MotifGraph, MotifGraphOptions, MotifNote, MotifRelation, MotifTransform, Note, Note$1 as NoteData, NoteEvent, NoteEventIndex, NoteEventIndexOptions, NoteLike, NoteNameOptions, NoteValue, OrnamentOptions, ParseResult, PartWritingOptions, PartWritingViolation, Phrase, PhraseOptions, PlayabilityReport, PositionalRng, Progression, type ProgressionData, ProgressionOptions, ReduceProgressionOptions, ReducedChord, ReferenceProfile, ReferenceProfileOptions, ResolvedKey, Rhythm, RhythmAnalysis, RhythmAnalysisOptions, type RhythmData, type RhythmDeformOptions, RhythmEvent, RhythmOptions, RomanExplanation, SafetyQuery, SafetyResult, ScaleChoice, ScaleName, ScaleNameInput, ScaleSystem, Score, type ScoreData, type ScoreOptions, Species, SpeciesOptions, SpelledDuration, SpelledInterval, SpelledKeyLike, StringFingering, StructuralCadence, StyledVoicingOptions, SubstituteOptions, Substitution, SubstitutionType, Tempo, type TempoData, TempoMap, TensionPoint, TimeSignature, Timeline, type TimelineData, type TimelineRoman, TrackEdit, TransposingInstrument, Tuning, TuningTable, Tuplet, Vocabulary, VoiceIndependenceOptions, VoiceIndependenceReport, VoiceRange, Voicing, type VoicingData, type VoicingIndependenceOptions, VoicingOptions, type VoicingSafetyQuery };
@@ -16,11 +16,11 @@ import {
16
16
  Timeline,
17
17
  Tuning,
18
18
  Voicing
19
- } from "../chunk-FBH75DAY.js";
20
- import "../chunk-HYJJ2V2I.js";
19
+ } from "../chunk-IPEF6NWB.js";
20
+ import "../chunk-MLBPXA4Z.js";
21
21
  import "../chunk-UMWZ4ZET.js";
22
- import "../chunk-Q6LFSAKV.js";
23
- import "../chunk-H2KJHBW4.js";
22
+ import "../chunk-CPMB7P75.js";
23
+ import "../chunk-GNVN4PPJ.js";
24
24
  import "../chunk-7KG3RTYS.js";
25
25
  import "../chunk-PUKJP2Z5.js";
26
26
  import "../chunk-M5RYMAFI.js";