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
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { ChantTabulaRow } from "../tabula.js";
|
|
2
|
+
import type { Chant } from "../../chant/types.js";
|
|
3
|
+
import type { LyricRun } from "../types.js";
|
|
4
|
+
import { type AccidentalMode, type CentsBaseline } from "./accidentals.js";
|
|
5
|
+
import { type TrackData, type TrackName } from "./tracks.js";
|
|
6
|
+
/** A font face to embed into the SVG itself: the CALLER's bytes, base64.
|
|
7
|
+
* tonus ships no font files — it is a conduit for data the consumer supplies,
|
|
8
|
+
* so the consumer also carries the face's license terms. */
|
|
9
|
+
export interface FontEmbed {
|
|
10
|
+
base64: string;
|
|
11
|
+
format?: "opentype" | "truetype" | "woff" | "woff2";
|
|
12
|
+
}
|
|
13
|
+
/** One text role's face: a family string, or a family with weight, a size
|
|
14
|
+
* factor (the "bit of tweaks" a display hand needs — e.g. a Gothic lyric face
|
|
15
|
+
* usually wants scale ~1.15 to match the serif's apparent size), and an
|
|
16
|
+
* optional `embed`. Without `embed`, the SVG carries a font-family REFERENCE
|
|
17
|
+
* and the host page supplies the face (@font-face); with it, the face rides
|
|
18
|
+
* inside the SVG's own <style> and the file is self-contained. */
|
|
19
|
+
export type FontSlot = string | {
|
|
20
|
+
family: string;
|
|
21
|
+
weight?: number;
|
|
22
|
+
scale?: number;
|
|
23
|
+
embed?: FontEmbed;
|
|
24
|
+
};
|
|
25
|
+
/** Per-role faces. Anything unset falls back to `fontFamily` (the house serif).
|
|
26
|
+
*
|
|
27
|
+
* The four roles are the four kinds of text a chant page sets, and they are
|
|
28
|
+
* deliberately separate: a book's dropcap is very often NOT its lyric face —
|
|
29
|
+
* a Lombardic or uncial initial against a text hand — which is exactly the
|
|
30
|
+
* pairing the printed books use. */
|
|
31
|
+
export interface FontSpec {
|
|
32
|
+
dropcap?: FontSlot;
|
|
33
|
+
title?: FontSlot;
|
|
34
|
+
annotation?: FontSlot;
|
|
35
|
+
lyric?: FontSlot;
|
|
36
|
+
}
|
|
37
|
+
/** The ink. Every value reaches the SVG as a CSS custom property with the
|
|
38
|
+
* theme's own value as the fallback — `var(--tonus-note, #111)` — so a host
|
|
39
|
+
* stylesheet can retheme a rendered chant without re-rendering it, while a
|
|
40
|
+
* file opened on its own still carries the colours it was drawn with. */
|
|
41
|
+
export interface ThemeColors {
|
|
42
|
+
/** Noteheads, stems, episemata, lyric text. */
|
|
43
|
+
note?: string;
|
|
44
|
+
/** The four staff lines. */
|
|
45
|
+
staffLine?: string;
|
|
46
|
+
/** Liturgical red: the dropcap, rubrics, and the annotation block. */
|
|
47
|
+
rubrica?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface Theme {
|
|
50
|
+
fonts?: FontSpec;
|
|
51
|
+
colors?: ThemeColors;
|
|
52
|
+
}
|
|
53
|
+
interface ResolvedFont {
|
|
54
|
+
family: string;
|
|
55
|
+
weight: number | null;
|
|
56
|
+
scale: number;
|
|
57
|
+
embed: FontEmbed | null;
|
|
58
|
+
}
|
|
59
|
+
/** One @font-face rule per embedded (family, weight); deduped across slots. */
|
|
60
|
+
export declare function fontFaceCss(fonts: ResolvedFont[]): string;
|
|
61
|
+
/** The emitter's options — INTERNAL. `inscriptio` is the public surface, and
|
|
62
|
+
* it is the only caller: the measurements below are no longer settable from
|
|
63
|
+
* outside, and a default named here is the emitter's own, not a promise to a
|
|
64
|
+
* caller. `scale` is the public control, resolved to `staffHeight` before it
|
|
65
|
+
* arrives (see inscriptio.ts). */
|
|
66
|
+
export interface SvgOpts {
|
|
67
|
+
/** Height of the 4-line staff in px (line 1 to line 4). Default 40.
|
|
68
|
+
* Set from the public `scale`; not settable directly. */
|
|
69
|
+
staffHeight?: number;
|
|
70
|
+
/** Notehead/clef size relative to the SMuFL nominal (1 = fill the space). Default 0.7. */
|
|
71
|
+
noteScale?: number;
|
|
72
|
+
/** Horizontal padding / left margin in px. Default 12. */
|
|
73
|
+
padding?: number;
|
|
74
|
+
/** Colour of staff lines. Defaults to `noteColor`. */
|
|
75
|
+
staffLineColor?: string;
|
|
76
|
+
/** Colour of notation glyphs. Default "#111". */
|
|
77
|
+
noteColor?: string;
|
|
78
|
+
/** Font-family for lyric text. Default a serif stack. */
|
|
79
|
+
fontFamily?: string;
|
|
80
|
+
fonts?: FontSpec;
|
|
81
|
+
/** Wrap systems to this px width. Absent = a single system. */
|
|
82
|
+
width?: number;
|
|
83
|
+
/** Vertical gap between systems, px. Defaults to 0.6 × staffHeight, so it
|
|
84
|
+
* follows the scale rather than staying a fixed 24px under a large chant. */
|
|
85
|
+
systemGap?: number;
|
|
86
|
+
/** Draw a custos (line-end guide note) at each system break. Defaults to
|
|
87
|
+
* true whenever `width` wraps — a chant book sets one at every line's end,
|
|
88
|
+
* so wrapping is the condition, not a separate choice. */
|
|
89
|
+
custos?: boolean;
|
|
90
|
+
/** A headline above the score. */
|
|
91
|
+
title?: string;
|
|
92
|
+
/** A right-corner annotation line (feast, page cite). */
|
|
93
|
+
rubric?: string;
|
|
94
|
+
/** Derive the rubric block from chant meta (genus · modus · book). */
|
|
95
|
+
annotation?: "auto";
|
|
96
|
+
/** Draw a rubricated initial from the first lyric; the first system indents. */
|
|
97
|
+
dropcap?: boolean;
|
|
98
|
+
/** The liturgical red for dropcap and annotations. Default a sober red. */
|
|
99
|
+
rubricaColor?: string;
|
|
100
|
+
/** The intonation channel: standard accidentals, HEJI commas, or cents labels. */
|
|
101
|
+
accidentals?: AccidentalMode;
|
|
102
|
+
/** Baseline for the cents channel; the chant's home intonation by default. */
|
|
103
|
+
centsBaseline?: CentsBaseline;
|
|
104
|
+
/** Analysis tracks to draw beneath each system; they stack in a fixed order. */
|
|
105
|
+
tracks?: readonly TrackName[];
|
|
106
|
+
/** Score-level analysis the tracks consume — supplied by inscriptio. */
|
|
107
|
+
trackData?: TrackData;
|
|
108
|
+
}
|
|
109
|
+
/** The `annotation: "auto"` mark, derived from chant meta and stacked as the
|
|
110
|
+
* books set it ("Intr." over "8.") — shared by both species. */
|
|
111
|
+
export declare function autoRubricLines(chant: Chant): string[];
|
|
112
|
+
/**
|
|
113
|
+
* A syllable's lyric as SVG text content: styled runs become <tspan>s
|
|
114
|
+
* (italic, bold, small caps, rubric color); a plain lyric stays a bare
|
|
115
|
+
* escaped string. Shared by both species — callers pass runs whose
|
|
116
|
+
* concatenation equals the plain text they measure with.
|
|
117
|
+
*/
|
|
118
|
+
export declare function lyricMarkup(runs: LyricRun[] | undefined, plain: string, rubricaColor: string): string;
|
|
119
|
+
/**
|
|
120
|
+
* One entry per tabula row, in tabula order — the TRACK CONTRACT. Analysis
|
|
121
|
+
* overlays (chironomy, tonarium) consume score data + this geometry to place
|
|
122
|
+
* marks against notes, without scraping the SVG for coordinates.
|
|
123
|
+
*/
|
|
124
|
+
export interface NoteGeometry {
|
|
125
|
+
phraseIndex: number;
|
|
126
|
+
syllableIndex: number;
|
|
127
|
+
neumeGroup: number;
|
|
128
|
+
noteIndex: number;
|
|
129
|
+
/** Which system (staff line) the note landed in — 0 when nothing wraps. */
|
|
130
|
+
system: number;
|
|
131
|
+
/** Notehead anchor in svg user units. */
|
|
132
|
+
x: number;
|
|
133
|
+
y: number;
|
|
134
|
+
/** The system's top offset within the svg — 0 in the first system. */
|
|
135
|
+
systemY: number;
|
|
136
|
+
}
|
|
137
|
+
export interface SvgResult {
|
|
138
|
+
svg: string;
|
|
139
|
+
geometry: NoteGeometry[];
|
|
140
|
+
}
|
|
141
|
+
export declare function toSvg(rows: ChantTabulaRow[], chant: Chant, options?: SvgOpts): SvgResult;
|
|
142
|
+
export {};
|
|
143
|
+
//# sourceMappingURL=svg.d.ts.map
|