@libraz/libcantus 1.0.0 → 1.0.1
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/dist/analyze/index.cjs +2 -2
- package/dist/analyze/index.js +1 -1
- package/dist/{chunk-GOZG57ER.js → chunk-2LCPM3EG.js} +8 -4
- package/dist/chunk-2LCPM3EG.js.map +1 -0
- package/dist/{chunk-M4CWTJWJ.cjs → chunk-6XH6QZYQ.cjs} +33 -33
- package/dist/{chunk-M4CWTJWJ.cjs.map → chunk-6XH6QZYQ.cjs.map} +1 -1
- package/dist/{chunk-3JXCW6DX.cjs → chunk-B6XNKWZV.cjs} +8 -4
- package/dist/chunk-B6XNKWZV.cjs.map +1 -0
- package/dist/{chunk-4A2RMUCC.js → chunk-PKFNUHDY.js} +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/dist/model/index.cjs +3 -3
- package/dist/model/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-3JXCW6DX.cjs.map +0 -1
- package/dist/chunk-GOZG57ER.js.map +0 -1
- /package/dist/{chunk-4A2RMUCC.js.map → chunk-PKFNUHDY.js.map} +0 -0
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkB6XNKWZVcjs = require('./chunk-B6XNKWZV.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -1064,7 +1064,7 @@ var Timeline = class _Timeline {
|
|
|
1064
1064
|
* @returns The timeline.
|
|
1065
1065
|
*/
|
|
1066
1066
|
static fromChords(spans, totalBeats, key) {
|
|
1067
|
-
const timeline =
|
|
1067
|
+
const timeline = _chunkB6XNKWZVcjs.chordTimelineFromChords.call(void 0, spans, totalBeats);
|
|
1068
1068
|
const data = { segments: timeline.segments, totalBeats };
|
|
1069
1069
|
if (key !== void 0) {
|
|
1070
1070
|
data.keys = [
|
|
@@ -1088,7 +1088,7 @@ var Timeline = class _Timeline {
|
|
|
1088
1088
|
* @returns The inferred timeline, carrying the key regions the analysis found.
|
|
1089
1089
|
*/
|
|
1090
1090
|
static fromNotes(notes, opts) {
|
|
1091
|
-
const { timeline, keys, segmentConfidence } =
|
|
1091
|
+
const { timeline, keys, segmentConfidence } = _chunkB6XNKWZVcjs.chordTimelineFromNotes.call(void 0, notes, opts);
|
|
1092
1092
|
const totalBeats = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _7 => _7.totalBeats]), () => ( spanEnd(timeline.segments, keys)));
|
|
1093
1093
|
return new _Timeline({ segments: timeline.segments, totalBeats, keys, segmentConfidence });
|
|
1094
1094
|
}
|
|
@@ -1150,7 +1150,7 @@ var Timeline = class _Timeline {
|
|
|
1150
1150
|
}
|
|
1151
1151
|
/** The key held longest across the span, when the analysis found one. */
|
|
1152
1152
|
get key() {
|
|
1153
|
-
const prevailing =
|
|
1153
|
+
const prevailing = _chunkB6XNKWZVcjs.prevailingKeyOf.call(void 0, this.#keys);
|
|
1154
1154
|
return prevailing === null ? void 0 : Key.of(prevailing);
|
|
1155
1155
|
}
|
|
1156
1156
|
/** Every key region under the span, in time order. */
|
|
@@ -1213,7 +1213,7 @@ var Timeline = class _Timeline {
|
|
|
1213
1213
|
* @throws If the timeline carries no key region to read the chords against.
|
|
1214
1214
|
*/
|
|
1215
1215
|
reduce(opts) {
|
|
1216
|
-
return
|
|
1216
|
+
return _chunkB6XNKWZVcjs.reduceProgression.call(void 0, this.chordTimeline, this.#keyContext(), opts);
|
|
1217
1217
|
}
|
|
1218
1218
|
/**
|
|
1219
1219
|
* The cadences the harmony arrives at.
|
|
@@ -1226,7 +1226,7 @@ var Timeline = class _Timeline {
|
|
|
1226
1226
|
* @throws If the timeline carries no key region to read the chords against.
|
|
1227
1227
|
*/
|
|
1228
1228
|
cadences() {
|
|
1229
|
-
return
|
|
1229
|
+
return _chunkB6XNKWZVcjs.detectCadences.call(void 0, this.chordTimeline, this.#keyContext());
|
|
1230
1230
|
}
|
|
1231
1231
|
/**
|
|
1232
1232
|
* The chords as roman numerals in a key.
|
|
@@ -1368,8 +1368,8 @@ var Timeline = class _Timeline {
|
|
|
1368
1368
|
}
|
|
1369
1369
|
/** The key in force at a beat, or undefined when the timeline knows none. */
|
|
1370
1370
|
#keyAt(beat) {
|
|
1371
|
-
const prevailing =
|
|
1372
|
-
return prevailing === null ? void 0 : Key.of(
|
|
1371
|
+
const prevailing = _chunkB6XNKWZVcjs.prevailingKeyOf.call(void 0, this.#keys);
|
|
1372
|
+
return prevailing === null ? void 0 : Key.of(_chunkB6XNKWZVcjs.keyLookup.call(void 0, this.#keys, prevailing)(beat));
|
|
1373
1373
|
}
|
|
1374
1374
|
/**
|
|
1375
1375
|
* The key every beat of the timeline is read against.
|
|
@@ -1379,13 +1379,13 @@ var Timeline = class _Timeline {
|
|
|
1379
1379
|
* the prevailing key.
|
|
1380
1380
|
*/
|
|
1381
1381
|
#keyContext() {
|
|
1382
|
-
const prevailing =
|
|
1382
|
+
const prevailing = _chunkB6XNKWZVcjs.prevailingKeyOf.call(void 0, this.#keys);
|
|
1383
1383
|
if (prevailing === null) {
|
|
1384
1384
|
throw new (0, _chunkQ2WGKJNNcjs.InvalidInputError)(
|
|
1385
1385
|
"timeline carries no key; build it from notes, or pass a key to Timeline.fromChords"
|
|
1386
1386
|
);
|
|
1387
1387
|
}
|
|
1388
|
-
return
|
|
1388
|
+
return _chunkB6XNKWZVcjs.keyLookup.call(void 0, this.#keys, prevailing);
|
|
1389
1389
|
}
|
|
1390
1390
|
/** Move every chord and every key region by the same step. */
|
|
1391
1391
|
#moved(moveChord, moveKey) {
|
|
@@ -4324,7 +4324,7 @@ var Score = class _Score {
|
|
|
4324
4324
|
* and how sure it is of each segment.
|
|
4325
4325
|
*/
|
|
4326
4326
|
timeline(opts) {
|
|
4327
|
-
const result =
|
|
4327
|
+
const result = _chunkB6XNKWZVcjs.chordTimelineFromNotes.call(void 0, this.#data.notes, this.#analysisOptions(opts));
|
|
4328
4328
|
return Timeline.fromData({
|
|
4329
4329
|
segments: result.timeline.segments,
|
|
4330
4330
|
totalBeats: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _41 => _41.totalBeats]), () => ( this.totalBeats)),
|
|
@@ -4346,7 +4346,7 @@ var Score = class _Score {
|
|
|
4346
4346
|
if (this.#key !== void 0) {
|
|
4347
4347
|
return this.#key;
|
|
4348
4348
|
}
|
|
4349
|
-
const prevailing =
|
|
4349
|
+
const prevailing = _chunkB6XNKWZVcjs.prevailingKeyOf.call(void 0, this.#keyRegions());
|
|
4350
4350
|
return prevailing === null ? void 0 : Key.of(prevailing);
|
|
4351
4351
|
}
|
|
4352
4352
|
/**
|
|
@@ -4356,7 +4356,7 @@ var Score = class _Score {
|
|
|
4356
4356
|
* @returns The regions; empty when nothing sounds.
|
|
4357
4357
|
*/
|
|
4358
4358
|
keys(opts) {
|
|
4359
|
-
return
|
|
4359
|
+
return _chunkB6XNKWZVcjs.keyTimelineFromNotes.call(void 0, this.#data.notes, { meters: this.#data.meters, ...opts });
|
|
4360
4360
|
}
|
|
4361
4361
|
/**
|
|
4362
4362
|
* Every key the score could be in, ranked, read as one key across the whole
|
|
@@ -4394,7 +4394,7 @@ var Score = class _Score {
|
|
|
4394
4394
|
* @returns The phrases, in time order.
|
|
4395
4395
|
*/
|
|
4396
4396
|
phrases(opts) {
|
|
4397
|
-
return
|
|
4397
|
+
return _chunkB6XNKWZVcjs.phrasesFromTimeline.call(void 0, this.#chordTimeline(), this.#data.notes, {
|
|
4398
4398
|
meters: this.#data.meters,
|
|
4399
4399
|
...this.#key === void 0 ? {} : { key: this.#key.scale },
|
|
4400
4400
|
...opts
|
|
@@ -4414,7 +4414,7 @@ var Score = class _Score {
|
|
|
4414
4414
|
* @returns The cadences, heaviest first; ties keep the earlier one.
|
|
4415
4415
|
*/
|
|
4416
4416
|
structuralCadences(opts) {
|
|
4417
|
-
return
|
|
4417
|
+
return _chunkB6XNKWZVcjs.structuralCadences.call(void 0, this.phrases(opts));
|
|
4418
4418
|
}
|
|
4419
4419
|
/**
|
|
4420
4420
|
* The sections the score divides into.
|
|
@@ -4423,7 +4423,7 @@ var Score = class _Score {
|
|
|
4423
4423
|
* @returns The sections, in time order.
|
|
4424
4424
|
*/
|
|
4425
4425
|
sections(opts) {
|
|
4426
|
-
return
|
|
4426
|
+
return _chunkB6XNKWZVcjs.sectionsFromNotes.call(void 0, this.#data.notes, { meters: this.#data.meters, ...opts });
|
|
4427
4427
|
}
|
|
4428
4428
|
/**
|
|
4429
4429
|
* The bar-level pulse above the meter.
|
|
@@ -4432,7 +4432,7 @@ var Score = class _Score {
|
|
|
4432
4432
|
* @returns The grouping, its downbeats, a confidence, and a rationale.
|
|
4433
4433
|
*/
|
|
4434
4434
|
hypermeter(opts) {
|
|
4435
|
-
return
|
|
4435
|
+
return _chunkB6XNKWZVcjs.hypermeter.call(void 0, this.#data.notes, this.#data.meters, opts);
|
|
4436
4436
|
}
|
|
4437
4437
|
/**
|
|
4438
4438
|
* The motifs the melody repeats.
|
|
@@ -4465,11 +4465,11 @@ var Score = class _Score {
|
|
|
4465
4465
|
* ```
|
|
4466
4466
|
*/
|
|
4467
4467
|
motifs(opts) {
|
|
4468
|
-
return
|
|
4468
|
+
return _chunkB6XNKWZVcjs.extractMotifs.call(void 0, this.#data.notes, opts);
|
|
4469
4469
|
}
|
|
4470
4470
|
/** The shape the melody traces. */
|
|
4471
4471
|
contour() {
|
|
4472
|
-
return
|
|
4472
|
+
return _chunkB6XNKWZVcjs.melodicContour.call(void 0, this.#data.notes);
|
|
4473
4473
|
}
|
|
4474
4474
|
/**
|
|
4475
4475
|
* Each note's role in the harmony sounding under it.
|
|
@@ -4486,7 +4486,7 @@ var Score = class _Score {
|
|
|
4486
4486
|
*/
|
|
4487
4487
|
voices(key) {
|
|
4488
4488
|
const timeline = this.#chordTimeline();
|
|
4489
|
-
return
|
|
4489
|
+
return _chunkB6XNKWZVcjs.analyzeVoice.call(void 0, this.#data.notes, timeline.at, this.#keyContext(key));
|
|
4490
4490
|
}
|
|
4491
4491
|
/**
|
|
4492
4492
|
* The notes carrying the ids the voice analysis reports them back under.
|
|
@@ -4500,7 +4500,7 @@ var Score = class _Score {
|
|
|
4500
4500
|
* @returns One voice note per note, in the score's own time order.
|
|
4501
4501
|
*/
|
|
4502
4502
|
voiceNotes() {
|
|
4503
|
-
return
|
|
4503
|
+
return _chunkB6XNKWZVcjs.toVoiceNotes.call(void 0, this.#data.notes);
|
|
4504
4504
|
}
|
|
4505
4505
|
/**
|
|
4506
4506
|
* Whether an instrument can play the score, and what makes it hard.
|
|
@@ -4629,11 +4629,11 @@ var Score = class _Score {
|
|
|
4629
4629
|
* another builds it through {@link Score.timeline}.
|
|
4630
4630
|
*/
|
|
4631
4631
|
#chordTimeline() {
|
|
4632
|
-
return
|
|
4632
|
+
return _chunkB6XNKWZVcjs.chordTimelineFromNotes.call(void 0, this.#data.notes, this.#analysisOptions()).timeline;
|
|
4633
4633
|
}
|
|
4634
4634
|
/** The key regions under the score, read against its own meter. */
|
|
4635
4635
|
#keyRegions() {
|
|
4636
|
-
return
|
|
4636
|
+
return _chunkB6XNKWZVcjs.keyTimelineFromNotes.call(void 0, this.#data.notes, { meters: this.#data.meters });
|
|
4637
4637
|
}
|
|
4638
4638
|
/** The score's context as chord-timeline options, with the caller's on top. */
|
|
4639
4639
|
#analysisOptions(opts) {
|
|
@@ -4655,8 +4655,8 @@ var Score = class _Score {
|
|
|
4655
4655
|
return this.#key.scale;
|
|
4656
4656
|
}
|
|
4657
4657
|
const regions = this.#keyRegions();
|
|
4658
|
-
const prevailing = _nullishCoalesce(
|
|
4659
|
-
return
|
|
4658
|
+
const prevailing = _nullishCoalesce(_chunkB6XNKWZVcjs.prevailingKeyOf.call(void 0, regions), () => ( Key.major("C").scale));
|
|
4659
|
+
return _chunkB6XNKWZVcjs.keyLookup.call(void 0, regions, prevailing);
|
|
4660
4660
|
}
|
|
4661
4661
|
};
|
|
4662
4662
|
function sameNote(note, other) {
|
|
@@ -4997,7 +4997,7 @@ var Arrangement = class _Arrangement {
|
|
|
4997
4997
|
* @returns One tension reading per sampled beat, in beat order.
|
|
4998
4998
|
*/
|
|
4999
4999
|
tension(opts) {
|
|
5000
|
-
return
|
|
5000
|
+
return _chunkB6XNKWZVcjs.tensionCurveFrom.call(void 0,
|
|
5001
5001
|
[...this.#data.tracks],
|
|
5002
5002
|
this.#session().analysis,
|
|
5003
5003
|
this.#layered(analysisOptionsOf(opts))
|
|
@@ -5023,7 +5023,7 @@ var Arrangement = class _Arrangement {
|
|
|
5023
5023
|
* tracks exceed the budget.
|
|
5024
5024
|
*/
|
|
5025
5025
|
analyze(opts) {
|
|
5026
|
-
return
|
|
5026
|
+
return _chunkB6XNKWZVcjs.analyzeArrangement.call(void 0, [...this.#data.tracks], this.#layered(analysisOptionsOf(opts)));
|
|
5027
5027
|
}
|
|
5028
5028
|
/**
|
|
5029
5029
|
* The harmony the tracks spell out together, in time.
|
|
@@ -5065,7 +5065,7 @@ var Arrangement = class _Arrangement {
|
|
|
5065
5065
|
}
|
|
5066
5066
|
/** The open reading, analysing the tracks on the first call. */
|
|
5067
5067
|
#session() {
|
|
5068
|
-
const open = _nullishCoalesce(this.#open, () => (
|
|
5068
|
+
const open = _nullishCoalesce(this.#open, () => ( _chunkB6XNKWZVcjs.createArrangementSession.call(void 0, [...this.#data.tracks], this.#analysisOptions())));
|
|
5069
5069
|
this.#open = open;
|
|
5070
5070
|
return open;
|
|
5071
5071
|
}
|
|
@@ -6363,9 +6363,9 @@ var Motif = class _Motif {
|
|
|
6363
6363
|
* @returns The relation, or null when the two stand in none.
|
|
6364
6364
|
*/
|
|
6365
6365
|
relateTo(other, key) {
|
|
6366
|
-
return
|
|
6367
|
-
|
|
6368
|
-
|
|
6366
|
+
return _chunkB6XNKWZVcjs.relateMotifs.call(void 0,
|
|
6367
|
+
_chunkB6XNKWZVcjs.motifFromNotes.call(void 0, this.#cell.notes),
|
|
6368
|
+
_chunkB6XNKWZVcjs.motifFromNotes.call(void 0, other.notes),
|
|
6369
6369
|
key === void 0 ? void 0 : _chunkUADYAYATcjs.toKeyScale.call(void 0, key)
|
|
6370
6370
|
);
|
|
6371
6371
|
}
|
|
@@ -6380,7 +6380,7 @@ var Motif = class _Motif {
|
|
|
6380
6380
|
* @returns The likeness: 1 for the same line, a transposition of it included.
|
|
6381
6381
|
*/
|
|
6382
6382
|
similarityTo(other) {
|
|
6383
|
-
return
|
|
6383
|
+
return _chunkB6XNKWZVcjs.melodicSimilarity.call(void 0, this.#cell.notes, other.notes);
|
|
6384
6384
|
}
|
|
6385
6385
|
/**
|
|
6386
6386
|
* The cell as a score, so it reaches the rest of the class API.
|
|
@@ -7644,4 +7644,4 @@ var Voicing = class _Voicing {
|
|
|
7644
7644
|
|
|
7645
7645
|
|
|
7646
7646
|
exports.Interval = Interval; exports.Note = Note; exports.Timeline = Timeline; exports.Progression = Progression; exports.Chord = Chord; exports.Key = Key; exports.Score = Score; exports.Arrangement = Arrangement; exports.Instrument = Instrument; exports.Composer = Composer; exports.Duration = Duration; exports.Meter = Meter; exports.Motif = Motif; exports.Rhythm = Rhythm; exports.Tempo = Tempo; exports.Tuning = Tuning; exports.Voicing = Voicing;
|
|
7647
|
-
//# sourceMappingURL=chunk-
|
|
7647
|
+
//# sourceMappingURL=chunk-6XH6QZYQ.cjs.map
|