tonus 0.7.0 → 0.8.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/dist/engines/score/api.d.ts +3 -3
- package/dist/engines/score/api.js +3 -3
- package/dist/engines/score/{prosody.d.ts → metrics.d.ts} +3 -3
- package/dist/engines/score/{prosody.js → metrics.js} +2 -2
- package/dist/engines/score/phrasing.js +1 -1
- package/dist/index.d.ts +2 -2
- package/docs/api/chant.md +1 -1
- package/docs/api/index.md +1 -1
- package/docs/api/score.md +9 -9
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Imprint } from "../imprint.js";
|
|
2
|
-
import { type
|
|
2
|
+
import { type Metrics } from "./metrics.js";
|
|
3
3
|
import { type Cadence } from "./cadence.js";
|
|
4
4
|
import { type Modulation } from "./modulation.js";
|
|
5
5
|
import { type ChantTabulaRow } from "./tabula.js";
|
|
@@ -28,7 +28,7 @@ export interface Score {
|
|
|
28
28
|
phrases: IRPhrase[];
|
|
29
29
|
errors: ParseError[];
|
|
30
30
|
tabula: ChantTabulaRow[];
|
|
31
|
-
|
|
31
|
+
metrics: Metrics;
|
|
32
32
|
/** Mode-specific cadence at each phrase-ending divisio. */
|
|
33
33
|
cadences: Cadence[];
|
|
34
34
|
/** Passages where the tonal centre leans away from the home mode. */
|
|
@@ -38,7 +38,7 @@ export interface Score {
|
|
|
38
38
|
/**
|
|
39
39
|
* Score builder (`tonus.notatio`). Parses a chant's GABC into a musical
|
|
40
40
|
* IR — phrases, syllables, notes with tuned pitches, arsis/thesis
|
|
41
|
-
* rhythm,
|
|
41
|
+
* rhythm, metrics, imprint, and a tabula. Options: a temperamentum
|
|
42
42
|
* (tuning), a pondus (articulation weight, style name or opts), and an
|
|
43
43
|
* accentus (phrasing, style name or opts).
|
|
44
44
|
* @throws Error on invalid Chant input or unparseable GABC.
|
|
@@ -6,7 +6,7 @@ import { buildIR } from "./ir.js";
|
|
|
6
6
|
import { buildRatios } from "../temper/scale.js";
|
|
7
7
|
import { computeMeta } from "./meta.js";
|
|
8
8
|
import { computeImprint } from "../imprint.js";
|
|
9
|
-
import {
|
|
9
|
+
import { computeMetrics } from "./metrics.js";
|
|
10
10
|
import { detectCadences } from "./cadence.js";
|
|
11
11
|
import { detectModulations } from "./modulation.js";
|
|
12
12
|
import { computeTabula } from "./tabula.js";
|
|
@@ -33,7 +33,7 @@ function resolveAccentus(input) {
|
|
|
33
33
|
/**
|
|
34
34
|
* Score builder (`tonus.notatio`). Parses a chant's GABC into a musical
|
|
35
35
|
* IR — phrases, syllables, notes with tuned pitches, arsis/thesis
|
|
36
|
-
* rhythm,
|
|
36
|
+
* rhythm, metrics, imprint, and a tabula. Options: a temperamentum
|
|
37
37
|
* (tuning), a pondus (articulation weight, style name or opts), and an
|
|
38
38
|
* accentus (phrasing, style name or opts).
|
|
39
39
|
* @throws Error on invalid Chant input or unparseable GABC.
|
|
@@ -98,7 +98,7 @@ export function buildScore(chant, opts) {
|
|
|
98
98
|
phrases: ir.phrases,
|
|
99
99
|
errors: ir.errors,
|
|
100
100
|
tabula,
|
|
101
|
-
|
|
101
|
+
metrics: computeMetrics(ir.phrases),
|
|
102
102
|
cadences,
|
|
103
103
|
modulations,
|
|
104
104
|
imprint: computeImprint(ir.phrases, scale, {
|
|
@@ -48,7 +48,7 @@ export interface Arcus {
|
|
|
48
48
|
*/
|
|
49
49
|
archIndex: number;
|
|
50
50
|
}
|
|
51
|
-
export interface
|
|
51
|
+
export interface Metrics {
|
|
52
52
|
noteCount: number;
|
|
53
53
|
syllableCount: number;
|
|
54
54
|
phraseCount: number;
|
|
@@ -69,5 +69,5 @@ export interface Prosody {
|
|
|
69
69
|
cadenceWeight: number;
|
|
70
70
|
cadenceDistribution: CadenceDistribution;
|
|
71
71
|
}
|
|
72
|
-
export declare function
|
|
73
|
-
//# sourceMappingURL=
|
|
72
|
+
export declare function computeMetrics(phrases: Phrase[]): Metrics;
|
|
73
|
+
//# sourceMappingURL=metrics.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function computeMetrics(phrases) {
|
|
2
2
|
let phraseCount = 0;
|
|
3
3
|
let noteCount = 0;
|
|
4
4
|
let syllableCount = 0;
|
|
@@ -175,4 +175,4 @@ export function computeProsody(phrases) {
|
|
|
175
175
|
cadenceDistribution: cadDist,
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
//# sourceMappingURL=
|
|
178
|
+
//# sourceMappingURL=metrics.js.map
|
|
@@ -163,7 +163,7 @@ const CADENCE_VELOCITY_FACTOR = 0.5;
|
|
|
163
163
|
const CADENCE_DURATION_FACTOR = 0.6;
|
|
164
164
|
// The phrasing-side reading of the divisio (bar-line) hierarchy. This is the
|
|
165
165
|
// same bar hierarchy tabulated canonically in ../../../docs/api/score.md and
|
|
166
|
-
// weighted for analysis by
|
|
166
|
+
// weighted for analysis by metrics.ts's cadenceWeight ladder — but here the
|
|
167
167
|
// weights differ on purpose:
|
|
168
168
|
// this is a *shaping* factor, so the virgula (`) gets 0 (a breath, no cadential
|
|
169
169
|
// stress), where the analytic ladder still counts it. Do not unify the three.
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import type { Score, ScoreOpts, PondusInput, PondusOpts, AccentusInput, Accentus
|
|
|
17
17
|
import type { InscriptioOpts, Inscriptio, NoteGeometry, FontSpec, FontSlot, FontEmbed } from "./engines/score/inscriptio.js";
|
|
18
18
|
import type { ChantTabulaRow } from "./engines/score/tabula.js";
|
|
19
19
|
import type { Imprint, Attractor, VowelAttractor, ModalAffinity } from "./engines/imprint.js";
|
|
20
|
-
import type {
|
|
20
|
+
import type { Metrics, RhythmicProfile, NoteRange, CadenceDistribution } from "./engines/score/metrics.js";
|
|
21
21
|
import type { Harmony, HarmoniaOpts, VoicedBody, VoicedAspect, Frame, Author } from "./engines/harmonia/api.js";
|
|
22
22
|
import type { HarmonyTabulaRow } from "./engines/harmonia/tabula.js";
|
|
23
23
|
import type { PlanetVowel } from "./engines/harmonia/data/vowels.js";
|
|
@@ -58,5 +58,5 @@ export { CADENTIAE, CADENTIAE_POPULATION } from "./data/cadentiae.js";
|
|
|
58
58
|
export type { CadentiaFamilia } from "./data/cadentiae.js";
|
|
59
59
|
export { ZODIACA } from "./engines/harmonia/data/zodiac.js";
|
|
60
60
|
export { CENSUS_GROUPS, CENSUS_ORDER } from "./data/census.js";
|
|
61
|
-
export type { Feast, FeastQuery, Pascha, Season, Grade, Chant, CantusQuery, OrdinaryChant, PropriumQuery, OrdinariumQuery, OfficiumQuery, PsalmusQuery, Corpus, GenusCount, ModeCount, SharedCount, CorpusLedger, CorpusFullCount, CorpusQuery, Census, CensusQuery, CensusBy, CensusGroup, CensusGroupProfile, CensusNeighbor, Temperamentum, TemperamentumInput, TemperamentumOpts, Tuning, Pitch, PitchInput, Step, Neume, NeumeShape, Interval, ModeData, CadenceFigure, Modus, TunedNote, GamutOptions, Tonus, TonusOpts, Score, ScoreOpts, PondusInput, PondusOpts, AccentusInput, AccentusOpts, Cadence, CadenceTarget, CadenceApproach, Modulation, InscriptioOpts, Inscriptio, NoteGeometry, FontSpec, FontSlot, FontEmbed, ChantTabulaRow, Note, Performance, Phrase, Syllable, LyricRun, RestEvent, ParseError, ArsisThesis, RhythmicType, CompoundBeat, VoicedPitch, Cosmos, CosmosQuery, Body, BodyName, Aspect, Imprint, Attractor, VowelAttractor, ModalAffinity,
|
|
61
|
+
export type { Feast, FeastQuery, Pascha, Season, Grade, Chant, CantusQuery, OrdinaryChant, PropriumQuery, OrdinariumQuery, OfficiumQuery, PsalmusQuery, Corpus, GenusCount, ModeCount, SharedCount, CorpusLedger, CorpusFullCount, CorpusQuery, Census, CensusQuery, CensusBy, CensusGroup, CensusGroupProfile, CensusNeighbor, Temperamentum, TemperamentumInput, TemperamentumOpts, Tuning, Pitch, PitchInput, Step, Neume, NeumeShape, Interval, ModeData, CadenceFigure, Modus, TunedNote, GamutOptions, Tonus, TonusOpts, Score, ScoreOpts, PondusInput, PondusOpts, AccentusInput, AccentusOpts, Cadence, CadenceTarget, CadenceApproach, Modulation, InscriptioOpts, Inscriptio, NoteGeometry, FontSpec, FontSlot, FontEmbed, ChantTabulaRow, Note, Performance, Phrase, Syllable, LyricRun, RestEvent, ParseError, ArsisThesis, RhythmicType, CompoundBeat, VoicedPitch, Cosmos, CosmosQuery, Body, BodyName, Aspect, Imprint, Attractor, VowelAttractor, ModalAffinity, Metrics, RhythmicProfile, NoteRange, CadenceDistribution, Harmony, HarmoniaOpts, VoicedBody, VoicedAspect, Frame, Author, HarmonyTabulaRow, PlanetVowel, };
|
|
62
62
|
//# sourceMappingURL=index.d.ts.map
|
package/docs/api/chant.md
CHANGED
|
@@ -601,7 +601,7 @@ phrase punctuation ([score.md](score.md#the-tabula)).
|
|
|
601
601
|
|
|
602
602
|
Because the encoding is textual, lyrics and neumes stay aligned syllable
|
|
603
603
|
by syllable, which is what lets `tonus.notatio` reconstruct syllables,
|
|
604
|
-
neumes, and
|
|
604
|
+
neumes, and metrics without images.
|
|
605
605
|
|
|
606
606
|
### The Mass: proper and ordinary
|
|
607
607
|
|
package/docs/api/index.md
CHANGED
|
@@ -173,7 +173,7 @@ the list resolve their pitches through the ones before.
|
|
|
173
173
|
- [The tabula](score.md#the-tabula)
|
|
174
174
|
- [Rendering — `inscriptio`](score.md#rendering) · [theme](score.md#theme--faces-and-ink) · [The analysis tracks](score.md#the-analysis-tracks)
|
|
175
175
|
- [The imprint](score.md#the-imprint)
|
|
176
|
-
- [
|
|
176
|
+
- [Metrics](score.md#metrics)
|
|
177
177
|
- [Cadences](score.md#cadences) · [One spine, two annotations](score.md#one-spine-two-annotations)
|
|
178
178
|
- [Modulations](score.md#modulations)
|
|
179
179
|
- [Theory & Context](score.md#theory--context) · [Sources](score.md#sources)
|
package/docs/api/score.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`tonus.notatio` renders a chant into a score: the analyzed, tuned, and
|
|
4
4
|
rhythm-classified reading of one GABC melody. The score is data: `phrases`,
|
|
5
|
-
`tabula`, `
|
|
5
|
+
`tabula`, `metrics`, `cadences`, `modulations`, and `imprint`. The
|
|
6
6
|
standalone `tonus.inscriptio(score)` draws it to SVG.
|
|
7
7
|
|
|
8
8
|
- [Score](#score)
|
|
@@ -15,7 +15,7 @@ standalone `tonus.inscriptio(score)` draws it to SVG.
|
|
|
15
15
|
- [theme — faces and ink](#theme--faces-and-ink)
|
|
16
16
|
- [The analysis tracks](#the-analysis-tracks)
|
|
17
17
|
- [The imprint](#the-imprint)
|
|
18
|
-
- [
|
|
18
|
+
- [Metrics](#metrics)
|
|
19
19
|
- [Cadences](#cadences)
|
|
20
20
|
- [One spine, two annotations](#one-spine-two-annotations)
|
|
21
21
|
- [`finality` — how often this family closes](#finality--how-often-this-family-closes)
|
|
@@ -54,7 +54,7 @@ notation, signs of punctuation rather than measure:
|
|
|
54
54
|
| `::` | divisio finalis (double bar) |
|
|
55
55
|
|
|
56
56
|
This hierarchy is read three ways in the engine, each weighting the bars for its
|
|
57
|
-
own end: an analytic cadence weight (
|
|
57
|
+
own end: an analytic cadence weight (metrics), a phrasing strength (which zeroes
|
|
58
58
|
the virgula), and a rest duration (the divisio's pause length). Each weighting
|
|
59
59
|
is documented at its table in the code.
|
|
60
60
|
|
|
@@ -64,7 +64,7 @@ interface Score {
|
|
|
64
64
|
phrases: Phrase[];
|
|
65
65
|
errors: ParseError[];
|
|
66
66
|
tabula: ChantTabulaRow[];
|
|
67
|
-
|
|
67
|
+
metrics: Metrics;
|
|
68
68
|
cadences: Cadence[];
|
|
69
69
|
modulations: Modulation[];
|
|
70
70
|
imprint: Imprint;
|
|
@@ -665,16 +665,16 @@ interface ModalAffinity {
|
|
|
665
665
|
}
|
|
666
666
|
```
|
|
667
667
|
|
|
668
|
-
##
|
|
668
|
+
## Metrics
|
|
669
669
|
|
|
670
|
-
`score.
|
|
670
|
+
`score.metrics` measures the chant's shape — counts, range, melisma,
|
|
671
671
|
melodic motion, contour, tessitura, rhythm, cadence. It is chant-specific;
|
|
672
|
-
`Harmony` has no
|
|
672
|
+
`Harmony` has no metrics. For _Puer natus est_: ambitus 10 semitones, melisma
|
|
673
673
|
ratio 2.04 notes per syllable, tessitura ~5 semitones above the final, a near-
|
|
674
674
|
perfect melodic arch, mostly stepwise motion (leap rate ~5%).
|
|
675
675
|
|
|
676
676
|
```ts
|
|
677
|
-
interface
|
|
677
|
+
interface Metrics {
|
|
678
678
|
noteCount: number;
|
|
679
679
|
syllableCount: number;
|
|
680
680
|
phraseCount: number;
|
|
@@ -730,7 +730,7 @@ interface CadenceDistribution {
|
|
|
730
730
|
|
|
731
731
|
## Cadences
|
|
732
732
|
|
|
733
|
-
`score.cadences` names the melodic close of each phrase — where
|
|
733
|
+
`score.cadences` names the melodic close of each phrase — where metrics
|
|
734
734
|
only counts the divisio bars, this identifies the figure. One `Cadence` per
|
|
735
735
|
phrase-ending divisio: its resolution `target`, the melodic `approach`, and the
|
|
736
736
|
`divisio` that tells medial from final (the double bar `::` is the final
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tonus",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Medieval music analysis and performance: GABC plainchant exports, liturgical calendar, tuning systems, ephemeris, and the harmony of the spheres",
|
|
6
6
|
"author": "Jeffrey Pierce <jeffrey@jeffreypierce.net>",
|