@tspro/web-music-score 5.3.0 → 5.4.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 +12 -0
- package/README.md +6 -4
- package/dist/audio/index.d.mts +1 -1
- package/dist/audio/index.d.ts +1 -1
- package/dist/audio/index.js +3 -3
- package/dist/audio/index.mjs +6 -6
- package/dist/audio-cg/index.js +1 -1
- package/dist/audio-cg/index.mjs +3 -3
- package/dist/audio-synth/index.js +1 -1
- package/dist/audio-synth/index.mjs +3 -3
- package/dist/{chunk-C6UQDKWU.mjs → chunk-AUT4C6TY.mjs} +2 -2
- package/dist/{chunk-ZBA5XLYR.mjs → chunk-MHDBTCVG.mjs} +21 -21
- package/dist/{chunk-PMDIUO22.mjs → chunk-QGMOI7AP.mjs} +2 -2
- package/dist/chunk-ZWUBO5EW.mjs +37 -0
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +6 -31
- package/dist/{guitar-BsSayRsH.d.ts → guitar-CarHGDAt.d.ts} +1 -1
- package/dist/{guitar-DdexKdN6.d.mts → guitar-DXlB-9vK.d.mts} +1 -1
- package/dist/iife/audio-cg.global.js +1 -1
- package/dist/iife/index.global.js +18 -11
- package/dist/{music-objects-Ih9vCl4p.d.ts → music-objects-3Esbz7ij.d.ts} +48 -243
- package/dist/{music-objects-BGiRQIXW.d.mts → music-objects-ONIuVUgs.d.mts} +48 -243
- package/dist/{note-CgCIBwvR.d.ts → note-CJuq5aBy.d.ts} +13 -1
- package/dist/{note-eA2xPPiG.d.mts → note-RVXvpfyV.d.mts} +13 -1
- package/dist/pieces/index.d.mts +3 -3
- package/dist/pieces/index.d.ts +3 -3
- package/dist/pieces/index.js +1 -1
- package/dist/pieces/index.mjs +2 -2
- package/dist/react-ui/index.d.mts +9 -9
- package/dist/react-ui/index.d.ts +9 -9
- package/dist/react-ui/index.js +12 -14
- package/dist/react-ui/index.mjs +14 -16
- package/dist/{scale-CBW4eTz7.d.ts → scale-C8gHC448.d.mts} +3 -3
- package/dist/{scale-DQP3b9Zx.d.mts → scale-DulPFco_.d.ts} +3 -3
- package/dist/score/index.d.mts +232 -6
- package/dist/score/index.d.ts +232 -6
- package/dist/score/index.js +981 -883
- package/dist/score/index.mjs +837 -769
- package/dist/{tempo-dkctPkCS.d.mts → tempo-BlCGZuYg.d.mts} +14 -2
- package/dist/{tempo-DMt3iwz9.d.ts → tempo-BnUjm25M.d.ts} +14 -2
- package/dist/theory/index.d.mts +6 -6
- package/dist/theory/index.d.ts +6 -6
- package/dist/theory/index.js +88 -86
- package/dist/theory/index.mjs +85 -81
- package/package.json +5 -4
|
@@ -1,207 +1,6 @@
|
|
|
1
|
-
import { N as Note, A as Accidental } from './note-
|
|
2
|
-
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr,
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* DivRect class, left, top, right, bottom rectangle divided into four sections by centerX, centerY.
|
|
7
|
-
*/
|
|
8
|
-
declare class DivRect {
|
|
9
|
-
left: number;
|
|
10
|
-
centerX: number;
|
|
11
|
-
right: number;
|
|
12
|
-
top: number;
|
|
13
|
-
centerY: number;
|
|
14
|
-
bottom: number;
|
|
15
|
-
/**
|
|
16
|
-
* Create rectangle with all zero values.
|
|
17
|
-
*/
|
|
18
|
-
constructor();
|
|
19
|
-
/**
|
|
20
|
-
* Create rectangle with left, right, top, bottom.
|
|
21
|
-
* Properties centerX and centerY will be centered in the middle.
|
|
22
|
-
*
|
|
23
|
-
* @param left - Left coordinate.
|
|
24
|
-
* @param right - Right coordinate.
|
|
25
|
-
* @param top - Top coordinate.
|
|
26
|
-
* @param bottom - Bottom coordinate.
|
|
27
|
-
*/
|
|
28
|
-
constructor(left: number, right: number, top: number, bottom: number);
|
|
29
|
-
/**
|
|
30
|
-
* Create rectangle with full arguments.
|
|
31
|
-
*
|
|
32
|
-
* @param left - Left coordinate.
|
|
33
|
-
* @param centerX - Center x-coordinate.
|
|
34
|
-
* @param right - Right coordinate.
|
|
35
|
-
* @param top - Top coordinate.
|
|
36
|
-
* @param centerY - Center y-coordinate.
|
|
37
|
-
* @param bottom - Bottom coordinate.
|
|
38
|
-
*/
|
|
39
|
-
constructor(left: number, centerX: number, right: number, top: number, centerY: number, bottom: number);
|
|
40
|
-
/**
|
|
41
|
-
* Create rect from basic left, top, width and height arguments.
|
|
42
|
-
*
|
|
43
|
-
* @param left - Left coordinate.
|
|
44
|
-
* @param top - Top coordinate.
|
|
45
|
-
* @param width - With.
|
|
46
|
-
* @param height - Height.
|
|
47
|
-
* @returns - DivRect.
|
|
48
|
-
*/
|
|
49
|
-
static create(left: number, top: number, width: number, height: number): DivRect;
|
|
50
|
-
/**
|
|
51
|
-
* Create rect from centerX, centerY, width, height arguments.
|
|
52
|
-
*
|
|
53
|
-
* @param centerX - Center x-coordinate.
|
|
54
|
-
* @param centerY - Center y-coordinate.
|
|
55
|
-
* @param width - Width.
|
|
56
|
-
* @param height - Height.
|
|
57
|
-
* @returns - DivRect.
|
|
58
|
-
*/
|
|
59
|
-
static createCentered(centerX: number, centerY: number, width: number, height: number): DivRect;
|
|
60
|
-
/**
|
|
61
|
-
* Create rect from sections.
|
|
62
|
-
*
|
|
63
|
-
* @param leftw - Left section width.
|
|
64
|
-
* @param rightw - Right section width.
|
|
65
|
-
* @param toph - Top section height.
|
|
66
|
-
* @param bottomh - Bottomsection height.
|
|
67
|
-
* @returns - DivRect.
|
|
68
|
-
*/
|
|
69
|
-
static createSections(leftw: number, rightw: number, toph: number, bottomh: number): DivRect;
|
|
70
|
-
/**
|
|
71
|
-
* Width getter.
|
|
72
|
-
*/
|
|
73
|
-
get width(): number;
|
|
74
|
-
/**
|
|
75
|
-
* Height getter.
|
|
76
|
-
*/
|
|
77
|
-
get height(): number;
|
|
78
|
-
/**
|
|
79
|
-
* Left section width getter.
|
|
80
|
-
*/
|
|
81
|
-
get leftw(): number;
|
|
82
|
-
/**
|
|
83
|
-
* Right section width getter.
|
|
84
|
-
*/
|
|
85
|
-
get rightw(): number;
|
|
86
|
-
/**
|
|
87
|
-
* Top section height getter.
|
|
88
|
-
*/
|
|
89
|
-
get toph(): number;
|
|
90
|
-
/**
|
|
91
|
-
* Bottom section height getter.
|
|
92
|
-
*/
|
|
93
|
-
get bottomh(): number;
|
|
94
|
-
/**
|
|
95
|
-
* Does this Rect contain given (x, y)-point?
|
|
96
|
-
*
|
|
97
|
-
* @param x - X-coordinate.
|
|
98
|
-
* @param y - Y-coordinate.
|
|
99
|
-
* @returns - True/false.
|
|
100
|
-
*/
|
|
101
|
-
contains(x: number, y: number): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Do a and b rects overlap?
|
|
104
|
-
*
|
|
105
|
-
* @param a - DivRect a.
|
|
106
|
-
* @param b - DivRect b.
|
|
107
|
-
* @returns - True/false.
|
|
108
|
-
*/
|
|
109
|
-
static overlap(a: DivRect, b: DivRect): boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Do horizontal measures of a and b rects overlap?
|
|
112
|
-
*
|
|
113
|
-
* @param a - DivRect a.
|
|
114
|
-
* @param b - DivRect b.
|
|
115
|
-
* @returns - True/false.
|
|
116
|
-
*/
|
|
117
|
-
static overlapX(a: DivRect, b: DivRect): boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Check if this Rect equals with given Rect.
|
|
120
|
-
* @param a - DivRect a.
|
|
121
|
-
* @param b - DivRect b.
|
|
122
|
-
* @returns - True/false.
|
|
123
|
-
*/
|
|
124
|
-
static equals(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
125
|
-
/**
|
|
126
|
-
* Check if frame of this Rect equals with given Rect, ignoring center x- and center y-coordinates.
|
|
127
|
-
*
|
|
128
|
-
* @param a - DivRect a.
|
|
129
|
-
* @param b - DivRect b.
|
|
130
|
-
* @returns - True/false.
|
|
131
|
-
*/
|
|
132
|
-
static equalsFrame(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
133
|
-
/**
|
|
134
|
-
* Created duplicate of this Rect.
|
|
135
|
-
*
|
|
136
|
-
* @returns - Duplicate.
|
|
137
|
-
*/
|
|
138
|
-
copy(): DivRect;
|
|
139
|
-
/**
|
|
140
|
-
* Move this rect by (dx, dy). Modifies this Rect.
|
|
141
|
-
*
|
|
142
|
-
* @param dx - Offset amount in x-direction.
|
|
143
|
-
* @param dy - Offset amount in y-direction.
|
|
144
|
-
* @returns - This DivRect instance.
|
|
145
|
-
*/
|
|
146
|
-
offsetInPlace(dx: number, dy: number): DivRect;
|
|
147
|
-
/**
|
|
148
|
-
* Move this rect by (dx, dy). Immutable, returns modified copy.
|
|
149
|
-
*
|
|
150
|
-
* @param dx - Offset amount in x-direction.
|
|
151
|
-
* @param dy - Offset amount in y-direction.
|
|
152
|
-
* @returns - DivRect copy with applied offset.
|
|
153
|
-
*/
|
|
154
|
-
offsetCopy(dx: number, dy: number): DivRect;
|
|
155
|
-
/**
|
|
156
|
-
* Expand this Rect by given Rect. Modifies this Rect.
|
|
157
|
-
*
|
|
158
|
-
* @param rect - DivRect to expand this instance with.
|
|
159
|
-
* @returns - This DivRect instance.
|
|
160
|
-
*/
|
|
161
|
-
expandInPlace(rect: DivRect): DivRect;
|
|
162
|
-
/**
|
|
163
|
-
* Expand this Rect by given Rect. Immutable, returns modified copy.
|
|
164
|
-
*
|
|
165
|
-
* @param rect - DivRect to expand this instance with.
|
|
166
|
-
* @returns - Expanded copy of this DivRect.
|
|
167
|
-
*/
|
|
168
|
-
expandCopy(rect: DivRect): DivRect;
|
|
169
|
-
/**
|
|
170
|
-
* Clip this Rect by given Rect. Mmodifies this Rect.
|
|
171
|
-
*
|
|
172
|
-
* @param clipRect - DivRect to clip this instance with.
|
|
173
|
-
* @returns - This DivRect instance.
|
|
174
|
-
*/
|
|
175
|
-
clipInPlace(clipRect: DivRect): DivRect;
|
|
176
|
-
/**
|
|
177
|
-
* Clip this Rect by given Rect. Immutable, return modified copy.
|
|
178
|
-
*
|
|
179
|
-
* @param clipRect - DivRecto to clip this instance with.
|
|
180
|
-
* @returns - Clipped DivRect copy.
|
|
181
|
-
*/
|
|
182
|
-
clipCopy(clipRect: DivRect): DivRect;
|
|
183
|
-
/**
|
|
184
|
-
* Scale Rect. Anchor pos is (centerX, centerY). Modifies this Rect.
|
|
185
|
-
*
|
|
186
|
-
* @param scaleX - Scale x-amount.
|
|
187
|
-
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
188
|
-
* @returns This DivRect instance.
|
|
189
|
-
*/
|
|
190
|
-
scaleInPlace(scaleX: number, scaleY?: number): DivRect;
|
|
191
|
-
/**
|
|
192
|
-
* Scale Rect. Anchor pos is (centerX, centerY). Immutable, returns modified copy.
|
|
193
|
-
*
|
|
194
|
-
* @param scaleX - Scale x-amount.
|
|
195
|
-
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
196
|
-
* @returns Scaled copy of this DivRect.
|
|
197
|
-
*/
|
|
198
|
-
scaleCopy(scaleX: number, scaleY?: number): DivRect;
|
|
199
|
-
/**
|
|
200
|
-
* Get this DivRect instance.
|
|
201
|
-
* @returns - This DivRect instance.
|
|
202
|
-
*/
|
|
203
|
-
getRect(): DivRect;
|
|
204
|
-
}
|
|
1
|
+
import { N as Note, A as Accidental } from './note-RVXvpfyV.mjs';
|
|
2
|
+
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr, l as TupletRatio, d as Tempo, K as KeySignature, b as TimeSignature } from './tempo-BlCGZuYg.mjs';
|
|
3
|
+
import { AnchoredRect, Rect, Vec } from '@tspro/ts-utils-lib';
|
|
205
4
|
|
|
206
5
|
/** Staff preset values for score configuration. */
|
|
207
6
|
declare enum StaffPreset {
|
|
@@ -269,14 +68,20 @@ type ScoreConfiguration = StaffConfig | TabConfig | (StaffConfig | TabConfig)[];
|
|
|
269
68
|
type VoiceId = 0 | 1 | 2 | 3;
|
|
270
69
|
/** Get supported voice ids. Returns [0, 1, 2, 3]. */
|
|
271
70
|
declare function getVoiceIds(): ReadonlyArray<VoiceId>;
|
|
71
|
+
declare function isVoiceId(voiceId: unknown): voiceId is VoiceId;
|
|
72
|
+
declare function validateVoiceId(voiceId: unknown): VoiceId;
|
|
272
73
|
/** Strng number. */
|
|
273
74
|
type StringNumber = 1 | 2 | 3 | 4 | 5 | 6;
|
|
274
75
|
/** Get string numbers. Returns [0, 1, 2, 3, 4, 5]. */
|
|
275
76
|
declare function getStringNumbers(): ReadonlyArray<StringNumber>;
|
|
77
|
+
declare function isStringNumber(stringNum: unknown): stringNum is VerseNumber;
|
|
78
|
+
declare function validateStringNumber(stringNum: unknown): VerseNumber;
|
|
276
79
|
/** Verse number. */
|
|
277
80
|
type VerseNumber = 1 | 2 | 3;
|
|
278
81
|
/** Get supported verse numbers. Returns [1, 2, 3]. */
|
|
279
82
|
declare function getVerseNumbers(): ReadonlyArray<VerseNumber>;
|
|
83
|
+
declare function isVerseNumber(verse: unknown): verse is VerseNumber;
|
|
84
|
+
declare function validateVerseNumber(verseNum: unknown): VerseNumber;
|
|
280
85
|
/** Stem direction enum. */
|
|
281
86
|
declare enum Stem {
|
|
282
87
|
/** Auto stem direction. */
|
|
@@ -566,7 +371,7 @@ declare class ObjText extends MusicObject {
|
|
|
566
371
|
}
|
|
567
372
|
|
|
568
373
|
type NotationLineObject = {
|
|
569
|
-
getRect: () =>
|
|
374
|
+
getRect: () => AnchoredRect;
|
|
570
375
|
offset?: (dx: number, dy: number) => void;
|
|
571
376
|
offsetInPlace?: (dx: number, dy: number) => void;
|
|
572
377
|
};
|
|
@@ -675,12 +480,12 @@ declare class ObjTab extends ObjNotationLine {
|
|
|
675
480
|
declare class ObjStaffNoteGroup extends MusicObject {
|
|
676
481
|
readonly staff: ObjStaff;
|
|
677
482
|
readonly noteGroup: ObjNoteGroup;
|
|
678
|
-
noteHeadRects:
|
|
679
|
-
dotRects:
|
|
483
|
+
noteHeadRects: AnchoredRect[];
|
|
484
|
+
dotRects: AnchoredRect[];
|
|
680
485
|
accidentals: ObjAccidental[];
|
|
681
|
-
stemTip?:
|
|
682
|
-
stemBase?:
|
|
683
|
-
flagRects:
|
|
486
|
+
stemTip?: AnchoredRect;
|
|
487
|
+
stemBase?: AnchoredRect;
|
|
488
|
+
flagRects: AnchoredRect[];
|
|
684
489
|
private prevTopNoteY;
|
|
685
490
|
private prevBottomNoteY;
|
|
686
491
|
readonly mi: MStaffNoteGroup;
|
|
@@ -688,7 +493,7 @@ declare class ObjStaffNoteGroup extends MusicObject {
|
|
|
688
493
|
getMusicInterface(): MusicInterface;
|
|
689
494
|
pick(x: number, y: number): MusicObject[];
|
|
690
495
|
updateRect(): void;
|
|
691
|
-
getRect():
|
|
496
|
+
getRect(): AnchoredRect;
|
|
692
497
|
offset(dx: number, dy: number): void;
|
|
693
498
|
}
|
|
694
499
|
declare class ObjTabNoteGroup extends MusicObject {
|
|
@@ -725,6 +530,7 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
725
530
|
private beamGroup?;
|
|
726
531
|
private readonly staffObjects;
|
|
727
532
|
private readonly tabObjects;
|
|
533
|
+
private isNoteDisplaced;
|
|
728
534
|
readonly mi: MNoteGroup;
|
|
729
535
|
constructor(col: ObjRhythmColumn, voiceId: VoiceId, notes: ReadonlyArray<Note>, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions | undefined, tupletRatio?: TupletRatio);
|
|
730
536
|
getMusicInterface(): MNoteGroup;
|
|
@@ -735,10 +541,10 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
735
541
|
get maxDiatonicId(): number;
|
|
736
542
|
getDiatonicId(staff?: ObjStaff): number;
|
|
737
543
|
get stemDir(): Stem.Up | Stem.Down;
|
|
544
|
+
setNoteDisplacement(note: Note, isDisplaced: boolean): void;
|
|
738
545
|
enableConnective(line: ObjNotationLine): boolean;
|
|
739
546
|
startConnective(connectiveProps: ConnectiveProps): void;
|
|
740
547
|
updateRunningArguments(diatonicId: number, stemDir: Stem.Up | Stem.Down, stringNumbers: StringNumber[]): void;
|
|
741
|
-
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
742
548
|
pick(x: number, y: number): MusicObject[];
|
|
743
549
|
getTopNote(): Note;
|
|
744
550
|
getBottomNote(): Note;
|
|
@@ -777,7 +583,7 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
777
583
|
setStemTipY(staff: ObjStaff, stemTipY: number): void;
|
|
778
584
|
offset(dx: number, dy: number): void;
|
|
779
585
|
draw(ctx: RenderContext): void;
|
|
780
|
-
getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem):
|
|
586
|
+
getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem): 0 | 1 | -1;
|
|
781
587
|
static hasSameNotes(ng1: ObjNoteGroup, ng2: ObjNoteGroup): boolean;
|
|
782
588
|
}
|
|
783
589
|
|
|
@@ -796,7 +602,7 @@ declare class BeamPoint {
|
|
|
796
602
|
bottomBeamsHeight: number;
|
|
797
603
|
constructor(staff: ObjStaff, beamGroup: ObjBeamGroup, symbol: RhythmSymbol, x: number, y: number);
|
|
798
604
|
offset(dx: number, dy: number): void;
|
|
799
|
-
getRect():
|
|
605
|
+
getRect(): AnchoredRect;
|
|
800
606
|
}
|
|
801
607
|
declare class ObjStaffBeamGroup extends MusicObject {
|
|
802
608
|
readonly staff: ObjStaff;
|
|
@@ -846,8 +652,8 @@ declare class ObjBeamGroup extends MusicObject {
|
|
|
846
652
|
declare class ObjStaffRest extends MusicObject {
|
|
847
653
|
readonly staff: ObjStaff;
|
|
848
654
|
readonly rest: ObjRest;
|
|
849
|
-
restRect:
|
|
850
|
-
dotRects:
|
|
655
|
+
restRect: AnchoredRect;
|
|
656
|
+
dotRects: AnchoredRect[];
|
|
851
657
|
readonly mi: MStaffRest;
|
|
852
658
|
constructor(staff: ObjStaff, rest: ObjRest);
|
|
853
659
|
getMusicInterface(): MusicInterface;
|
|
@@ -941,7 +747,6 @@ declare class ObjRhythmColumn extends MusicObject {
|
|
|
941
747
|
private staffMaxDiatonicId;
|
|
942
748
|
private arpeggioDir;
|
|
943
749
|
private arpeggios;
|
|
944
|
-
private noteHeadDisplacements;
|
|
945
750
|
private readonly playerProps;
|
|
946
751
|
private needLayout;
|
|
947
752
|
private shapeRects;
|
|
@@ -961,8 +766,7 @@ declare class ObjRhythmColumn extends MusicObject {
|
|
|
961
766
|
*/
|
|
962
767
|
getNextColumn(): ObjRhythmColumn | undefined;
|
|
963
768
|
getTicksToNextColumn(): number;
|
|
964
|
-
getShapeRects():
|
|
965
|
-
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
769
|
+
getShapeRects(): AnchoredRect[];
|
|
966
770
|
get doc(): ObjDocument;
|
|
967
771
|
get row(): ObjScoreRow;
|
|
968
772
|
pick(x: number, y: number): MusicObject[];
|
|
@@ -973,8 +777,7 @@ declare class ObjRhythmColumn extends MusicObject {
|
|
|
973
777
|
getLyricsObject(verse: VerseNumber, line: ObjNotationLine, vpos: VerticalPos): ObjLyrics | undefined;
|
|
974
778
|
addLyricsObject(lyricsObj: ObjLyrics): void;
|
|
975
779
|
getMinWidth(): number;
|
|
976
|
-
|
|
977
|
-
getNoteHeadDisplacement(noteGroup: ObjNoteGroup, note: Note): -1 | 0 | 1;
|
|
780
|
+
updateNoteDisplacements(): void;
|
|
978
781
|
isEmpty(): boolean;
|
|
979
782
|
getPlayerNotes(): ScorePlayerNote[];
|
|
980
783
|
requestLayout(): void;
|
|
@@ -1027,7 +830,7 @@ declare class ObjStaffTabBarLine extends MusicObject {
|
|
|
1027
830
|
constructor(barLine: ObjBarLine, line: ObjNotationLine);
|
|
1028
831
|
getMusicInterface(): MusicInterface;
|
|
1029
832
|
pick(x: number, y: number): MusicObject[];
|
|
1030
|
-
setRect(r:
|
|
833
|
+
setRect(r: AnchoredRect): void;
|
|
1031
834
|
offset(dx: number, dy: number): void;
|
|
1032
835
|
}
|
|
1033
836
|
declare abstract class ObjBarLine extends MusicObject {
|
|
@@ -1194,7 +997,7 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1194
997
|
private getRhythmColumn;
|
|
1195
998
|
getMeasureTicks(): number;
|
|
1196
999
|
getConsumedTicks(voiceId?: VoiceId): number;
|
|
1197
|
-
getColumnsContentRect():
|
|
1000
|
+
getColumnsContentRect(): AnchoredRect;
|
|
1198
1001
|
getLeftSolidAreaWidth(): number;
|
|
1199
1002
|
getMinColumnsAreaWidth(): number;
|
|
1200
1003
|
getRightSolidAreaWidth(): number;
|
|
@@ -1202,9 +1005,9 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1202
1005
|
getMinWidth(): number;
|
|
1203
1006
|
getStaffLineLeft(): number;
|
|
1204
1007
|
getStaffLineRight(): number;
|
|
1205
|
-
private getLyricsObjects;
|
|
1206
1008
|
getPrevLyricsObject(lyricsObj: ObjLyrics): ObjLyrics | undefined;
|
|
1207
1009
|
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
1010
|
+
addStaticObject(line: ObjNotationLine, staticObj: MusicObject): void;
|
|
1208
1011
|
removeLayoutObjects(musicObj: MusicObject): void;
|
|
1209
1012
|
addConnectiveObject(connective: ObjConnective): void;
|
|
1210
1013
|
removeConnectiveObjects(): void;
|
|
@@ -1260,7 +1063,7 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1260
1063
|
resetLayoutGroups(ctx: RenderContext): void;
|
|
1261
1064
|
layoutLayoutGroups(ctx: RenderContext): void;
|
|
1262
1065
|
pick(x: number, y: number): MusicObject[];
|
|
1263
|
-
getConnectivesContentRect():
|
|
1066
|
+
getConnectivesContentRect(): AnchoredRect;
|
|
1264
1067
|
getDiatonicIdAt(y: number): number | undefined;
|
|
1265
1068
|
addMeasure(m: ObjMeasure): void;
|
|
1266
1069
|
getMeasures(): ReadonlyArray<ObjMeasure>;
|
|
@@ -1323,7 +1126,7 @@ declare class ObjDocument extends MusicObject {
|
|
|
1323
1126
|
removeLayoutObjects(musicObj: MusicObject): void;
|
|
1324
1127
|
private forEachMeasure;
|
|
1325
1128
|
resetMeasures(): void;
|
|
1326
|
-
updateCursorRect(cursorRect?:
|
|
1129
|
+
updateCursorRect(cursorRect?: Rect): void;
|
|
1327
1130
|
getInstrumentGroupSize(ctx: RenderContext): {
|
|
1328
1131
|
nameLeft: number;
|
|
1329
1132
|
nameRight: number;
|
|
@@ -1375,7 +1178,7 @@ declare class RenderContext {
|
|
|
1375
1178
|
setCanvas(canvas: HTMLCanvasElement): void;
|
|
1376
1179
|
setScoreEventListener(fn: ScoreEventListener): void;
|
|
1377
1180
|
needMouseInput(): boolean;
|
|
1378
|
-
getMousePos(e: MouseEvent):
|
|
1181
|
+
getMousePos(e: MouseEvent): Vec;
|
|
1379
1182
|
private updateCurStaffPos;
|
|
1380
1183
|
private updateCurObjects;
|
|
1381
1184
|
onClick(e: MouseEvent): void;
|
|
@@ -1388,20 +1191,20 @@ declare class RenderContext {
|
|
|
1388
1191
|
scoreRow: ObjScoreRow;
|
|
1389
1192
|
diatonicId: number;
|
|
1390
1193
|
}): void;
|
|
1391
|
-
updateCursorRect(cursorRect:
|
|
1194
|
+
updateCursorRect(cursorRect: Rect | undefined): void;
|
|
1392
1195
|
updateCanvasSize(): void;
|
|
1393
1196
|
draw(): void;
|
|
1394
1197
|
drawHilightStaffPosRect(): void;
|
|
1395
1198
|
drawHilightObjectRect(): void;
|
|
1396
1199
|
drawPlayCursor(): void;
|
|
1397
|
-
txFromScreenCoord(screenCoord:
|
|
1398
|
-
txToScreenCoord(coord:
|
|
1200
|
+
txFromScreenCoord(screenCoord: Vec): Vec;
|
|
1201
|
+
txToScreenCoord(coord: Vec): Vec;
|
|
1399
1202
|
clearCanvas(): void;
|
|
1400
|
-
drawDebugRect(r:
|
|
1203
|
+
drawDebugRect(r: AnchoredRect | Rect): void;
|
|
1401
1204
|
drawLedgerLines(staff: ObjStaff, diatonicId: number, x: number): void;
|
|
1402
|
-
getRestRect(restSize: number):
|
|
1205
|
+
getRestRect(restSize: number): AnchoredRect;
|
|
1403
1206
|
drawRest(restSize: number, x: number, y: number): void;
|
|
1404
|
-
drawFlag(rect:
|
|
1207
|
+
drawFlag(rect: Rect | AnchoredRect, dir: "up" | "down"): void;
|
|
1405
1208
|
color(color: string): RenderContext;
|
|
1406
1209
|
lineColor(color: string): RenderContext;
|
|
1407
1210
|
fillColor(color: string): RenderContext;
|
|
@@ -1430,7 +1233,7 @@ declare class RenderContext {
|
|
|
1430
1233
|
fillCircle(x: number, y: number, radius: number): void;
|
|
1431
1234
|
strokeLine(startX: number, startY: number, endX: number, endY: number): void;
|
|
1432
1235
|
strokePartialLine(startX: number, startY: number, endX: number, endY: number, startT: number, endT: number): void;
|
|
1433
|
-
drawBrace(rect:
|
|
1236
|
+
drawBrace(rect: AnchoredRect, side: "left" | "right"): void;
|
|
1434
1237
|
}
|
|
1435
1238
|
|
|
1436
1239
|
declare class ObjEnding extends MusicObject {
|
|
@@ -1441,7 +1244,7 @@ declare class ObjEnding extends MusicObject {
|
|
|
1441
1244
|
readonly mi: MEnding;
|
|
1442
1245
|
constructor(measure: ObjMeasure, passages: number[]);
|
|
1443
1246
|
getMusicInterface(): MEnding;
|
|
1444
|
-
getShapeRects():
|
|
1247
|
+
getShapeRects(): AnchoredRect[];
|
|
1445
1248
|
isSingleMeasureEnding(): boolean;
|
|
1446
1249
|
hasPassage(pass: number): boolean;
|
|
1447
1250
|
getHighestPassage(): number;
|
|
@@ -1576,25 +1379,27 @@ declare class LayoutObjectWrapper {
|
|
|
1576
1379
|
readonly layoutGroup: LayoutGroup;
|
|
1577
1380
|
private positionResolved;
|
|
1578
1381
|
constructor(musicObj: LayoutableMusicObject, line: ObjNotationLine, layoutGroupId: LayoutGroupId, verticalPos: VerticalPos);
|
|
1579
|
-
|
|
1382
|
+
resetPositionResolved(): void;
|
|
1580
1383
|
setPositionResolved(): void;
|
|
1581
1384
|
isPositionResolved(): boolean;
|
|
1582
1385
|
resolveClosestToStaffY(ctx: RenderContext): number;
|
|
1583
1386
|
getTextContent(): string | undefined;
|
|
1584
1387
|
layout(ctx: RenderContext): void;
|
|
1585
1388
|
offset(dx: number, dy: number): void;
|
|
1586
|
-
getRect():
|
|
1389
|
+
getRect(): AnchoredRect;
|
|
1587
1390
|
}
|
|
1588
1391
|
declare class LayoutGroup {
|
|
1589
1392
|
readonly layoutGroupId: number;
|
|
1590
|
-
private readonly
|
|
1393
|
+
private readonly layoutObject;
|
|
1591
1394
|
readonly rowAlign: boolean;
|
|
1592
1395
|
readonly widensColumn: boolean;
|
|
1396
|
+
readonly padding: number;
|
|
1593
1397
|
constructor(layoutGroupId: number);
|
|
1594
1398
|
getLayoutObjects(verticalPos: VerticalPos): Readonly<LayoutObjectWrapper[]>;
|
|
1595
1399
|
add(layoutObj: LayoutObjectWrapper): void;
|
|
1596
1400
|
remove(layoutObj: LayoutObjectWrapper): void;
|
|
1597
|
-
|
|
1401
|
+
layout(ctx: RenderContext): void;
|
|
1402
|
+
getPadding(ctx: RenderContext): number;
|
|
1598
1403
|
}
|
|
1599
1404
|
|
|
1600
1405
|
declare class MusicObjectLink {
|
|
@@ -1613,11 +1418,11 @@ declare abstract class MusicObject {
|
|
|
1613
1418
|
constructor(parent: MusicObject | undefined);
|
|
1614
1419
|
abstract getMusicInterface(): MusicInterface;
|
|
1615
1420
|
getParent(): MusicObject | undefined;
|
|
1616
|
-
protected rect:
|
|
1421
|
+
protected rect: AnchoredRect;
|
|
1617
1422
|
private needRectUpdate;
|
|
1618
1423
|
requestRectUpdate(): void;
|
|
1619
1424
|
updateRect(): void;
|
|
1620
|
-
getRect():
|
|
1425
|
+
getRect(): AnchoredRect;
|
|
1621
1426
|
/**
|
|
1622
1427
|
* Most objects are simple rects in shape.
|
|
1623
1428
|
* Some objects might be more complex consisting of multiple rects.
|
|
@@ -1625,7 +1430,7 @@ declare abstract class MusicObject {
|
|
|
1625
1430
|
*
|
|
1626
1431
|
* @returns Array of rects.
|
|
1627
1432
|
*/
|
|
1628
|
-
getShapeRects():
|
|
1433
|
+
getShapeRects(): AnchoredRect[];
|
|
1629
1434
|
/**
|
|
1630
1435
|
* Pick objects.
|
|
1631
1436
|
*
|
|
@@ -2543,4 +2348,4 @@ declare class MExtensionLine extends MusicInterface {
|
|
|
2543
2348
|
getMusicObject(): ObjExtensionLine;
|
|
2544
2349
|
}
|
|
2545
2350
|
|
|
2546
|
-
export {
|
|
2351
|
+
export { MTabSignature as $, type AnnotationText as A, MFermata as B, Connective as C, MHeader as D, MImage as E, Fermata as F, MMeasure as G, MBarLineRight as H, MBarLineLeft as I, MStaffTabBarLine as J, MNoteGroup as K, type LyricsOptions as L, MDocument as M, type NoteOptions as N, MStaffNoteGroup as O, MTabNoteGroup as P, MRest as Q, type RestOptions as R, StaffPreset as S, type TupletOptions as T, MStaffRest as U, type VoiceId as V, MRhythmColumn as W, MScoreRow as X, MStaff as Y, MTab as Z, MStaffSignature as _, type ScoreConfiguration as a, MTabRhythm as a0, MSpecialText as a1, MText as a2, MLyrics as a3, MExtensionLine as a4, Clef as a5, type BaseConfig as a6, type StaffConfig as a7, type TabConfig as a8, getVoiceIds as a9, isVoiceId as aa, validateVoiceId as ab, type StringNumber as ac, getStringNumbers as ad, isStringNumber as ae, validateStringNumber as af, getVerseNumbers as ag, isVerseNumber as ah, validateVerseNumber as ai, Stem as aj, Arpeggio as ak, type StaffTabOrGroup as al, LyricsAlign as am, LyricsHyphen as an, DynamicsAnnotation as ao, TempoAnnotation as ap, PlayState as aq, type PlayStateChangeListener as ar, type MeasureOptions as b, type VerseNumber as c, type StaffTabOrGroups as d, Navigation as e, Annotation as f, Label as g, TieType as h, NoteAnchor as i, VerticalPosition as j, type ScoreEventType as k, ScoreEvent as l, ScoreStaffPosEvent as m, ScoreObjectEvent as n, type ScoreEventListener as o, MPlayer as p, MRenderContext as q, MRenderer as r, MPlaybackButtons as s, MusicInterface as t, MAccidental as u, MConnective as v, MArpeggio as w, MBeamGroup as x, MStaffBeamGroup as y, MEnding as z };
|
|
@@ -63,7 +63,7 @@ type ParsedNote = {
|
|
|
63
63
|
};
|
|
64
64
|
/** Note class. */
|
|
65
65
|
declare class Note {
|
|
66
|
-
private static
|
|
66
|
+
private static noteCache;
|
|
67
67
|
private static chromaticNoteCache;
|
|
68
68
|
/** Diatonic class */
|
|
69
69
|
readonly diatonicClass: number;
|
|
@@ -120,6 +120,18 @@ declare class Note {
|
|
|
120
120
|
* @returns - Note.
|
|
121
121
|
*/
|
|
122
122
|
static getNote(noteName: string): Note;
|
|
123
|
+
/**
|
|
124
|
+
* Test if given note name valid.
|
|
125
|
+
* @param noteName - Note name.
|
|
126
|
+
* @returns - True/false.
|
|
127
|
+
*/
|
|
128
|
+
static isNote(noteName: string): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Validate given note name.
|
|
131
|
+
* @param noteName - Note name.
|
|
132
|
+
* @returns - True or throws.
|
|
133
|
+
*/
|
|
134
|
+
static validateNote(noteName: string): true;
|
|
123
135
|
/**
|
|
124
136
|
* Get chromatic note. There are number of alternatives, this function uses simple logic to choose one.
|
|
125
137
|
* @param chromaticId - Chromatic id.
|
|
@@ -63,7 +63,7 @@ type ParsedNote = {
|
|
|
63
63
|
};
|
|
64
64
|
/** Note class. */
|
|
65
65
|
declare class Note {
|
|
66
|
-
private static
|
|
66
|
+
private static noteCache;
|
|
67
67
|
private static chromaticNoteCache;
|
|
68
68
|
/** Diatonic class */
|
|
69
69
|
readonly diatonicClass: number;
|
|
@@ -120,6 +120,18 @@ declare class Note {
|
|
|
120
120
|
* @returns - Note.
|
|
121
121
|
*/
|
|
122
122
|
static getNote(noteName: string): Note;
|
|
123
|
+
/**
|
|
124
|
+
* Test if given note name valid.
|
|
125
|
+
* @param noteName - Note name.
|
|
126
|
+
* @returns - True/false.
|
|
127
|
+
*/
|
|
128
|
+
static isNote(noteName: string): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Validate given note name.
|
|
131
|
+
* @param noteName - Note name.
|
|
132
|
+
* @returns - True or throws.
|
|
133
|
+
*/
|
|
134
|
+
static validateNote(noteName: string): true;
|
|
123
135
|
/**
|
|
124
136
|
* Get chromatic note. There are number of alternatives, this function uses simple logic to choose one.
|
|
125
137
|
* @param chromaticId - Chromatic id.
|
package/dist/pieces/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MDocument } from '../music-objects-
|
|
2
|
-
import '../note-
|
|
3
|
-
import '../tempo-
|
|
1
|
+
import { M as MDocument } from '../music-objects-ONIuVUgs.mjs';
|
|
2
|
+
import '../note-RVXvpfyV.mjs';
|
|
3
|
+
import '../tempo-BlCGZuYg.mjs';
|
|
4
4
|
import '@tspro/ts-utils-lib';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/pieces/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MDocument } from '../music-objects-
|
|
2
|
-
import '../note-
|
|
3
|
-
import '../tempo-
|
|
1
|
+
import { M as MDocument } from '../music-objects-3Esbz7ij.js';
|
|
2
|
+
import '../note-CJuq5aBy.js';
|
|
3
|
+
import '../tempo-BnUjm25M.js';
|
|
4
4
|
import '@tspro/ts-utils-lib';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/pieces/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v5.
|
|
1
|
+
/* WebMusicScore v5.4.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/pieces/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* WebMusicScore v5.
|
|
2
|
-
import "../chunk-
|
|
1
|
+
/* WebMusicScore v5.4.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
|
+
import "../chunk-AUT4C6TY.mjs";
|
|
3
3
|
|
|
4
4
|
// src/pieces/canon-pachelbel.ts
|
|
5
5
|
import { DocumentBuilder } from "@tspro/web-music-score/score";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { c as Scale, S as ScaleType } from '../scale-
|
|
4
|
-
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-
|
|
5
|
-
import { H as Handedness } from '../guitar-
|
|
6
|
-
import {
|
|
7
|
-
import '../
|
|
8
|
-
import '
|
|
3
|
+
import { c as Scale, S as ScaleType } from '../scale-C8gHC448.mjs';
|
|
4
|
+
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-RVXvpfyV.mjs';
|
|
5
|
+
import { H as Handedness } from '../guitar-DXlB-9vK.mjs';
|
|
6
|
+
import { Rect } from '@tspro/ts-utils-lib';
|
|
7
|
+
import { M as MDocument, o as ScoreEventListener, s as MPlaybackButtons } from '../music-objects-ONIuVUgs.mjs';
|
|
8
|
+
import '../tempo-BlCGZuYg.mjs';
|
|
9
9
|
|
|
10
10
|
interface CircleOfFifthsProps {
|
|
11
11
|
style?: React.CSSProperties;
|
|
@@ -160,15 +160,15 @@ declare class GuitarContext {
|
|
|
160
160
|
/** Data for fret position. */
|
|
161
161
|
declare class FretPositionData {
|
|
162
162
|
readonly fretPosition: Readonly<FretPosition>;
|
|
163
|
-
readonly cellRect:
|
|
164
|
-
readonly noteRect:
|
|
163
|
+
readonly cellRect: Rect;
|
|
164
|
+
readonly noteRect: Rect;
|
|
165
165
|
/**
|
|
166
166
|
* Create new fret position data instance.
|
|
167
167
|
* @param fretPosition - Fret position.
|
|
168
168
|
* @param cellRect - Rect of fret position cell (space around string and between fret and next fret).
|
|
169
169
|
* @param noteRect - Rect to display note name in circle.
|
|
170
170
|
*/
|
|
171
|
-
constructor(fretPosition: Readonly<FretPosition>, cellRect:
|
|
171
|
+
constructor(fretPosition: Readonly<FretPosition>, cellRect: Rect, noteRect: Rect);
|
|
172
172
|
}
|
|
173
173
|
/** Update fret position function type. */
|
|
174
174
|
type UpdateFretPositionFunc = (fretPosition: FretPosition) => void;
|
package/dist/react-ui/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { c as Scale, S as ScaleType } from '../scale-
|
|
4
|
-
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-
|
|
5
|
-
import { H as Handedness } from '../guitar-
|
|
6
|
-
import {
|
|
7
|
-
import '../
|
|
8
|
-
import '
|
|
3
|
+
import { c as Scale, S as ScaleType } from '../scale-DulPFco_.js';
|
|
4
|
+
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-CJuq5aBy.js';
|
|
5
|
+
import { H as Handedness } from '../guitar-CarHGDAt.js';
|
|
6
|
+
import { Rect } from '@tspro/ts-utils-lib';
|
|
7
|
+
import { M as MDocument, o as ScoreEventListener, s as MPlaybackButtons } from '../music-objects-3Esbz7ij.js';
|
|
8
|
+
import '../tempo-BnUjm25M.js';
|
|
9
9
|
|
|
10
10
|
interface CircleOfFifthsProps {
|
|
11
11
|
style?: React.CSSProperties;
|
|
@@ -160,15 +160,15 @@ declare class GuitarContext {
|
|
|
160
160
|
/** Data for fret position. */
|
|
161
161
|
declare class FretPositionData {
|
|
162
162
|
readonly fretPosition: Readonly<FretPosition>;
|
|
163
|
-
readonly cellRect:
|
|
164
|
-
readonly noteRect:
|
|
163
|
+
readonly cellRect: Rect;
|
|
164
|
+
readonly noteRect: Rect;
|
|
165
165
|
/**
|
|
166
166
|
* Create new fret position data instance.
|
|
167
167
|
* @param fretPosition - Fret position.
|
|
168
168
|
* @param cellRect - Rect of fret position cell (space around string and between fret and next fret).
|
|
169
169
|
* @param noteRect - Rect to display note name in circle.
|
|
170
170
|
*/
|
|
171
|
-
constructor(fretPosition: Readonly<FretPosition>, cellRect:
|
|
171
|
+
constructor(fretPosition: Readonly<FretPosition>, cellRect: Rect, noteRect: Rect);
|
|
172
172
|
}
|
|
173
173
|
/** Update fret position function type. */
|
|
174
174
|
type UpdateFretPositionFunc = (fretPosition: FretPosition) => void;
|