tonus 0.1.8 → 0.6.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.
Files changed (166) hide show
  1. package/BIBLIOGRAPHY.md +138 -108
  2. package/CHANGELOG.md +664 -1
  3. package/LICENSE +133 -29
  4. package/README.md +107 -80
  5. package/dist/data/am.js +2666 -11196
  6. package/dist/data/ams.d.ts +5 -0
  7. package/dist/data/ams.js +122 -0
  8. package/dist/data/attestation.d.ts +19 -0
  9. package/dist/data/attestation.js +15716 -0
  10. package/dist/data/attestation.json +15711 -0
  11. package/dist/data/cadentiae.d.ts +43 -0
  12. package/dist/data/cadentiae.js +174 -0
  13. package/dist/data/cal.js +48 -0
  14. package/dist/data/census.d.ts +12 -0
  15. package/dist/data/census.js +36 -0
  16. package/dist/data/commune-office.d.ts +4 -0
  17. package/dist/data/commune-office.js +2371 -0
  18. package/dist/data/commune-office.json +2365 -0
  19. package/dist/data/commune.js +181 -11
  20. package/dist/data/corpus-overlap.d.ts +17 -0
  21. package/dist/data/corpus-overlap.js +299 -5
  22. package/dist/data/cot.d.ts +5 -0
  23. package/dist/data/cot.js +172 -0
  24. package/dist/data/cse.d.ts +5 -0
  25. package/dist/data/cse.js +122 -0
  26. package/dist/data/gabc-glyphs.d.ts +45 -0
  27. package/dist/data/gabc-glyphs.js +122 -0
  28. package/dist/data/gr.js +754 -6394
  29. package/dist/data/kyriale.js +116 -116
  30. package/dist/data/la.js +799 -13419
  31. package/dist/data/lh.js +113 -3473
  32. package/dist/data/lu.js +931 -17631
  33. package/dist/data/nocturnale-romanum.js +1659 -10411
  34. package/dist/data/office-ferial.d.ts +4 -0
  35. package/dist/data/office-ferial.js +396 -0
  36. package/dist/data/office-ferial.json +391 -0
  37. package/dist/data/office-monastic.d.ts +17 -1
  38. package/dist/data/office-monastic.js +1403 -466
  39. package/dist/data/office-psalms-monastic.d.ts +13 -1
  40. package/dist/data/office-psalms-monastic.js +9 -0
  41. package/dist/data/propers.js +1 -1
  42. package/dist/data/psalms.js +22919 -5
  43. package/dist/data/psm.d.ts +5 -0
  44. package/dist/data/psm.js +122 -0
  45. package/dist/data/seasonal-respbreve.d.ts +5 -0
  46. package/dist/data/seasonal-respbreve.js +41 -0
  47. package/dist/data/seasonal-respbreve.json +35 -0
  48. package/dist/data/smufl-glyphs.d.ts +17 -0
  49. package/dist/data/smufl-glyphs.js +1546 -0
  50. package/dist/data/smufl-glyphs.json +1530 -0
  51. package/dist/engines/cal/calendar.d.ts +3 -2
  52. package/dist/engines/cal/calendar.js +105 -29
  53. package/dist/engines/cal/data/eras.d.ts +35 -0
  54. package/dist/engines/cal/data/eras.js +128 -0
  55. package/dist/engines/cal/date.js +44 -0
  56. package/dist/engines/cal/types.d.ts +15 -3
  57. package/dist/engines/cal/types.js +5 -5
  58. package/dist/engines/census/census.d.ts +7 -0
  59. package/dist/engines/census/census.js +179 -0
  60. package/dist/engines/census/types.d.ts +55 -0
  61. package/dist/engines/census/types.js +8 -0
  62. package/dist/engines/chant/attest.d.ts +39 -0
  63. package/dist/engines/chant/attest.js +90 -0
  64. package/dist/engines/chant/chant.d.ts +16 -4
  65. package/dist/engines/chant/chant.js +220 -30
  66. package/dist/engines/chant/data/compline.js +2 -1
  67. package/dist/engines/chant/data/masses.d.ts +56 -4
  68. package/dist/engines/chant/data/masses.js +305 -80
  69. package/dist/engines/chant/data/prime.js +1 -1
  70. package/dist/engines/chant/hour.js +279 -58
  71. package/dist/engines/chant/ordinary.d.ts +2 -0
  72. package/dist/engines/chant/ordinary.js +336 -56
  73. package/dist/engines/chant/propers.js +55 -5
  74. package/dist/engines/chant/psalm.d.ts +4 -4
  75. package/dist/engines/chant/psalm.js +25 -11
  76. package/dist/engines/chant/syllabify.d.ts +1 -0
  77. package/dist/engines/chant/syllabify.js +90 -17
  78. package/dist/engines/chant/types.d.ts +115 -12
  79. package/dist/engines/chant/types.js +38 -3
  80. package/dist/engines/harmonia/api.js +4 -0
  81. package/dist/engines/harmonia/data/doctrines.js +3 -1
  82. package/dist/engines/harmonia/data/zodiac.d.ts +47 -0
  83. package/dist/engines/harmonia/data/zodiac.js +163 -0
  84. package/dist/engines/harmonia/tabula.d.ts +3 -0
  85. package/dist/engines/harmonia/tabula.js +1 -0
  86. package/dist/engines/harmonia/voice.d.ts +4 -0
  87. package/dist/engines/harmonia/voice.js +8 -4
  88. package/dist/engines/imprint.js +14 -1
  89. package/dist/engines/planet/orbital.js +4 -4
  90. package/dist/engines/planet/planet.d.ts +10 -0
  91. package/dist/engines/planet/planet.js +30 -3
  92. package/dist/engines/planet/position.js +13 -10
  93. package/dist/engines/planet/types.d.ts +1 -0
  94. package/dist/engines/score/api.d.ts +2 -13
  95. package/dist/engines/score/api.js +21 -8
  96. package/dist/engines/score/articulation.js +2 -2
  97. package/dist/engines/score/cadence.d.ts +76 -0
  98. package/dist/engines/score/cadence.js +96 -0
  99. package/dist/engines/score/emitters/accidentals.d.ts +21 -0
  100. package/dist/engines/score/emitters/accidentals.js +88 -0
  101. package/dist/engines/score/emitters/atramentum.d.ts +107 -0
  102. package/dist/engines/score/emitters/atramentum.js +239 -0
  103. package/dist/engines/score/emitters/breaking.d.ts +62 -0
  104. package/dist/engines/score/emitters/breaking.js +80 -0
  105. package/dist/engines/score/emitters/moderna.d.ts +38 -0
  106. package/dist/engines/score/emitters/moderna.js +612 -0
  107. package/dist/engines/score/emitters/svg.d.ts +143 -0
  108. package/dist/engines/score/emitters/svg.js +1335 -0
  109. package/dist/engines/score/emitters/tracks.d.ts +104 -0
  110. package/dist/engines/score/emitters/tracks.js +728 -0
  111. package/dist/engines/score/infer.d.ts +3 -3
  112. package/dist/engines/score/infer.js +2 -2
  113. package/dist/engines/score/inscriptio.d.ts +69 -0
  114. package/dist/engines/score/inscriptio.js +138 -0
  115. package/dist/engines/score/ir.d.ts +2 -2
  116. package/dist/engines/score/ir.js +59 -12
  117. package/dist/engines/score/lyric.d.ts +23 -0
  118. package/dist/engines/score/lyric.js +234 -0
  119. package/dist/engines/score/meta.d.ts +2 -2
  120. package/dist/engines/score/modulation.d.ts +12 -0
  121. package/dist/engines/score/modulation.js +49 -0
  122. package/dist/engines/score/neume.js +35 -4
  123. package/dist/engines/score/parse.js +150 -9
  124. package/dist/engines/score/phrasing.js +4 -3
  125. package/dist/engines/score/prosody.d.ts +38 -0
  126. package/dist/engines/score/prosody.js +70 -6
  127. package/dist/engines/score/tabula.d.ts +37 -5
  128. package/dist/engines/score/tabula.js +18 -0
  129. package/dist/engines/score/types.d.ts +88 -1
  130. package/dist/engines/temper/api.d.ts +4 -1
  131. package/dist/engines/temper/api.js +28 -5
  132. package/dist/engines/temper/data/guido.js +6 -2
  133. package/dist/engines/temper/data/modes.d.ts +6 -0
  134. package/dist/engines/temper/data/modes.js +42 -0
  135. package/dist/engines/temper/data/tones.d.ts +1 -1
  136. package/dist/engines/temper/data/tones.js +20 -11
  137. package/dist/engines/temper/interval.js +4 -3
  138. package/dist/engines/temper/modality.d.ts +11 -2
  139. package/dist/engines/temper/modality.js +74 -2
  140. package/dist/engines/temper/modes.d.ts +1 -1
  141. package/dist/engines/temper/pitch.d.ts +1 -1
  142. package/dist/engines/temper/pitch.js +12 -2
  143. package/dist/engines/temper/scale.d.ts +53 -0
  144. package/dist/engines/temper/scale.js +107 -8
  145. package/dist/index.d.ts +26 -8
  146. package/dist/index.js +40 -4
  147. package/docs/api/calendar.md +279 -0
  148. package/docs/api/census.md +288 -0
  149. package/docs/api/chant.md +657 -0
  150. package/docs/api/heavens.md +396 -0
  151. package/docs/api/index.md +265 -0
  152. package/docs/api/score.md +906 -0
  153. package/docs/api/tuning.md +619 -0
  154. package/package.json +13 -5
  155. package/dist/data/office-matins-roman.d.ts +0 -19
  156. package/dist/data/office-matins-roman.js +0 -4383
  157. package/dist/data/office-psalms-roman.d.ts +0 -15
  158. package/dist/data/office-psalms-roman.js +0 -28
  159. package/dist/data/office-roman.d.ts +0 -19
  160. package/dist/data/office-roman.js +0 -13792
  161. package/dist/engines/chant/matutinum.d.ts +0 -33
  162. package/dist/engines/chant/matutinum.js +0 -81
  163. package/dist/engines/score/emitters/midi.d.ts +0 -65
  164. package/dist/engines/score/emitters/midi.js +0 -162
  165. package/dist/engines/score/emitters/musicxml.d.ts +0 -18
  166. package/dist/engines/score/emitters/musicxml.js +0 -166
@@ -0,0 +1,104 @@
1
+ import type { ChantTabulaRow } from "../tabula.js";
2
+ import type { Cadence } from "../cadence.js";
3
+ import type { Modulation } from "../modulation.js";
4
+ export type TrackName = "prosodia" | "chironomia" | "tonarium";
5
+ /** Analysis fields inscriptio hands the emitters when tracks are requested —
6
+ * the score-level data the flat tabula does not carry. */
7
+ export interface TrackData {
8
+ /**
9
+ * Normally `score.cadences`, whose `finality` the score builder has already
10
+ * joined from the catalogue. Cadences taken straight from `detectCadences`
11
+ * carry `finality: null` everywhere, and the terminal node quietly falls
12
+ * back to the modal target — a close on the finalis reads as closing, and
13
+ * everything else as suspending. Correct behaviour, but coarser than the
14
+ * measured answer, so pass the built score's cadences unless you mean it.
15
+ */
16
+ cadences: Cadence[];
17
+ modulations: Modulation[];
18
+ /** Mode digit parsed from the chant's label; absent = no mode line. */
19
+ mode?: number;
20
+ }
21
+ /** One placed note as the emitters record it — the tracks' working unit.
22
+ * The same anchors the geometry contract exports, with the row attached. */
23
+ export interface TrackNote {
24
+ row: ChantTabulaRow;
25
+ /** The note's anchor — where the emitter placed it. */
26
+ x: number;
27
+ y: number;
28
+ system: number;
29
+ systemY: number;
30
+ /** The figure's measured ink edges. A track that SPANS notes — the cadence
31
+ * bracket, an arc over a neume — must reach the ink, not the anchors: a
32
+ * span drawn anchor-to-anchor is narrower than the notes it names and sits
33
+ * left of their centre, because an anchor is where a glyph starts rather
34
+ * than where it sits. The emitters have measured these all along and the
35
+ * mapping into TrackNote used to drop them. */
36
+ inkLeft: number;
37
+ inkRight: number;
38
+ }
39
+ /** One track's room within the band a system reserves below its lyric line. */
40
+ export interface TrackBand {
41
+ /** This band's top, offset from the start of the track region. */
42
+ top: number;
43
+ /** The room this band takes. */
44
+ height: number;
45
+ }
46
+ /** THE STACK. Every track rides either species and all may ride one score
47
+ * together, so the band room is the sum of what each asks for. The order is
48
+ * fixed here, not by the caller's array: the prosodia rides FIRST, directly
49
+ * under the lyric line — it reads the text itself, so it stays closest to
50
+ * it; the chironomia next, its wave an extension of the lyric line's
51
+ * rhythm; the tonarium below, a panel whose label row is its bottom edge
52
+ * and wants nothing under it. Requesting ["tonarium", "chironomia"]
53
+ * therefore draws exactly what ["chironomia", "tonarium"] draws. */
54
+ export declare function trackBands(tracks: readonly TrackName[] | undefined, k: number): {
55
+ prosodia: TrackBand | null;
56
+ chironomia: TrackBand | null;
57
+ tonarium: TrackBand | null;
58
+ extra: number;
59
+ };
60
+ export interface ProsodiaConfig {
61
+ /** Scale factor: staffInterval / (40/6) — 1 at the default staffHeight. */
62
+ k: number;
63
+ /** Band top within a system (system-local): the lyric baseline plus the
64
+ * band's offset in the stack. */
65
+ laneTop: number;
66
+ /** Right edge available to the band, per system (page x). */
67
+ rightFor: (system: number) => number;
68
+ /** The liturgical red for the accent dots (the 2026-08-11 amendment). */
69
+ rubricaColor: string;
70
+ }
71
+ /** Band room the prosodia reserves below each system's lyric line. The 8
72
+ * beyond the band's own ink is AIR: without it the chironomia's crest
73
+ * letters sat visibly tighter to this band than the tonarium sits to the
74
+ * wave's troughs, and the stack read as unevenly spaced. */
75
+ export declare function prosodiaExtra(k: number): number;
76
+ /** The prosodia track, every system. */
77
+ export declare function buildProsodia(notes: TrackNote[], cfg: ProsodiaConfig): string;
78
+ export interface ChironomiaConfig {
79
+ /** Scale factor: staffInterval / (40/6) — 1 at the default staffHeight. */
80
+ k: number;
81
+ /** y of the wave's midline within a system (system-local). */
82
+ waveMidY: number;
83
+ }
84
+ /** Band room the chironomia reserves below each system's lyric line. */
85
+ export declare function chironomiaExtra(k: number): number;
86
+ /** The chironomy track: wave + letters, every system. */
87
+ export declare function buildChironomia(notes: TrackNote[], cfg: ChironomiaConfig): string;
88
+ export interface TonariumConfig {
89
+ /** Scale factor: staffInterval / (40/6) — 1 at the default staffHeight. */
90
+ k: number;
91
+ /** Lane top within a system (system-local). */
92
+ laneTop: number;
93
+ /** Right edge available to the lane, per system (page x). */
94
+ rightFor: (system: number) => number;
95
+ /** Serif family for the mode numerals (the lyric/annotation face). */
96
+ serifFamily: string;
97
+ /** The liturgical red for the mode line. */
98
+ rubricaColor: string;
99
+ }
100
+ /** Band room the tonarium reserves below each system's lyric line. */
101
+ export declare function tonariumExtra(k: number): number;
102
+ /** The tonarium track, every system. */
103
+ export declare function buildTonarium(notes: TrackNote[], data: TrackData, cfg: TonariumConfig): string;
104
+ //# sourceMappingURL=tracks.d.ts.map