notula 0.0.0-stage → 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/CHANGELOG.md +90 -0
- package/LICENSE +21 -0
- package/README.md +214 -2
- package/README.zh-CN.md +216 -0
- package/THIRD_PARTY_NOTICES.md +50 -0
- package/assets/fonts/OFL.txt +94 -0
- package/dist-lib/analyze-DJ6p6BkU.js +2 -0
- package/dist-lib/analyze-DJ6p6BkU.js.map +1 -0
- package/dist-lib/audio/browser-fetch.d.ts +2 -0
- package/dist-lib/audio/felt-piano.d.ts +8 -0
- package/dist-lib/audio/highlight.d.ts +14 -0
- package/dist-lib/audio/index.d.ts +10 -0
- package/dist-lib/audio/player.d.ts +70 -0
- package/dist-lib/audio/sampled-piano.d.ts +31 -0
- package/dist-lib/audio/timeline.d.ts +45 -0
- package/dist-lib/audio.js +2 -0
- package/dist-lib/audio.js.map +1 -0
- package/dist-lib/core/color.d.ts +1 -0
- package/dist-lib/core/number.d.ts +2 -0
- package/dist-lib/core/rational.d.ts +20 -0
- package/dist-lib/core/text.d.ts +1 -0
- package/dist-lib/dsl/ast.d.ts +295 -0
- package/dist-lib/dsl/lexer.d.ts +115 -0
- package/dist-lib/dsl/parser.d.ts +7 -0
- package/dist-lib/highlight-B88FnJNW.js +2 -0
- package/dist-lib/highlight-B88FnJNW.js.map +1 -0
- package/dist-lib/index-D4SDrvs8.js +2 -0
- package/dist-lib/index-D4SDrvs8.js.map +1 -0
- package/dist-lib/index.d.ts +16 -0
- package/dist-lib/index.js +2 -0
- package/dist-lib/index.js.map +1 -0
- package/dist-lib/integrations/index.d.ts +1 -0
- package/dist-lib/integrations/markdown-dom.d.ts +8 -0
- package/dist-lib/integrations/markdown.d.ts +45 -0
- package/dist-lib/integrations/obsidian-child.d.ts +16 -0
- package/dist-lib/integrations/obsidian-playback.d.ts +19 -0
- package/dist-lib/integrations/obsidian.d.ts +86 -0
- package/dist-lib/integrations/panorama-scroll.d.ts +7 -0
- package/dist-lib/integrations/resize.d.ts +6 -0
- package/dist-lib/integrations.js +2 -0
- package/dist-lib/integrations.js.map +1 -0
- package/dist-lib/ir/analyze.d.ts +13 -0
- package/dist-lib/ir/types.d.ts +263 -0
- package/dist-lib/layout/accidentals.d.ts +20 -0
- package/dist-lib/layout/annotations.d.ts +163 -0
- package/dist-lib/layout/articulations.d.ts +93 -0
- package/dist-lib/layout/beaming.d.ts +92 -0
- package/dist-lib/layout/grace.d.ts +33 -0
- package/dist-lib/layout/layout.d.ts +3 -0
- package/dist-lib/layout/polyphony.d.ts +20 -0
- package/dist-lib/layout/spacing.d.ts +38 -0
- package/dist-lib/layout/staff.d.ts +60 -0
- package/dist-lib/layout/stems-chords.d.ts +59 -0
- package/dist-lib/layout/systems.d.ts +31 -0
- package/dist-lib/layout/ties-slurs.d.ts +59 -0
- package/dist-lib/layout/tuplets.d.ts +25 -0
- package/dist-lib/layout/types.d.ts +210 -0
- package/dist-lib/metrics/bravura-glyph-paths.d.ts +9 -0
- package/dist-lib/metrics/bravura-metrics.d.ts +52 -0
- package/dist-lib/micro/micro.d.ts +33 -0
- package/dist-lib/obsidian.js +2 -0
- package/dist-lib/obsidian.js.map +1 -0
- package/dist-lib/render.d.ts +20 -0
- package/dist-lib/shared.d.ts +8 -0
- package/dist-lib/svg/dom.d.ts +4 -0
- package/dist-lib/svg/emitter.d.ts +56 -0
- package/docs/INTEGRATIONS.md +200 -0
- package/docs/SYNTAX.md +74 -0
- package/docs/assets/cadenza-dark.svg +497 -0
- package/docs/assets/cadenza-light.svg +497 -0
- package/docs/assets/chords-dark.svg +695 -0
- package/docs/assets/chords-light.svg +695 -0
- package/docs/assets/hero-dark.svg +498 -0
- package/docs/assets/hero-light.svg +498 -0
- package/docs/assets/logo-dark.svg +12 -0
- package/docs/assets/logo-light.svg +12 -0
- package/docs/assets/wordmark-dark.svg +41 -0
- package/docs/assets/wordmark-light.svg +41 -0
- package/examples/obsidian-plugin/README.md +43 -0
- package/llms.txt +141 -0
- package/package.json +94 -4
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { type BaseDurationDen, type ParsedLeadSheetChord } from '../dsl/ast.js';
|
|
2
|
+
import type { AnalysisBracketIR, ScaleDegreeIR, TempoMarkIR } from '../ir/types.js';
|
|
3
|
+
import type { SmuflGlyphName, SmuflMetrics } from '../metrics/bravura-metrics.js';
|
|
4
|
+
import { type BBox, type BelowLabelSpec, type ChordSymbolLocalSpec, type ColumnLayout, type GlyphBox, type LayoutItem, type LineShape, type PolygonShape, type TextBox } from './types.js';
|
|
5
|
+
export declare const DEFAULT_PALETTE: Readonly<Record<string, string>>;
|
|
6
|
+
export declare const PEDAGOGY_CONSTANTS: {
|
|
7
|
+
readonly fingeringGap: 0.55;
|
|
8
|
+
readonly fingeringStackGap: 0.25;
|
|
9
|
+
readonly aboveFontSizeSp: 1.35;
|
|
10
|
+
readonly belowFontSizeSp: 1.45;
|
|
11
|
+
readonly aboveGap: 0.65;
|
|
12
|
+
readonly aboveStaggerGap: 0.25;
|
|
13
|
+
readonly belowGap: 0.65;
|
|
14
|
+
readonly textColumnGap: 0.45;
|
|
15
|
+
readonly figScale: 1.05;
|
|
16
|
+
readonly figStackMinGap: 0.18;
|
|
17
|
+
};
|
|
18
|
+
export declare const BRACKET_CONSTANTS: {
|
|
19
|
+
readonly labelFontSizeSp: 1;
|
|
20
|
+
readonly labelPadSp: 0.6;
|
|
21
|
+
readonly minFragmentWidthSp: 1.2;
|
|
22
|
+
readonly seamInsetSp: 0.2;
|
|
23
|
+
readonly hookLengthSp: 0.65;
|
|
24
|
+
readonly obstacleGapSp: 0.4;
|
|
25
|
+
readonly labelGapSp: 0.25;
|
|
26
|
+
};
|
|
27
|
+
export declare function resolveHighlightColor(tagOrHex: string | undefined, customPalette?: Readonly<Record<string, string>>): string | undefined;
|
|
28
|
+
export declare function estimateTextWidthSp(text: string, fontSizeSp: number, italic?: boolean, safetyBoost?: number): number;
|
|
29
|
+
export declare function makeTextBox(text: string, x: number, y: number, fontSizeSp: number, align: 'start' | 'center' | 'end', role: TextBox['role'], options?: {
|
|
30
|
+
italic?: boolean;
|
|
31
|
+
bold?: boolean;
|
|
32
|
+
color?: string;
|
|
33
|
+
highlightTag?: string;
|
|
34
|
+
safetyBoost?: number;
|
|
35
|
+
}): TextBox;
|
|
36
|
+
export interface ParsedRomanNumeral {
|
|
37
|
+
readonly isHarmonic: boolean;
|
|
38
|
+
readonly rootText: string;
|
|
39
|
+
readonly figures: readonly string[];
|
|
40
|
+
readonly secondary?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function parseRomanNumeral(raw: string): ParsedRomanNumeral;
|
|
43
|
+
export declare function buildFiguredBassStack(figures: readonly string[], fontSizeSp: number, metrics: SmuflMetrics, scale: number, color?: string, highlightTag?: string, fallbackTextRole?: TextBox['role']): {
|
|
44
|
+
items: LayoutItem[];
|
|
45
|
+
width: number;
|
|
46
|
+
minY: number;
|
|
47
|
+
maxY: number;
|
|
48
|
+
};
|
|
49
|
+
export declare function buildRomanNumeralItems(raw: string, fontSizeSp: number, metrics: SmuflMetrics, color?: string, highlightTag?: string, role?: 'analysisBelow' | 'romanRoot' | 'microText'): {
|
|
50
|
+
items: LayoutItem[];
|
|
51
|
+
width: number;
|
|
52
|
+
minY: number;
|
|
53
|
+
maxY: number;
|
|
54
|
+
};
|
|
55
|
+
export declare function buildScaleDegreeLocalItems(deg: ScaleDegreeIR, scale: number, metrics: SmuflMetrics, color?: string, highlightTag?: string): {
|
|
56
|
+
items: LayoutItem[];
|
|
57
|
+
width: number;
|
|
58
|
+
minY: number;
|
|
59
|
+
maxY: number;
|
|
60
|
+
digitCenterX: number;
|
|
61
|
+
};
|
|
62
|
+
export declare const ACC_GLYPH_MAP: Readonly<Record<string, SmuflGlyphName>>;
|
|
63
|
+
export declare const CHORD_SYMBOL_CONSTANTS: {
|
|
64
|
+
readonly displayScale: 0.62;
|
|
65
|
+
readonly rootFontSizeSp: 2.8;
|
|
66
|
+
readonly qualityFontSizeSp: 2.25;
|
|
67
|
+
readonly slashFontSizeSp: 2.4;
|
|
68
|
+
readonly bassFontSizeSp: 2.65;
|
|
69
|
+
readonly rootAccGapSp: 0.08;
|
|
70
|
+
readonly rootAccYSp: 1.45;
|
|
71
|
+
readonly rootAccScale: 0.65;
|
|
72
|
+
readonly qualGapSp: 0.04;
|
|
73
|
+
readonly qualAccGapSp: 0.05;
|
|
74
|
+
readonly qualAccYSp: 1.25;
|
|
75
|
+
readonly qualAccScale: 0.52;
|
|
76
|
+
readonly bassAccGapSp: 0.06;
|
|
77
|
+
readonly bassAccYSp: 1.35;
|
|
78
|
+
readonly bassAccScale: 0.62;
|
|
79
|
+
};
|
|
80
|
+
export interface LeadSheetChordBuildOptions {
|
|
81
|
+
readonly scale?: number;
|
|
82
|
+
readonly textRole?: TextBox['role'];
|
|
83
|
+
readonly boldRoot?: boolean;
|
|
84
|
+
readonly boldText?: boolean;
|
|
85
|
+
readonly color?: string;
|
|
86
|
+
readonly highlightTag?: string;
|
|
87
|
+
}
|
|
88
|
+
export declare function buildLeadSheetChordLocalItems(chord: ParsedLeadSheetChord, metrics: SmuflMetrics, options?: LeadSheetChordBuildOptions): {
|
|
89
|
+
items: LayoutItem[];
|
|
90
|
+
width: number;
|
|
91
|
+
minX: number;
|
|
92
|
+
maxX: number;
|
|
93
|
+
minY: number;
|
|
94
|
+
maxY: number;
|
|
95
|
+
};
|
|
96
|
+
export declare function buildChordSymbolLocalSpec(chord: ParsedLeadSheetChord, headCenterRelX: number, color: string | undefined, highlightTag: string | undefined, metrics: SmuflMetrics): ChordSymbolLocalSpec;
|
|
97
|
+
export declare function buildBelowAnnotationLocalItems(labels: readonly string[], centerRelX: number, color: string | undefined, highlightTag: string | undefined, metrics: SmuflMetrics, scaleDegrees?: readonly ScaleDegreeIR[]): BelowLabelSpec | null;
|
|
98
|
+
export declare function getItemBBox(item: LayoutItem): BBox;
|
|
99
|
+
export declare function overlapYRangeAtX(boxes: readonly BBox[], xMin: number, xMax: number, initMinY?: number, initMaxY?: number): {
|
|
100
|
+
minY: number;
|
|
101
|
+
maxY: number;
|
|
102
|
+
};
|
|
103
|
+
export declare function layoutFingerings(globalColumns: ReadonlyArray<{
|
|
104
|
+
col: ColumnLayout;
|
|
105
|
+
x: number;
|
|
106
|
+
}>, existingItems: readonly LayoutItem[], palette: Readonly<Record<string, string>> | undefined, metrics: SmuflMetrics): {
|
|
107
|
+
fingerings: GlyphBox[];
|
|
108
|
+
colFingeringBounds: Map<string, {
|
|
109
|
+
minY: number;
|
|
110
|
+
maxY: number;
|
|
111
|
+
}>;
|
|
112
|
+
};
|
|
113
|
+
export declare function layoutTextAnnotations(globalColumns: ReadonlyArray<{
|
|
114
|
+
col: ColumnLayout;
|
|
115
|
+
x: number;
|
|
116
|
+
}>, existingItems: readonly LayoutItem[], colFingeringBounds: ReadonlyMap<string, {
|
|
117
|
+
minY: number;
|
|
118
|
+
maxY: number;
|
|
119
|
+
}>, palette: Readonly<Record<string, string>> | undefined, metrics: SmuflMetrics, minXBound?: number, gapItems?: readonly (LineShape | PolygonShape)[]): {
|
|
120
|
+
belowItems: LayoutItem[];
|
|
121
|
+
aboveItems: LayoutItem[];
|
|
122
|
+
};
|
|
123
|
+
export declare function layoutAnnotations(globalColumns: ReadonlyArray<{
|
|
124
|
+
col: ColumnLayout;
|
|
125
|
+
x: number;
|
|
126
|
+
}>, existingItems: readonly LayoutItem[], palette: Readonly<Record<string, string>> | undefined, metrics: SmuflMetrics, minXBound?: number): {
|
|
127
|
+
fingerings: GlyphBox[];
|
|
128
|
+
belowItems: LayoutItem[];
|
|
129
|
+
aboveItems: LayoutItem[];
|
|
130
|
+
};
|
|
131
|
+
export declare const TEMPO_CONSTANTS: {
|
|
132
|
+
readonly fontSizeSp: 1.45;
|
|
133
|
+
readonly boldSafetyBoost: 1.06;
|
|
134
|
+
readonly metGlyphScale: 0.55;
|
|
135
|
+
readonly minLowerInkY: 3.2;
|
|
136
|
+
readonly clearanceGap: 0.85;
|
|
137
|
+
readonly horizontalGap: 0.75;
|
|
138
|
+
readonly staggerGap: 0.85;
|
|
139
|
+
};
|
|
140
|
+
export declare function tempoNoteGlyphForUnit(unit: BaseDurationDen): SmuflGlyphName;
|
|
141
|
+
export interface TempoLocalSpec {
|
|
142
|
+
readonly items: readonly LayoutItem[];
|
|
143
|
+
readonly width: number;
|
|
144
|
+
readonly relMinY: number;
|
|
145
|
+
readonly relMaxY: number;
|
|
146
|
+
}
|
|
147
|
+
export declare function buildTempoMarkLocalItems(tempo: TempoMarkIR, metrics: SmuflMetrics): TempoLocalSpec;
|
|
148
|
+
export declare function collectObstacleBoxes(items: readonly LayoutItem[], includeCrit?: boolean): BBox[];
|
|
149
|
+
export interface TempoAnchorInput {
|
|
150
|
+
readonly tempo: TempoMarkIR;
|
|
151
|
+
readonly anchorX: number;
|
|
152
|
+
readonly local?: TempoLocalSpec;
|
|
153
|
+
}
|
|
154
|
+
export declare function layoutTempoMarks(tempoInputs: readonly TempoAnchorInput[], existingStaff0Items: readonly LayoutItem[], metrics: SmuflMetrics): LayoutItem[];
|
|
155
|
+
export interface SystemBracketInput {
|
|
156
|
+
readonly bracket: AnalysisBracketIR;
|
|
157
|
+
readonly staffIdx: number;
|
|
158
|
+
readonly startSystemIdx: number;
|
|
159
|
+
readonly endSystemIdx: number;
|
|
160
|
+
readonly startMinX: number;
|
|
161
|
+
readonly endMaxX: number;
|
|
162
|
+
}
|
|
163
|
+
export declare function layoutSystemAnalysisBrackets(brackets: readonly SystemBracketInput[], sysIdx: number, staffStartX: number, preambleInkRightByStaff: readonly number[], closingBarlineLeftInkX: number, topStaffTopInkY: number, botStaffBotInkY: number, existingSystemItems: readonly LayoutItem[], metrics: SmuflMetrics): LayoutItem[];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type Rational } from '../core/rational.js';
|
|
2
|
+
import type { DynamicIR, DynamicKind, OrnamentKind, PedalMarkIR } from '../ir/types.js';
|
|
3
|
+
import type { SmuflGlyphName, SmuflMetrics } from '../metrics/bravura-metrics.js';
|
|
4
|
+
import { type BBox, type ColumnLayout, type DynamicLocalSpec, type GlyphBox, type LayoutItem, type LineShape } from './types.js';
|
|
5
|
+
export declare const ARTICULATION_CONSTANTS: {
|
|
6
|
+
readonly staccatoGap: 0.4;
|
|
7
|
+
readonly tenutoGap: 0.4;
|
|
8
|
+
readonly stackGap: 0.3;
|
|
9
|
+
readonly staffLineClearance: 0.12;
|
|
10
|
+
readonly accentGap: 0.45;
|
|
11
|
+
readonly marcatoGap: 0.5;
|
|
12
|
+
readonly ornamentGap: 0.5;
|
|
13
|
+
readonly fermataGap: 0.55;
|
|
14
|
+
readonly dynamicGap: 0.65;
|
|
15
|
+
readonly dynamicHorizontalGap: 0.45;
|
|
16
|
+
};
|
|
17
|
+
export declare const HAIRPIN_CONSTANTS: {
|
|
18
|
+
readonly aperture: 1;
|
|
19
|
+
readonly halfAperture: 0.5;
|
|
20
|
+
readonly dynGap: 0.45;
|
|
21
|
+
readonly minSpan: 1.5;
|
|
22
|
+
readonly minFragSpan: 0.6;
|
|
23
|
+
readonly sharedOnsetGap: 0.4;
|
|
24
|
+
};
|
|
25
|
+
export declare function computeHairpinOpticalCenterOffset(metrics: SmuflMetrics): number;
|
|
26
|
+
export interface HairpinFragmentInput {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly kind: 'cresc' | 'dim';
|
|
29
|
+
readonly placement: 'above' | 'below';
|
|
30
|
+
readonly x0: number;
|
|
31
|
+
readonly x1: number;
|
|
32
|
+
readonly leftFraction: number;
|
|
33
|
+
readonly rightFraction: number;
|
|
34
|
+
readonly hasIncomingSeam?: boolean;
|
|
35
|
+
readonly hasOutgoingSeam?: boolean;
|
|
36
|
+
readonly color?: string;
|
|
37
|
+
readonly highlightTag?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare const DYNAMIC_GLYPH_MAP: Readonly<Record<DynamicKind, SmuflGlyphName>>;
|
|
40
|
+
export declare const ORNAMENT_GLYPH_MAP: Readonly<Record<OrnamentKind, SmuflGlyphName>>;
|
|
41
|
+
export interface InnerArticulationBox {
|
|
42
|
+
readonly bbox: BBox;
|
|
43
|
+
readonly eventId: string;
|
|
44
|
+
readonly side: 'above' | 'below';
|
|
45
|
+
}
|
|
46
|
+
export interface InnerArticulationsResult {
|
|
47
|
+
readonly items: readonly GlyphBox[];
|
|
48
|
+
readonly boxes: readonly InnerArticulationBox[];
|
|
49
|
+
}
|
|
50
|
+
export interface OuterArticulationsResult {
|
|
51
|
+
readonly items: readonly GlyphBox[];
|
|
52
|
+
}
|
|
53
|
+
export interface DynamicAnchorInput {
|
|
54
|
+
readonly spec: DynamicLocalSpec;
|
|
55
|
+
readonly anchorX: number;
|
|
56
|
+
}
|
|
57
|
+
export declare function dynamicGlyphForKind(kind: DynamicKind): SmuflGlyphName;
|
|
58
|
+
export declare function buildSffffGlyph(x: number, y: number, scale: number, metrics: SmuflMetrics): GlyphBox;
|
|
59
|
+
export declare function buildDynamicLocalSpec(dynamic: DynamicIR, eventId: string, color: string | undefined, highlightTag: string | undefined, metrics: SmuflMetrics): DynamicLocalSpec;
|
|
60
|
+
export declare function layoutInnerArticulations(staffCols: ReadonlyArray<{
|
|
61
|
+
col: ColumnLayout;
|
|
62
|
+
x: number;
|
|
63
|
+
}>, preInnerItems: readonly LayoutItem[], palette: Readonly<Record<string, string>> | undefined, metrics: SmuflMetrics): InnerArticulationsResult;
|
|
64
|
+
export declare function layoutOuterArticulations(staffCols: ReadonlyArray<{
|
|
65
|
+
col: ColumnLayout;
|
|
66
|
+
x: number;
|
|
67
|
+
}>, postSlurItems: readonly LayoutItem[], palette: Readonly<Record<string, string>> | undefined, metrics: SmuflMetrics): OuterArticulationsResult;
|
|
68
|
+
export declare function layoutDynamicsAndHairpins(dynamicAnchors: readonly DynamicAnchorInput[], hairpinFragments: readonly HairpinFragmentInput[], existingItems: readonly LayoutItem[], palette: Readonly<Record<string, string>> | undefined, metrics: SmuflMetrics, gap?: {
|
|
69
|
+
readonly side: 'above' | 'below';
|
|
70
|
+
readonly oppositeEdge: (minX: number, maxX: number) => number;
|
|
71
|
+
}): {
|
|
72
|
+
dynamicItems: GlyphBox[];
|
|
73
|
+
hairpinItems: LineShape[];
|
|
74
|
+
};
|
|
75
|
+
export declare function layoutDynamics(dynamicAnchors: readonly DynamicAnchorInput[], existingItems: readonly LayoutItem[], palette: Readonly<Record<string, string>> | undefined, metrics: SmuflMetrics): GlyphBox[];
|
|
76
|
+
export declare const PEDAL_CONSTANTS: {
|
|
77
|
+
readonly glyphScale: 0.8;
|
|
78
|
+
readonly verticalGap: 0.65;
|
|
79
|
+
readonly floorMaxY: -2.6;
|
|
80
|
+
readonly sameOnsetGap: 0.3;
|
|
81
|
+
readonly minHorizontalGap: 0.35;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Places sustain pedal glyphs (`Ped.` and `*`) on a single unified baseline
|
|
85
|
+
* per `(staff, system)` below all overlapping staff content and below `floorMaxY`.
|
|
86
|
+
*/
|
|
87
|
+
export declare function layoutSystemPedals(pedals: readonly PedalMarkIR[], measureRange: {
|
|
88
|
+
readonly startM: number;
|
|
89
|
+
readonly endM: number;
|
|
90
|
+
}, anchorXByEventId: ReadonlyMap<string, number>, existingStaffItems: readonly LayoutItem[], staffStartX: number, metrics: SmuflMetrics, measureSlicesX?: ReadonlyMap<number, ReadonlyArray<{
|
|
91
|
+
readonly time: Rational;
|
|
92
|
+
readonly x: number;
|
|
93
|
+
}>>): GlyphBox[];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { BeamGroupIR, NoteOrChordEventIR } from '../ir/types.js';
|
|
2
|
+
import type { SmuflMetrics } from '../metrics/bravura-metrics.js';
|
|
3
|
+
import type { BBox, ColumnLayout, GlyphBox, LineShape, PolygonShape } from './types.js';
|
|
4
|
+
export declare const BEAM_CONSTANTS: {
|
|
5
|
+
readonly maxSlope: 0.4;
|
|
6
|
+
readonly dampFactor: 0.65;
|
|
7
|
+
readonly maxDeltaYCap: 1.5;
|
|
8
|
+
readonly idealStemLength: 3.5;
|
|
9
|
+
readonly minSpan1Beam: 2.5;
|
|
10
|
+
readonly minSpan2Beams: 3;
|
|
11
|
+
readonly minSpan3Beams: 3.75;
|
|
12
|
+
readonly wedgeThreshold: 0.18;
|
|
13
|
+
readonly idealBeamletLength: 1.1;
|
|
14
|
+
readonly minBeamletLength: 0.4;
|
|
15
|
+
readonly beamletGapRatio: 0.45;
|
|
16
|
+
readonly crossStaffOverlapPad: 0.3;
|
|
17
|
+
readonly crossStaffLaneGap: 0.45;
|
|
18
|
+
readonly headClearance: 0.25;
|
|
19
|
+
};
|
|
20
|
+
export declare function chooseGroupStemDirection(events: readonly NoteOrChordEventIR[], getStep: (diatonicPitch: number) => number): 'up' | 'down';
|
|
21
|
+
export interface BeamSegment {
|
|
22
|
+
readonly level: number;
|
|
23
|
+
readonly startIndex: number;
|
|
24
|
+
readonly endIndex: number;
|
|
25
|
+
readonly xStart: number;
|
|
26
|
+
readonly xEnd: number;
|
|
27
|
+
}
|
|
28
|
+
export declare function beamVertices(seg: BeamSegment, y0: number, y1: number, thickness: number): {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
}[];
|
|
32
|
+
export declare function buildBeamSegmentsFromCounts(beamCounts: readonly number[], stemXs: readonly number[], idealBeamletLength?: number): BeamSegment[];
|
|
33
|
+
export interface BeamLayoutResult {
|
|
34
|
+
readonly polygons: readonly PolygonShape[];
|
|
35
|
+
readonly stems: readonly LineShape[];
|
|
36
|
+
}
|
|
37
|
+
export declare function layoutBeamGroup(group: BeamGroupIR, columnsById: ReadonlyMap<string, {
|
|
38
|
+
col: ColumnLayout;
|
|
39
|
+
x: number;
|
|
40
|
+
}>, staffHeads: readonly GlyphBox[], metrics: SmuflMetrics, palette?: Readonly<Record<string, string>>): BeamLayoutResult;
|
|
41
|
+
export declare const CROSS_STAFF_BEAM_ROD: number;
|
|
42
|
+
export interface CrossStaffBeamColumn {
|
|
43
|
+
readonly col: ColumnLayout;
|
|
44
|
+
readonly x: number;
|
|
45
|
+
readonly staffIdx: number;
|
|
46
|
+
}
|
|
47
|
+
export declare function prepareCrossStaffBeamGroup(entries: readonly CrossStaffBeamColumn[], staffBoxes: readonly BBox[][], metrics: SmuflMetrics): {
|
|
48
|
+
upperLimit: number;
|
|
49
|
+
lowerLimit: number;
|
|
50
|
+
bandAbove: number;
|
|
51
|
+
bandBelow: number;
|
|
52
|
+
entries: readonly CrossStaffBeamColumn[];
|
|
53
|
+
xs: number[];
|
|
54
|
+
midX: number;
|
|
55
|
+
localCenter: number;
|
|
56
|
+
segments: {
|
|
57
|
+
shift: number;
|
|
58
|
+
level: number;
|
|
59
|
+
startIndex: number;
|
|
60
|
+
endIndex: number;
|
|
61
|
+
xStart: number;
|
|
62
|
+
xEnd: number;
|
|
63
|
+
}[];
|
|
64
|
+
slope: number;
|
|
65
|
+
half: number;
|
|
66
|
+
stemThickness: number;
|
|
67
|
+
};
|
|
68
|
+
export declare function stackCrossStaffBeamGroups(plans: readonly ReturnType<typeof prepareCrossStaffBeamGroup>[]): {
|
|
69
|
+
distance: number;
|
|
70
|
+
plans: {
|
|
71
|
+
upperLimit: number;
|
|
72
|
+
lowerLimit: number;
|
|
73
|
+
bandAbove: number;
|
|
74
|
+
bandBelow: number;
|
|
75
|
+
entries: readonly CrossStaffBeamColumn[];
|
|
76
|
+
xs: number[];
|
|
77
|
+
midX: number;
|
|
78
|
+
localCenter: number;
|
|
79
|
+
segments: {
|
|
80
|
+
shift: number;
|
|
81
|
+
level: number;
|
|
82
|
+
startIndex: number;
|
|
83
|
+
endIndex: number;
|
|
84
|
+
xStart: number;
|
|
85
|
+
xEnd: number;
|
|
86
|
+
}[];
|
|
87
|
+
slope: number;
|
|
88
|
+
half: number;
|
|
89
|
+
stemThickness: number;
|
|
90
|
+
}[];
|
|
91
|
+
};
|
|
92
|
+
export declare function layoutCrossStaffBeamGroup(plan: ReturnType<typeof prepareCrossStaffBeamGroup>, offsets: readonly number[], palette?: Readonly<Record<string, string>>): BeamLayoutResult;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ClefName } from '../dsl/ast.js';
|
|
2
|
+
import type { GraceEventIR } from '../ir/types.js';
|
|
3
|
+
import type { SmuflMetrics } from '../metrics/bravura-metrics.js';
|
|
4
|
+
import { type BBox, type BezierCurveShape, type ColumnLayout, type LayoutItem } from './types.js';
|
|
5
|
+
export declare const GRACE_CONSTANTS: {
|
|
6
|
+
readonly scale: 0.65;
|
|
7
|
+
readonly stemThickness: 0.09;
|
|
8
|
+
readonly colGap: 0.45;
|
|
9
|
+
readonly toHostGap: 0.45;
|
|
10
|
+
readonly slashThickness: 0.1;
|
|
11
|
+
};
|
|
12
|
+
export declare function graceItemBBox(item: LayoutItem): BBox;
|
|
13
|
+
export interface AcciaccaturaSlurSource {
|
|
14
|
+
readonly x: number;
|
|
15
|
+
readonly minY: number;
|
|
16
|
+
readonly maxY: number;
|
|
17
|
+
readonly parenMinY?: number;
|
|
18
|
+
readonly color?: string;
|
|
19
|
+
readonly highlightTag?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GraceLayoutResult {
|
|
22
|
+
readonly items: readonly LayoutItem[];
|
|
23
|
+
readonly leftExtent: number;
|
|
24
|
+
readonly acciaccaturaSlurSource?: AcciaccaturaSlurSource;
|
|
25
|
+
}
|
|
26
|
+
export declare function layoutGracePrefix(graceEvents: readonly GraceEventIR[], hostLeftInkX: number, clef: ClefName, metrics: SmuflMetrics, palette?: Readonly<Record<string, string>>): GraceLayoutResult;
|
|
27
|
+
/**
|
|
28
|
+
* GRC-04: Automatic grace-to-host slurs for \acciaccatura blocks (curved below, dir = -1).
|
|
29
|
+
*/
|
|
30
|
+
export declare function layoutAcciaccaturaSlurs(staffCols: ReadonlyArray<{
|
|
31
|
+
readonly col: ColumnLayout;
|
|
32
|
+
readonly x: number;
|
|
33
|
+
}>, existingItems: readonly LayoutItem[], metrics: SmuflMetrics): BezierCurveShape[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SmuflMetrics } from '../metrics/bravura-metrics.js';
|
|
2
|
+
import { type BBox, type BraceShape, type ColumnLayout } from './types.js';
|
|
3
|
+
export declare function shiftColumnLocalX(col: ColumnLayout, dx: number): ColumnLayout;
|
|
4
|
+
export declare function recomputeColumnExtents(col: ColumnLayout): ColumnLayout;
|
|
5
|
+
export declare function placeSimultaneousGracePrefixes(cols: readonly ColumnLayout[], metrics: SmuflMetrics): readonly ColumnLayout[];
|
|
6
|
+
export declare function shiftPolyphonicRest(col: ColumnLayout, obstacles: readonly BBox[], dir: 1 | -1, metrics: SmuflMetrics, x?: number): ColumnLayout;
|
|
7
|
+
/**
|
|
8
|
+
* POLY-03..06: Same-staff two-voice collision & unison resolution.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveVoicePairCollision(rawV1: ColumnLayout, rawV2: ColumnLayout, metrics: SmuflMetrics): {
|
|
11
|
+
v1: ColumnLayout;
|
|
12
|
+
v2: ColumnLayout;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* GRAND-03: Parametric double-S variable-width cubic Bézier Grand Staff brace.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildGrandStaffBrace(xRight: number, yTop: number, yBot: number): BraceShape;
|
|
18
|
+
export declare function resolveVisualStaffCollisions(cols: readonly ColumnLayout[], metrics: SmuflMetrics): readonly ColumnLayout[];
|
|
19
|
+
/** Express link geometry in another staff's coordinate frame. */
|
|
20
|
+
export declare function shiftColumnForLink(col: ColumnLayout, dy: number): ColumnLayout;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Rational } from '../core/rational.js';
|
|
2
|
+
import type { BarlineKind } from '../dsl/ast.js';
|
|
3
|
+
import type { SmuflMetrics } from '../metrics/bravura-metrics.js';
|
|
4
|
+
import { type ColumnLayout, type GlyphBox, type LineShape } from './types.js';
|
|
5
|
+
export declare const SPACING_CONSTANTS: {
|
|
6
|
+
readonly gourlayA: 0.55;
|
|
7
|
+
readonly minInterColumnGap: 0.55;
|
|
8
|
+
readonly minLedgerGap: 0.4;
|
|
9
|
+
readonly opticalUpToDown: 0.2;
|
|
10
|
+
readonly opticalDownToUp: -0.15;
|
|
11
|
+
readonly preBarlineGap: 0.9;
|
|
12
|
+
readonly postBarlineGap: 1;
|
|
13
|
+
readonly emptyMeasureMinWidth: 4;
|
|
14
|
+
};
|
|
15
|
+
export declare function resolveScoreDMin(minEventDuration: Rational): Rational;
|
|
16
|
+
export declare function computeSMin(dMin: Rational): number;
|
|
17
|
+
export declare function computeIdealSpace(duration: Rational, dMin: Rational, sMin: number): number;
|
|
18
|
+
export declare function computeOpticalDelta(prevDir: 'up' | 'down' | null, nextDir: 'up' | 'down' | null): number;
|
|
19
|
+
export declare function computeLedgerRodExtra(prev: ColumnLayout, next: ColumnLayout): number;
|
|
20
|
+
export declare function computeColumnRod(prev: ColumnLayout, next: ColumnLayout): number;
|
|
21
|
+
export declare function buildBarlineShapes(kind: BarlineKind, leftX: number, metrics: SmuflMetrics): {
|
|
22
|
+
shapes: LineShape[];
|
|
23
|
+
dots: GlyphBox[];
|
|
24
|
+
totalWidth: number;
|
|
25
|
+
rightEdgeX: number;
|
|
26
|
+
};
|
|
27
|
+
export declare function computeSpringStep(prev: ColumnLayout, next: ColumnLayout, dMin: Rational, sMin: number): {
|
|
28
|
+
springWidth: number;
|
|
29
|
+
rodWidth: number;
|
|
30
|
+
deltaX: number;
|
|
31
|
+
};
|
|
32
|
+
export declare function isNonZeroDuration(r: Rational): boolean;
|
|
33
|
+
export declare function buildConnectedBarlineShapes(kind: BarlineKind, leftX: number, staffCenterYs: readonly number[], metrics: SmuflMetrics): {
|
|
34
|
+
shapes: LineShape[];
|
|
35
|
+
dots: GlyphBox[];
|
|
36
|
+
totalWidth: number;
|
|
37
|
+
rightEdgeX: number;
|
|
38
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ClefName } from '../dsl/ast.js';
|
|
2
|
+
import type { KeySignatureIR, TimeSignatureIR } from '../ir/types.js';
|
|
3
|
+
import type { SmuflGlyphName, SmuflMetrics } from '../metrics/bravura-metrics.js';
|
|
4
|
+
import { type GlyphBox, type LineShape, type PositionedHead } from './types.js';
|
|
5
|
+
export type BaseClefName = 'treble' | 'bass' | 'alto' | 'tenor';
|
|
6
|
+
interface ClefSpec {
|
|
7
|
+
readonly glyphName: SmuflGlyphName;
|
|
8
|
+
readonly baseClef: BaseClefName;
|
|
9
|
+
readonly refStaffStep: number;
|
|
10
|
+
readonly refDiatonicPitch: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const CLEF_SPECS: Readonly<Record<ClefName, ClefSpec>>;
|
|
13
|
+
export declare const KEY_SHARP_STEPS: Readonly<Record<BaseClefName, readonly number[]>>;
|
|
14
|
+
export declare const KEY_FLAT_STEPS: Readonly<Record<BaseClefName, readonly number[]>>;
|
|
15
|
+
export declare const PREAMBLE_CONSTANTS: {
|
|
16
|
+
readonly clefLeftPad: 0.75;
|
|
17
|
+
readonly compactClefLeftPad: 0.4;
|
|
18
|
+
readonly clefToKeyGap: 0.75;
|
|
19
|
+
readonly toTimeSigGap: 0.85;
|
|
20
|
+
readonly keyAccidentalGap: 0.25;
|
|
21
|
+
readonly keyCancelGroupGap: 0.35;
|
|
22
|
+
readonly timeDigitGap: 0.08;
|
|
23
|
+
readonly preambleToFirstNoteGap: 1.25;
|
|
24
|
+
readonly compactPreambleToFirstNoteGap: 0.7;
|
|
25
|
+
readonly inlineBarToChangeGap: 0.6;
|
|
26
|
+
readonly inlineChangeToNoteGap: 1;
|
|
27
|
+
};
|
|
28
|
+
export interface KeyGlyphSlot {
|
|
29
|
+
readonly glyphName: SmuflGlyphName;
|
|
30
|
+
readonly staffStep: number;
|
|
31
|
+
readonly gapBefore: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* STAFF-07: Build the ordered key signature glyph sequence for initial display
|
|
35
|
+
* or key-signature transitions (including cancellation naturals).
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildKeySignatureGlyphSequence(clef: ClefName, key: KeySignatureIR, previousKey?: KeySignatureIR, metrics?: SmuflMetrics): KeyGlyphSlot[];
|
|
38
|
+
export declare function diatonicToStaffStep(diatonicPitch: number, clef: ClefName): number;
|
|
39
|
+
export declare function buildPreamble(clef: ClefName, key: KeySignatureIR, time: TimeSignatureIR, showClef: boolean, showKey: boolean, showTime: boolean, startX: number, isInitial: boolean, metrics: SmuflMetrics, compact?: boolean, previousKey?: KeySignatureIR): {
|
|
40
|
+
items: GlyphBox[];
|
|
41
|
+
rightEdgeX: number;
|
|
42
|
+
};
|
|
43
|
+
export interface SyncPreambleInput {
|
|
44
|
+
readonly clef: ClefName;
|
|
45
|
+
readonly key: KeySignatureIR;
|
|
46
|
+
readonly previousKey?: KeySignatureIR;
|
|
47
|
+
readonly time: TimeSignatureIR;
|
|
48
|
+
readonly showClef: boolean;
|
|
49
|
+
readonly showKey: boolean;
|
|
50
|
+
readonly showTime: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* GRAND-01: Synchronized multi-staff preamble column alignment.
|
|
54
|
+
*/
|
|
55
|
+
export declare function buildSynchronizedPreamble(inputs: readonly SyncPreambleInput[], startX: number, useSystemStartPad: boolean, metrics: SmuflMetrics, compact?: boolean): {
|
|
56
|
+
perStaffItems: GlyphBox[][];
|
|
57
|
+
rightEdgeX: number;
|
|
58
|
+
};
|
|
59
|
+
export declare function buildLedgerLines(heads: readonly PositionedHead[], metrics: SmuflMetrics, color?: string, highlightTag?: string, sourceId?: string, scale?: number, cap?: number): LineShape[];
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { BaseDurationDen, BreathMarkKind, ClefName } from '../dsl/ast.js';
|
|
2
|
+
import type { NoteOrChordEventIR, PitchIR, RestEventIR, VoiceStemRole } from '../ir/types.js';
|
|
3
|
+
import type { SmuflGlyphName, SmuflMetrics } from '../metrics/bravura-metrics.js';
|
|
4
|
+
import { type BBox, type ColumnLayout, type GlyphBox, type LineShape, type PositionedHead } from './types.js';
|
|
5
|
+
export declare const PAREN_CONSTANTS: {
|
|
6
|
+
readonly opticalGapSp: 0.12;
|
|
7
|
+
};
|
|
8
|
+
export declare function layoutNoteheadParentheses(heads: readonly PositionedHead[], parenthesizedFlags: readonly boolean[], ledgerLines: readonly LineShape[], stemObstacle: BBox | null, flag: GlyphBox | null, metrics: SmuflMetrics, scale?: number): PositionedHead[];
|
|
9
|
+
export declare const ARPEGGIO_CONSTANTS: {
|
|
10
|
+
readonly scale: 1;
|
|
11
|
+
readonly toObstacleGap: 0.35;
|
|
12
|
+
readonly verticalOverhang: 0.45;
|
|
13
|
+
};
|
|
14
|
+
export declare const BREATH_CONSTANTS: {
|
|
15
|
+
readonly commaY: 2.1;
|
|
16
|
+
readonly caesuraY: 0.9;
|
|
17
|
+
readonly commaGap: 0.45;
|
|
18
|
+
readonly caesuraGap: 0.5;
|
|
19
|
+
readonly scale: 1;
|
|
20
|
+
readonly beamClearGap: 0.35;
|
|
21
|
+
};
|
|
22
|
+
export declare const TREMOLO_CONSTANTS: {
|
|
23
|
+
readonly stemTipPad: 0.45;
|
|
24
|
+
readonly headPad: 0.45;
|
|
25
|
+
readonly flagStemExtra: 1;
|
|
26
|
+
readonly wholeNoteGap: 0.55;
|
|
27
|
+
readonly scale: 1;
|
|
28
|
+
};
|
|
29
|
+
export declare function tremoloGlyphForStrokes(strokes: number): SmuflGlyphName;
|
|
30
|
+
/**
|
|
31
|
+
* PHR-02: Build a breath mark (`breathMarkComma` or `caesura`) right of `anchorRightX`
|
|
32
|
+
* with no `sourceId` so playback highlighting never toggles phrase marks.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildBreathGlyph(kind: BreathMarkKind, anchorRightX: number, metrics: SmuflMetrics): GlyphBox;
|
|
35
|
+
export declare function chooseStemDirection(steps: readonly number[]): 'up' | 'down';
|
|
36
|
+
export declare function noteheadGlyphForBaseDen(baseDen: BaseDurationDen): SmuflGlyphName;
|
|
37
|
+
export declare function flagGlyphForBaseDen(baseDen: BaseDurationDen, dir: 'up' | 'down'): SmuflGlyphName | null;
|
|
38
|
+
export declare function restGlyphForBaseDen(baseDen: BaseDurationDen): SmuflGlyphName;
|
|
39
|
+
export declare function allocateChordDotSteps(sortedStepsDesc: readonly number[]): number[];
|
|
40
|
+
export declare function layoutRestColumn(event: RestEventIR, measureIndex: number, metrics: SmuflMetrics, stemRole?: VoiceStemRole): ColumnLayout;
|
|
41
|
+
type ChordPitch = {
|
|
42
|
+
readonly pitch: PitchIR;
|
|
43
|
+
readonly step: number;
|
|
44
|
+
};
|
|
45
|
+
export declare function sortStaffPitches(event: {
|
|
46
|
+
readonly notes: readonly PitchIR[];
|
|
47
|
+
readonly ottavaShift?: -1 | 1;
|
|
48
|
+
}, clef: ClefName): ChordPitch[];
|
|
49
|
+
export declare function buildChordHeads(notes: readonly ChordPitch[], dir: 'up' | 'down' | null, offset: number, glyphName: SmuflGlyphName, metrics: SmuflMetrics, sourceId: string, palette?: Readonly<Record<string, string>>, scale?: number, fallbackTag?: string): PositionedHead[];
|
|
50
|
+
export declare function buildChordDots(notes: readonly ChordPitch[], heads: readonly PositionedHead[], event: {
|
|
51
|
+
readonly id: string;
|
|
52
|
+
readonly dots: number;
|
|
53
|
+
}, flag: GlyphBox | null, metrics: SmuflMetrics, palette?: Readonly<Record<string, string>>, grace?: {
|
|
54
|
+
readonly scale: number;
|
|
55
|
+
readonly stem: LineShape | null;
|
|
56
|
+
readonly fallbackTag?: string;
|
|
57
|
+
}): GlyphBox[];
|
|
58
|
+
export declare function layoutNoteColumn(event: NoteOrChordEventIR, measureIndex: number, clef: ClefName, metrics: SmuflMetrics, isBeamed: boolean, forcedStemDir?: 'up' | 'down', palette?: Readonly<Record<string, string>>, stemRole?: VoiceStemRole): ColumnLayout;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ScoreIR } from '../ir/types.js';
|
|
2
|
+
import { type LayoutOptions, type LayoutTree } from './types.js';
|
|
3
|
+
export declare const SYSTEM_CONSTANTS: {
|
|
4
|
+
readonly grandStaffMarginLeft: 1.5;
|
|
5
|
+
readonly braceGapToBarline: 0.4;
|
|
6
|
+
readonly minInterStaffDistance: 10;
|
|
7
|
+
readonly interStaffInkClearance: 1.4;
|
|
8
|
+
readonly defaultSystemGap: 3.5;
|
|
9
|
+
readonly raggedLastRatio: 0.65;
|
|
10
|
+
};
|
|
11
|
+
export declare const VOLTA_CONSTANTS: {
|
|
12
|
+
readonly hookLength: 1.5;
|
|
13
|
+
readonly minClearance: 1;
|
|
14
|
+
readonly fontSizeSp: 1.2;
|
|
15
|
+
readonly labelPadLeft: 0.35;
|
|
16
|
+
readonly labelPadTop: 0.18;
|
|
17
|
+
readonly sameSystemOpenGap: 0.35;
|
|
18
|
+
readonly afterBarStartGap: 0.25;
|
|
19
|
+
readonly afterPreambleStartGap: 0.35;
|
|
20
|
+
};
|
|
21
|
+
export declare const OTTAVA_CONSTANTS: {
|
|
22
|
+
readonly glyphScale: 0.85;
|
|
23
|
+
readonly minClearance: 0.75;
|
|
24
|
+
readonly parenGap: 0.04;
|
|
25
|
+
readonly labelToLineGap: 0.35;
|
|
26
|
+
readonly endRightPad: 0.25;
|
|
27
|
+
readonly hookLength: 0.85;
|
|
28
|
+
readonly dashArray: readonly [0.55, 0.45];
|
|
29
|
+
readonly minDashSpan: 0.45;
|
|
30
|
+
};
|
|
31
|
+
export declare function layoutScoreMultiSystem(ir: ScoreIR, options?: LayoutOptions): LayoutTree;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { SlurLinkIR, TieLinkIR } from '../ir/types.js';
|
|
2
|
+
import type { SmuflMetrics } from '../metrics/bravura-metrics.js';
|
|
3
|
+
import type { BezierCurveShape, BBox, ColumnLayout, LineShape, Point, PolygonShape } from './types.js';
|
|
4
|
+
export declare const TIE_SLUR_CONSTANTS: {
|
|
5
|
+
readonly tieHorizontalGap: 0.25;
|
|
6
|
+
readonly tieVerticalOffset: 0.35;
|
|
7
|
+
readonly slurStemClearance: 0.45;
|
|
8
|
+
readonly slurHeadClearance: 0.7;
|
|
9
|
+
readonly slurCollisionPad: 0.28;
|
|
10
|
+
};
|
|
11
|
+
export declare const CROSS_SYSTEM_CONSTANTS: {
|
|
12
|
+
readonly incomingEdgePad: 0.45;
|
|
13
|
+
readonly minIncomingTieSpan: 1.15;
|
|
14
|
+
readonly outgoingBarlinePad: 0.2;
|
|
15
|
+
readonly minIncomingSlurSpan: 1.1;
|
|
16
|
+
};
|
|
17
|
+
export declare function cubicPoint(p0: Point, p1: Point, p2: Point, p3: Point, t: number): Point;
|
|
18
|
+
export declare function buildVariableBezier(p0: Point, p1: Point, p2: Point, p3: Point, dir: 1 | -1, endThickness: number, midThickness: number): BezierCurveShape | null;
|
|
19
|
+
export declare function computeTieGroupDirections(ties: readonly TieLinkIR[], columnsById: ReadonlyMap<string, {
|
|
20
|
+
col: ColumnLayout;
|
|
21
|
+
x: number;
|
|
22
|
+
}>): Map<string, 1 | -1>;
|
|
23
|
+
export declare function layoutTies(ties: readonly TieLinkIR[], columnsById: ReadonlyMap<string, {
|
|
24
|
+
col: ColumnLayout;
|
|
25
|
+
x: number;
|
|
26
|
+
}>, metrics: SmuflMetrics, palette?: Readonly<Record<string, string>>, beams?: readonly BBox[]): BezierCurveShape[];
|
|
27
|
+
interface InnerArticulationBox {
|
|
28
|
+
readonly bbox: BBox;
|
|
29
|
+
readonly eventId: string;
|
|
30
|
+
readonly side: 'above' | 'below';
|
|
31
|
+
}
|
|
32
|
+
export declare function buildSlurControls(a: Point, b: Point, dir: 1 | -1, h: number, steep?: boolean): [Point, Point];
|
|
33
|
+
export declare function layoutSlurs(slurs: readonly SlurLinkIR[], columnsInOrder: ReadonlyArray<{
|
|
34
|
+
col: ColumnLayout;
|
|
35
|
+
x: number;
|
|
36
|
+
}>, beams: readonly PolygonShape[], beamedStems: readonly LineShape[], tupletBoxes: readonly BBox[], metrics: SmuflMetrics, innerArticulationBoxes?: readonly InnerArticulationBox[], getCrossStaffDirection?: (fromEventId: string, toEventId: string) => 1 | -1 | 'between' | undefined): BezierCurveShape[];
|
|
37
|
+
export declare function computeSlurDirection(spannedOrFrom: readonly ColumnLayout[] | ColumnLayout, toCol?: ColumnLayout): 1 | -1;
|
|
38
|
+
/**
|
|
39
|
+
* SYS-04: Cross-system split Tie half renderer (outgoing to right barline, incoming from courtesy preamble).
|
|
40
|
+
*/
|
|
41
|
+
export declare function layoutCrossSystemTieHalf(tie: TieLinkIR, kind: 'outgoing' | 'incoming', entry: {
|
|
42
|
+
col: ColumnLayout;
|
|
43
|
+
x: number;
|
|
44
|
+
}, boundaryInkX: number, metrics: SmuflMetrics, palette?: Readonly<Record<string, string>>, dir?: 1 | -1, sharedHighlightTag?: string, beams?: readonly BBox[]): BezierCurveShape | null;
|
|
45
|
+
/**
|
|
46
|
+
* SYS-04: Cross-system split Slur half or intermediate bridge renderer with full obstacle clearance.
|
|
47
|
+
*/
|
|
48
|
+
export declare function layoutCrossSystemSlurHalf(kind: 'outgoing' | 'incoming' | 'bridge', entry: {
|
|
49
|
+
col: ColumnLayout;
|
|
50
|
+
x: number;
|
|
51
|
+
} | null, boundaryInkX: number, beamedStems: readonly LineShape[], metrics: SmuflMetrics, dir: 1 | -1, staffCols?: ReadonlyArray<{
|
|
52
|
+
col: ColumnLayout;
|
|
53
|
+
x: number;
|
|
54
|
+
}>, tieShapes?: readonly BezierCurveShape[], bridgeRange?: readonly [number, number], innerArticulationBoxes?: ReadonlyArray<{
|
|
55
|
+
bbox: BBox;
|
|
56
|
+
eventId: string;
|
|
57
|
+
side: 'above' | 'below';
|
|
58
|
+
}>, beams?: readonly PolygonShape[], tupletBoxes?: readonly BBox[]): BezierCurveShape | null;
|
|
59
|
+
export {};
|