tonus 0.1.8 → 0.5.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/BIBLIOGRAPHY.md +132 -108
- package/CHANGELOG.md +598 -1
- package/LICENSE +133 -29
- package/README.md +106 -83
- package/dist/data/am.js +2666 -11196
- package/dist/data/ams.d.ts +5 -0
- package/dist/data/ams.js +122 -0
- package/dist/data/attestation.d.ts +19 -0
- package/dist/data/attestation.js +15716 -0
- package/dist/data/attestation.json +15711 -0
- package/dist/data/cadentiae.d.ts +43 -0
- package/dist/data/cadentiae.js +174 -0
- package/dist/data/cal.js +48 -0
- package/dist/data/census.d.ts +12 -0
- package/dist/data/census.js +36 -0
- package/dist/data/commune-office.d.ts +4 -0
- package/dist/data/commune-office.js +2371 -0
- package/dist/data/commune-office.json +2365 -0
- package/dist/data/commune.js +181 -11
- package/dist/data/corpus-overlap.d.ts +17 -0
- package/dist/data/corpus-overlap.js +299 -5
- package/dist/data/cot.d.ts +5 -0
- package/dist/data/cot.js +172 -0
- package/dist/data/cse.d.ts +5 -0
- package/dist/data/cse.js +122 -0
- package/dist/data/gabc-glyphs.d.ts +45 -0
- package/dist/data/gabc-glyphs.js +122 -0
- package/dist/data/gr.js +754 -6394
- package/dist/data/kyriale.js +116 -116
- package/dist/data/la.js +799 -13419
- package/dist/data/lh.js +113 -3473
- package/dist/data/lu.js +931 -17631
- package/dist/data/nocturnale-romanum.js +1659 -10411
- package/dist/data/office-ferial.d.ts +4 -0
- package/dist/data/office-ferial.js +396 -0
- package/dist/data/office-ferial.json +391 -0
- package/dist/data/office-monastic.d.ts +17 -1
- package/dist/data/office-monastic.js +1403 -466
- package/dist/data/office-psalms-monastic.d.ts +13 -1
- package/dist/data/office-psalms-monastic.js +9 -0
- package/dist/data/propers.js +1 -1
- package/dist/data/psalms.js +22919 -5
- package/dist/data/psm.d.ts +5 -0
- package/dist/data/psm.js +122 -0
- package/dist/data/seasonal-respbreve.d.ts +5 -0
- package/dist/data/seasonal-respbreve.js +41 -0
- package/dist/data/seasonal-respbreve.json +35 -0
- package/dist/data/smufl-glyphs.d.ts +17 -0
- package/dist/data/smufl-glyphs.js +1546 -0
- package/dist/data/smufl-glyphs.json +1530 -0
- package/dist/engines/cal/calendar.d.ts +3 -2
- package/dist/engines/cal/calendar.js +105 -29
- package/dist/engines/cal/data/eras.d.ts +35 -0
- package/dist/engines/cal/data/eras.js +128 -0
- package/dist/engines/cal/date.js +44 -0
- package/dist/engines/cal/types.d.ts +15 -3
- package/dist/engines/cal/types.js +5 -5
- package/dist/engines/census/census.d.ts +7 -0
- package/dist/engines/census/census.js +179 -0
- package/dist/engines/census/types.d.ts +55 -0
- package/dist/engines/census/types.js +8 -0
- package/dist/engines/chant/attest.d.ts +39 -0
- package/dist/engines/chant/attest.js +90 -0
- package/dist/engines/chant/chant.d.ts +16 -4
- package/dist/engines/chant/chant.js +220 -30
- package/dist/engines/chant/data/compline.js +2 -1
- package/dist/engines/chant/data/masses.d.ts +56 -4
- package/dist/engines/chant/data/masses.js +305 -80
- package/dist/engines/chant/data/prime.js +1 -1
- package/dist/engines/chant/hour.js +279 -58
- package/dist/engines/chant/ordinary.d.ts +2 -0
- package/dist/engines/chant/ordinary.js +336 -56
- package/dist/engines/chant/propers.js +55 -5
- package/dist/engines/chant/psalm.d.ts +4 -4
- package/dist/engines/chant/psalm.js +25 -11
- package/dist/engines/chant/syllabify.d.ts +1 -0
- package/dist/engines/chant/syllabify.js +90 -17
- package/dist/engines/chant/types.d.ts +115 -12
- package/dist/engines/chant/types.js +38 -3
- package/dist/engines/harmonia/api.js +4 -0
- package/dist/engines/harmonia/data/doctrines.js +3 -1
- package/dist/engines/harmonia/tabula.d.ts +3 -0
- package/dist/engines/harmonia/tabula.js +1 -0
- package/dist/engines/harmonia/voice.d.ts +4 -0
- package/dist/engines/harmonia/voice.js +8 -4
- package/dist/engines/imprint.js +14 -1
- package/dist/engines/planet/orbital.js +4 -4
- package/dist/engines/planet/planet.d.ts +10 -0
- package/dist/engines/planet/planet.js +30 -3
- package/dist/engines/planet/position.js +13 -10
- package/dist/engines/planet/types.d.ts +1 -0
- package/dist/engines/score/api.d.ts +2 -13
- package/dist/engines/score/api.js +21 -8
- package/dist/engines/score/articulation.js +2 -2
- package/dist/engines/score/cadence.d.ts +76 -0
- package/dist/engines/score/cadence.js +96 -0
- package/dist/engines/score/emitters/accidentals.d.ts +21 -0
- package/dist/engines/score/emitters/accidentals.js +88 -0
- package/dist/engines/score/emitters/atramentum.d.ts +107 -0
- package/dist/engines/score/emitters/atramentum.js +239 -0
- package/dist/engines/score/emitters/breaking.d.ts +62 -0
- package/dist/engines/score/emitters/breaking.js +80 -0
- package/dist/engines/score/emitters/moderna.d.ts +38 -0
- package/dist/engines/score/emitters/moderna.js +612 -0
- package/dist/engines/score/emitters/svg.d.ts +143 -0
- package/dist/engines/score/emitters/svg.js +1328 -0
- package/dist/engines/score/emitters/tracks.d.ts +104 -0
- package/dist/engines/score/emitters/tracks.js +728 -0
- package/dist/engines/score/infer.d.ts +3 -3
- package/dist/engines/score/infer.js +2 -2
- package/dist/engines/score/inscriptio.d.ts +69 -0
- package/dist/engines/score/inscriptio.js +138 -0
- package/dist/engines/score/ir.d.ts +2 -2
- package/dist/engines/score/ir.js +59 -12
- package/dist/engines/score/lyric.d.ts +23 -0
- package/dist/engines/score/lyric.js +234 -0
- package/dist/engines/score/meta.d.ts +2 -2
- package/dist/engines/score/modulation.d.ts +12 -0
- package/dist/engines/score/modulation.js +49 -0
- package/dist/engines/score/neume.js +35 -4
- package/dist/engines/score/parse.js +150 -9
- package/dist/engines/score/phrasing.js +4 -3
- package/dist/engines/score/prosody.d.ts +38 -0
- package/dist/engines/score/prosody.js +70 -6
- package/dist/engines/score/tabula.d.ts +37 -5
- package/dist/engines/score/tabula.js +18 -0
- package/dist/engines/score/types.d.ts +88 -1
- package/dist/engines/temper/api.d.ts +4 -1
- package/dist/engines/temper/api.js +28 -5
- package/dist/engines/temper/data/guido.js +6 -2
- package/dist/engines/temper/data/modes.d.ts +6 -0
- package/dist/engines/temper/data/modes.js +42 -0
- package/dist/engines/temper/data/tones.d.ts +1 -1
- package/dist/engines/temper/data/tones.js +20 -11
- package/dist/engines/temper/interval.js +4 -3
- package/dist/engines/temper/modality.d.ts +11 -2
- package/dist/engines/temper/modality.js +74 -2
- package/dist/engines/temper/modes.d.ts +1 -1
- package/dist/engines/temper/pitch.d.ts +1 -1
- package/dist/engines/temper/pitch.js +12 -2
- package/dist/engines/temper/scale.d.ts +53 -0
- package/dist/engines/temper/scale.js +107 -8
- package/dist/index.d.ts +26 -8
- package/dist/index.js +37 -4
- package/docs/api/calendar.md +279 -0
- package/docs/api/census.md +288 -0
- package/docs/api/chant.md +657 -0
- package/docs/api/heavens.md +346 -0
- package/docs/api/index.md +263 -0
- package/docs/api/score.md +873 -0
- package/docs/api/tuning.md +619 -0
- package/package.json +11 -5
- package/dist/data/office-matins-roman.d.ts +0 -19
- package/dist/data/office-matins-roman.js +0 -4383
- package/dist/data/office-psalms-roman.d.ts +0 -15
- package/dist/data/office-psalms-roman.js +0 -28
- package/dist/data/office-roman.d.ts +0 -19
- package/dist/data/office-roman.js +0 -13792
- package/dist/engines/chant/matutinum.d.ts +0 -33
- package/dist/engines/chant/matutinum.js +0 -81
- package/dist/engines/score/emitters/midi.d.ts +0 -65
- package/dist/engines/score/emitters/midi.js +0 -162
- package/dist/engines/score/emitters/musicxml.d.ts +0 -18
- package/dist/engines/score/emitters/musicxml.js +0 -166
package/LICENSE
CHANGED
|
@@ -1,29 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
to
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
and
|
|
28
|
-
(
|
|
29
|
-
|
|
1
|
+
# PolyForm Noncommercial License 1.0.0
|
|
2
|
+
|
|
3
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
In order to get any license under these terms, you must agree
|
|
8
|
+
to them as both strict obligations and conditions to all
|
|
9
|
+
your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the
|
|
14
|
+
software to do everything you might do with the software
|
|
15
|
+
that would otherwise infringe the licensor's copyright
|
|
16
|
+
in it for any permitted purpose. However, you may
|
|
17
|
+
only distribute the software according to [Distribution
|
|
18
|
+
License](#distribution-license) and make changes or new works
|
|
19
|
+
based on the software according to [Changes and New Works
|
|
20
|
+
License](#changes-and-new-works-license).
|
|
21
|
+
|
|
22
|
+
## Distribution License
|
|
23
|
+
|
|
24
|
+
The licensor grants you an additional copyright license
|
|
25
|
+
to distribute copies of the software. Your license
|
|
26
|
+
to distribute covers distributing the software with
|
|
27
|
+
changes and new works permitted by [Changes and New Works
|
|
28
|
+
License](#changes-and-new-works-license).
|
|
29
|
+
|
|
30
|
+
## Notices
|
|
31
|
+
|
|
32
|
+
You must ensure that anyone who gets a copy of any part of
|
|
33
|
+
the software from you also gets a copy of these terms or the
|
|
34
|
+
URL for them above, as well as copies of any plain-text lines
|
|
35
|
+
beginning with `Required Notice:` that the licensor provided
|
|
36
|
+
with the software. For example:
|
|
37
|
+
|
|
38
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
39
|
+
|
|
40
|
+
## Changes and New Works License
|
|
41
|
+
|
|
42
|
+
The licensor grants you an additional copyright license to
|
|
43
|
+
make changes and new works based on the software for any
|
|
44
|
+
permitted purpose.
|
|
45
|
+
|
|
46
|
+
## Patent License
|
|
47
|
+
|
|
48
|
+
The licensor grants you a patent license for the software that
|
|
49
|
+
covers patent claims the licensor can license, or becomes able
|
|
50
|
+
to license, that you would infringe by using the software.
|
|
51
|
+
|
|
52
|
+
## Noncommercial Purposes
|
|
53
|
+
|
|
54
|
+
Any noncommercial purpose is a permitted purpose.
|
|
55
|
+
|
|
56
|
+
## Personal Uses
|
|
57
|
+
|
|
58
|
+
Personal use for research, experiment, and testing for
|
|
59
|
+
the benefit of public knowledge, personal study, private
|
|
60
|
+
entertainment, hobby projects, amateur pursuits, or religious
|
|
61
|
+
observance, without any anticipated commercial application,
|
|
62
|
+
is use for a permitted purpose.
|
|
63
|
+
|
|
64
|
+
## Noncommercial Organizations
|
|
65
|
+
|
|
66
|
+
Use by any charitable organization, educational institution,
|
|
67
|
+
public research organization, public safety or health
|
|
68
|
+
organization, environmental protection organization,
|
|
69
|
+
or government institution is use for a permitted purpose
|
|
70
|
+
regardless of the source of funding or obligations resulting
|
|
71
|
+
from the funding.
|
|
72
|
+
|
|
73
|
+
## Fair Use
|
|
74
|
+
|
|
75
|
+
You may have "fair use" rights for the software under the
|
|
76
|
+
law. These terms do not limit them.
|
|
77
|
+
|
|
78
|
+
## No Other Rights
|
|
79
|
+
|
|
80
|
+
These terms do not allow you to sublicense or transfer any of
|
|
81
|
+
your licenses to anyone else, or prevent the licensor from
|
|
82
|
+
granting licenses to anyone else. These terms do not imply
|
|
83
|
+
any other licenses.
|
|
84
|
+
|
|
85
|
+
## Patent Defense
|
|
86
|
+
|
|
87
|
+
If you make any written claim that the software infringes or
|
|
88
|
+
contributes to infringement of any patent, your patent license
|
|
89
|
+
for the software granted under these terms ends immediately. If
|
|
90
|
+
your company makes such a claim, your patent license ends
|
|
91
|
+
immediately for work on behalf of your company.
|
|
92
|
+
|
|
93
|
+
## Violations
|
|
94
|
+
|
|
95
|
+
The first time you are notified in writing that you have
|
|
96
|
+
violated any of these terms, or done anything with the software
|
|
97
|
+
not covered by your licenses, your licenses can nonetheless
|
|
98
|
+
continue if you come into full compliance with these terms,
|
|
99
|
+
and take practical steps to correct past violations, within
|
|
100
|
+
32 days of receiving notice. Otherwise, all your licenses
|
|
101
|
+
end immediately.
|
|
102
|
+
|
|
103
|
+
## No Liability
|
|
104
|
+
|
|
105
|
+
***As far as the law allows, the software comes as is, without
|
|
106
|
+
any warranty or condition, and the licensor will not be liable
|
|
107
|
+
to you for any damages arising out of these terms or the use
|
|
108
|
+
or nature of the software, under any kind of legal claim.***
|
|
109
|
+
|
|
110
|
+
## Definitions
|
|
111
|
+
|
|
112
|
+
The **licensor** is the individual or entity offering these
|
|
113
|
+
terms, and the **software** is the software the licensor makes
|
|
114
|
+
available under these terms.
|
|
115
|
+
|
|
116
|
+
**You** refers to the individual or entity agreeing to these
|
|
117
|
+
terms.
|
|
118
|
+
|
|
119
|
+
**Your company** is any legal entity, sole proprietorship,
|
|
120
|
+
or other kind of organization that you work for, plus all
|
|
121
|
+
organizations that have control over, are under the control of,
|
|
122
|
+
or are under common control with that organization. **Control**
|
|
123
|
+
means ownership of substantially all the assets of an entity,
|
|
124
|
+
or the power to direct its management and policies by vote,
|
|
125
|
+
contract, or otherwise. Control can be direct or indirect.
|
|
126
|
+
|
|
127
|
+
**Your licenses** are all the licenses granted to you for the
|
|
128
|
+
software under these terms.
|
|
129
|
+
|
|
130
|
+
**Use** means anything you do with the software requiring one
|
|
131
|
+
of your licenses.
|
|
132
|
+
|
|
133
|
+
Required Notice: Copyright (c) 2026 Jeffrey Pierce (jeffreypierce.net)
|
package/README.md
CHANGED
|
@@ -1,111 +1,134 @@
|
|
|
1
1
|
# tonus
|
|
2
2
|
|
|
3
|
-
**tonus** is a medieval music and
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
**tonus** is a JavaScript library for medieval music theory and chant
|
|
4
|
+
analysis. It carries the Gregorian repertoire and the theory it was built on:
|
|
5
|
+
it resolves what any day calls for, tunes chant in the ratios it was sung in,
|
|
6
|
+
parses and draws the notation, voices the planets as pitch, and measures each
|
|
7
|
+
chant in comparison.
|
|
8
|
+
|
|
9
|
+
Everything is computed locally and deterministically: the same question always
|
|
10
|
+
returns the same answer, from data that ships inside the package, with no network
|
|
11
|
+
calls and no runtime dependencies.
|
|
12
|
+
|
|
13
|
+
## What it covers
|
|
14
|
+
|
|
15
|
+
- **Pitch and tuning.** The medieval pitch world: Pythagorean and meantone
|
|
16
|
+
temperaments, just intonation and custom scales, the Guidonian gamut and hand,
|
|
17
|
+
hexachords and their mutations, and interval analysis by name.
|
|
18
|
+
- **The eight modes.** Each church mode with its final, dominant, ambitus, and
|
|
19
|
+
ethos, and the psalm tones that go with them.
|
|
20
|
+
- **The liturgical calendar.** The Tridentine calendar of any year, resolved
|
|
21
|
+
against Easter (by the Julian or the Gregorian computus), with each feast's
|
|
22
|
+
rank, grade, and season.
|
|
23
|
+
- **The chant repertoire.** About 2,200 chants across ten books (nine Solesmes
|
|
24
|
+
editions and the Nocturnale Romanum night office), in
|
|
25
|
+
[GABC](https://gregorio-project.github.io/) notation: Mass propers, the Kyriale,
|
|
26
|
+
the Office hours, the psalter, and the Matins nocturns, retrievable by feast,
|
|
27
|
+
season, mode, or office.
|
|
28
|
+
- **Rhythm and notation.** GABC parsed into phrases, syllables, and tuned notes,
|
|
29
|
+
shaped by the Solesmes arsis/thesis rhythm, with an analytic fingerprint of a
|
|
30
|
+
chant's melodic character, and drawn to a square-note or modern staff.
|
|
31
|
+
- **The harmony of the spheres.** An ephemeris of the classical planets, voiced
|
|
32
|
+
as tuned pitch after Boethius, Nicomachus, Pliny, and Ptolemy.
|
|
33
|
+
- **The census.** Every shipped chant measured against the corpus that holds
|
|
34
|
+
it: how typical it is, where it is unusual, and its nearest neighbours by
|
|
35
|
+
melodic shape.
|
|
36
|
+
|
|
37
|
+
## The ideas behind it
|
|
38
|
+
|
|
39
|
+
Boethius's _De institutione musica_ carried Greek theory into the Latin
|
|
40
|
+
Middle Ages, and it treats music as a branch of number, beside arithmetic,
|
|
41
|
+
geometry, and astronomy. Its music runs from the audible to the inaudible:
|
|
42
|
+
voices and instruments (_musica instrumentalis_), body and soul (_musica
|
|
43
|
+
humana_), the turning cosmos (_musica mundana_). Chant was composed and
|
|
44
|
+
copied inside that frame: pitch was ratio, the modes a received order, the
|
|
45
|
+
heavens harmonic proportion.
|
|
46
|
+
|
|
47
|
+
tonus takes those claims literally enough to compute them. It tunes pitch in
|
|
48
|
+
the Pythagorean ratios of the treatises. It reads the calendar as the
|
|
49
|
+
retrieval index it was for a millennium. It follows the Solesmes rhythm of
|
|
50
|
+
arsis and thesis. And it computes _musica mundana_ as sounding pitch. Where
|
|
51
|
+
the sources run out or contradict one another, tonus makes an editorial call
|
|
52
|
+
and records it in the code.
|
|
53
|
+
|
|
54
|
+
tonus is an instrument for study. It treats this repertoire as musical and
|
|
55
|
+
historical material to be measured, queried, and understood; what it models is
|
|
56
|
+
the sound and its structure.
|
|
57
|
+
|
|
58
|
+
## Sources
|
|
59
|
+
|
|
60
|
+
tonus is built on primary and scholarly sources, and it names them wherever it
|
|
61
|
+
makes a choice. The chant and calendar data are the Solesmes editions, by way of
|
|
62
|
+
[GregoBase](https://gregobase.selapa.net/),
|
|
63
|
+
[Divinum Officium](https://divinumofficium.com/), and the community _Nocturnale
|
|
64
|
+
Romanum_. The rhythm follows Mocquereau, Gajard, Suñol, and Daniel Saulnier; the
|
|
65
|
+
modes and cadences follow Rockstro's _Grove_ article, Niedermeyer & d'Ortigue,
|
|
66
|
+
and Apel; the tuning follows Boethius's _De institutione musica_ and Ptolemy's
|
|
67
|
+
_Harmonics_; the notation is engraved in Daniel Spreadbury's
|
|
68
|
+
[Bravura](https://github.com/steinbergmedia/bravura), the reference font for the
|
|
69
|
+
SMuFL standard; the planetary doctrines follow Godwin's sourcebooks of the
|
|
70
|
+
Pythagorean tradition.
|
|
71
|
+
|
|
72
|
+
Every figure is cited in the code beside what it explains. The complete list is
|
|
73
|
+
[BIBLIOGRAPHY.md](BIBLIOGRAPHY.md).
|
|
74
|
+
|
|
75
|
+
## Example
|
|
16
76
|
|
|
17
77
|
```sh
|
|
18
78
|
npm install tonus
|
|
19
79
|
```
|
|
20
80
|
|
|
21
|
-
ESM only. Node ≥ 20; works in the browser through a bundler. No runtime
|
|
22
|
-
dependencies. Roughly 5,500 chants and the full 642-entry calendar ship in
|
|
23
|
-
the package — 6.5 MB unpacked, 1.5 MB packed.
|
|
24
|
-
|
|
25
|
-
## Documentation
|
|
26
|
-
|
|
27
|
-
One page per engine, in dependency order. Each page states its rules, then its theory and historical context, then its sources.
|
|
28
|
-
|
|
29
|
-
- **[Index](docs/index.md)** — Table of contents and conventions.
|
|
30
|
-
- **[Tuning](docs/tuning.md)** — `temperamentum`. The medieval pitch system:
|
|
31
|
-
temperaments, Guidonian gamut and hand,
|
|
32
|
-
hexachordal solmization and mutations, eight modes, and psalm
|
|
33
|
-
tones. Depends on nothing else in the library.
|
|
34
|
-
- **[Calendar](docs/calendar.md)** — `festum`, `pascha`. The Tridentine
|
|
35
|
-
liturgical calendar resolved against dual-computus Easter: feasts with
|
|
36
|
-
their authentic ranks, grades, and seasons, and the movable anchors of
|
|
37
|
-
any year.
|
|
38
|
-
- **[Chant](docs/chant.md)** — `cantus`, `proprium`, `ordinarium`,
|
|
39
|
-
`officium`, `psalmus`. The Solesmes books in GABC: Mass propers, the
|
|
40
|
-
Kyriale, the Office hours, the psalter.
|
|
41
|
-
- **[Score](docs/score.md)** — `notatio`. GABC into tuned notes: phrases,
|
|
42
|
-
syllables, Solesmes arsis/thesis rhythm, prosody, the analytic imprint.
|
|
43
|
-
- **[Heavens](docs/heavens.md)** — `caelum`, `harmonia`. An ephemeris
|
|
44
|
-
computed from JPL orbital elements, voiced through the planetary
|
|
45
|
-
doctrines of Boethius, Nicomachus, Pliny, and Ptolemy.
|
|
46
|
-
|
|
47
|
-
These pages are the middle of a three-level ladder: the API docs here link down
|
|
48
|
-
into the code, where the full theory, provenance, and editorial reasoning live in
|
|
49
|
-
comments beside what they explain. Read as deep as you care to. Sources for
|
|
50
|
-
concepts, scholarship, and data are listed in
|
|
51
|
-
[BIBLIOGRAPHY.md](BIBLIOGRAPHY.md); where sources disagree or run out, **tonus**
|
|
52
|
-
makes an editorial call, recorded in the code and glossed in the page's Theory &
|
|
53
|
-
Context section.
|
|
54
|
-
|
|
55
|
-
## The tuning engine
|
|
56
|
-
|
|
57
|
-
The tuning engine is self-contained; every other engine resolves its pitches
|
|
58
|
-
through it.
|
|
59
|
-
|
|
60
81
|
```js
|
|
61
82
|
import tonus from "tonus";
|
|
62
83
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
t.nota("D4");
|
|
66
|
-
//
|
|
84
|
+
// Build a tuning: Pythagorean, set to mode 1.
|
|
85
|
+
const t = tonus.temperamentum({ mode: 1 });
|
|
86
|
+
t.nota("D4"); // 293.33 Hz, the final of mode 1, through pure fifths
|
|
87
|
+
t.gradus("D4"); // "Delasolre": RE of the natural hexachord, the finalis
|
|
67
88
|
|
|
68
|
-
|
|
69
|
-
// Delasolre: RE of the natural hexachord, role "finalis",
|
|
70
|
-
// middle finger, base joint, on the Guidonian hand
|
|
71
|
-
|
|
72
|
-
t.intervallum("D4", "A4");
|
|
73
|
-
// Quinta (alias Diapente), perfect — final to tenor
|
|
74
|
-
|
|
75
|
-
t.tonus();
|
|
76
|
-
// psalm tone 1, differentia 1g:
|
|
77
|
-
// intonatio F3–A3–C4, mediatio C4–A3–G3–A3, terminatio C4–A3–G3–A3–G3
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## The liturgical stack
|
|
81
|
-
|
|
82
|
-
The remaining engines compose:
|
|
83
|
-
|
|
84
|
-
```js
|
|
89
|
+
// Ask the calendar for a day, then pull the chant that belongs to it.
|
|
85
90
|
const [feast] = tonus.festum({ date: new Date("2026-12-25") });
|
|
86
|
-
//
|
|
87
|
-
// grade: "duplex-i", tempus: "Tempus Nativitatis"
|
|
88
|
-
|
|
91
|
+
// → "In Nativitate Domini", a Duplex I classis feast of Christmastide
|
|
89
92
|
const [introit] = tonus.proprium({ feast, office: "in" });
|
|
90
|
-
// "Puer natus est", mode 7,
|
|
93
|
+
// → "Puer natus est", mode 7, from the Liber Usualis
|
|
91
94
|
|
|
95
|
+
// Turn the chant into tuned, rhythmicized notes.
|
|
92
96
|
const score = tonus.notatio(introit, { temperamentum: t });
|
|
93
|
-
// phrases, syllables, tuned pitches, arsis/thesis rhythm, prosody, imprint
|
|
94
97
|
|
|
98
|
+
// And voice the Christmas sky as pitch, after Boethius.
|
|
95
99
|
const harmony = tonus.harmonia(tonus.caelum({ date: feast.date }));
|
|
96
|
-
// each visible planet voiced as pitch and Greek vowel, after Boethius
|
|
97
100
|
```
|
|
98
101
|
|
|
99
|
-
|
|
102
|
+
The objects each call returns (`feast`, `t`) pass straight back into the next as
|
|
103
|
+
filters.
|
|
104
|
+
|
|
105
|
+
## Documentation
|
|
106
|
+
|
|
107
|
+
The **[documentation index](docs/api/index.md)** is the technical center: the full
|
|
108
|
+
API, the conventions, the error contract, and the code standards. From there,
|
|
109
|
+
one page per engine, in dependency order:
|
|
110
|
+
[tuning](docs/api/tuning.md), [calendar](docs/api/calendar.md), [chant](docs/api/chant.md),
|
|
111
|
+
[score](docs/api/score.md), [heavens](docs/api/heavens.md), and
|
|
112
|
+
[census](docs/api/census.md).
|
|
113
|
+
|
|
114
|
+
## Install and run
|
|
115
|
+
|
|
116
|
+
ESM only. Node ≥ 20; works in the browser through a bundler. No runtime
|
|
117
|
+
dependencies. About 2,200 chants and the 650-entry calendar ship in the
|
|
118
|
+
package.
|
|
100
119
|
|
|
101
120
|
```sh
|
|
102
121
|
npm test # builds and runs the suite (node --test)
|
|
103
122
|
```
|
|
104
123
|
|
|
105
|
-
The data files in `src/data/` are generated by a separate extraction
|
|
106
|
-
|
|
124
|
+
The data files in `src/data/` are generated by a separate extraction pipeline
|
|
125
|
+
(tonus-corpus). Edits happen there, not here.
|
|
107
126
|
|
|
108
127
|
## License
|
|
109
128
|
|
|
110
|
-
[
|
|
129
|
+
[PolyForm Noncommercial 1.0.0](LICENSE): free to use, study, modify, and
|
|
130
|
+
share for any noncommercial purpose — personal projects, research,
|
|
131
|
+
education, art, religious observance. Commercial use requires permission
|
|
132
|
+
from the author. Versions through 0.1.x were published under MIT and
|
|
133
|
+
remain so. Chant and liturgical data derive from GregoBase and Divinum
|
|
111
134
|
Officium; see [BIBLIOGRAPHY.md](BIBLIOGRAPHY.md) for full attribution.
|