@tspro/web-music-score 4.0.0 → 4.1.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 +19 -0
- package/README.md +18 -9
- package/dist/audio/index.d.mts +40 -1
- package/dist/audio/index.d.ts +40 -1
- package/dist/audio/index.js +1 -1
- package/dist/audio/index.mjs +2 -2
- package/dist/audio-cg/index.d.mts +3 -0
- package/dist/audio-cg/index.d.ts +3 -0
- package/dist/audio-cg/index.js +1 -1
- package/dist/audio-cg/index.mjs +2 -2
- package/dist/{chunk-D643HZHM.mjs → chunk-MHNTJ6FU.mjs} +2 -2
- package/dist/core/index.d.mts +12 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +3 -2
- package/dist/core/index.mjs +4 -3
- package/dist/guitar-CaZJDA05.d.ts +35 -0
- package/dist/guitar-DdexKdN6.d.mts +35 -0
- package/dist/iife/index.global.js +11 -11
- package/dist/{interface-XoKiryoV.d.mts → music-objects-DIaqNPjs.d.mts} +616 -114
- package/dist/{interface-7k8qGG44.d.ts → music-objects-xJJNlFwK.d.ts} +616 -114
- package/dist/note-eA2xPPiG.d.mts +294 -0
- package/dist/note-eA2xPPiG.d.ts +294 -0
- package/dist/pieces/index.d.mts +22 -3
- package/dist/pieces/index.d.ts +22 -3
- package/dist/pieces/index.js +5 -2
- package/dist/pieces/index.mjs +6 -3
- package/dist/react-ui/index.d.mts +166 -17
- package/dist/react-ui/index.d.ts +166 -17
- package/dist/react-ui/index.js +78 -1
- package/dist/react-ui/index.mjs +79 -2
- package/dist/scale-DQNA-YLD.d.ts +230 -0
- package/dist/scale-bnD0WnMV.d.mts +230 -0
- package/dist/score/index.d.mts +315 -47
- package/dist/score/index.d.ts +315 -47
- package/dist/score/index.js +684 -173
- package/dist/score/index.mjs +683 -174
- package/dist/tempo-Bp1UzsrZ.d.ts +399 -0
- package/dist/tempo-S85Q7uJA.d.mts +399 -0
- package/dist/theory/index.d.mts +29 -13
- package/dist/theory/index.d.ts +29 -13
- package/dist/theory/index.js +433 -42
- package/dist/theory/index.mjs +432 -43
- package/package.json +3 -2
- package/dist/guitar-DggbM2UL.d.mts +0 -17
- package/dist/guitar-cNmE-EvH.d.ts +0 -17
- package/dist/note-BFa43I86.d.mts +0 -85
- package/dist/note-CcVdUFqS.d.ts +0 -85
- package/dist/scale-C2pCNxdE.d.mts +0 -75
- package/dist/scale-CvPbJvfN.d.ts +0 -75
- package/dist/tempo-BAYoZ_Li.d.mts +0 -187
- package/dist/tempo-r2sb6Ku2.d.ts +0 -187
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Note, A as Accidental } from './note-
|
|
2
|
-
import { R as RhythmProps, N as NoteLength,
|
|
1
|
+
import { N as Note, A as Accidental } from './note-eA2xPPiG.mjs';
|
|
2
|
+
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr, k as TupletRatio, d as Tempo, K as KeySignature, b as TimeSignature } from './tempo-S85Q7uJA.mjs';
|
|
3
3
|
import { Vec2 } from '@tspro/ts-utils-lib';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -20,31 +20,31 @@ declare class DivRect {
|
|
|
20
20
|
* Create rectangle with left, right, top, bottom.
|
|
21
21
|
* Properties centerX and centerY will be centered in the middle.
|
|
22
22
|
*
|
|
23
|
-
* @param left -
|
|
24
|
-
* @param right -
|
|
25
|
-
* @param top -
|
|
26
|
-
* @param bottom -
|
|
23
|
+
* @param left - Left coordinate.
|
|
24
|
+
* @param right - Right coordinate.
|
|
25
|
+
* @param top - Top coordinate.
|
|
26
|
+
* @param bottom - Bottom coordinate.
|
|
27
27
|
*/
|
|
28
28
|
constructor(left: number, right: number, top: number, bottom: number);
|
|
29
29
|
/**
|
|
30
30
|
* Create rectangle with full arguments.
|
|
31
31
|
*
|
|
32
|
-
* @param left -
|
|
33
|
-
* @param centerX -
|
|
34
|
-
* @param right -
|
|
35
|
-
* @param top -
|
|
36
|
-
* @param centerY -
|
|
37
|
-
* @param bottom -
|
|
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
38
|
*/
|
|
39
39
|
constructor(left: number, centerX: number, right: number, top: number, centerY: number, bottom: number);
|
|
40
40
|
/**
|
|
41
41
|
* Create rect from basic left, top, width and height arguments.
|
|
42
42
|
*
|
|
43
|
-
* @param left -
|
|
44
|
-
* @param top -
|
|
45
|
-
* @param width -
|
|
46
|
-
* @param height -
|
|
47
|
-
* @returns
|
|
43
|
+
* @param left - Left coordinate.
|
|
44
|
+
* @param top - Top coordinate.
|
|
45
|
+
* @param width - With.
|
|
46
|
+
* @param height - Height.
|
|
47
|
+
* @returns - DivRect.
|
|
48
48
|
*/
|
|
49
49
|
static create(left: number, top: number, width: number, height: number): DivRect;
|
|
50
50
|
/**
|
|
@@ -52,9 +52,9 @@ declare class DivRect {
|
|
|
52
52
|
*
|
|
53
53
|
* @param centerX - Center x-coordinate.
|
|
54
54
|
* @param centerY - Center y-coordinate.
|
|
55
|
-
* @param width -
|
|
56
|
-
* @param height -
|
|
57
|
-
* @returns
|
|
55
|
+
* @param width - Width.
|
|
56
|
+
* @param height - Height.
|
|
57
|
+
* @returns - DivRect.
|
|
58
58
|
*/
|
|
59
59
|
static createCentered(centerX: number, centerY: number, width: number, height: number): DivRect;
|
|
60
60
|
/**
|
|
@@ -64,139 +64,146 @@ declare class DivRect {
|
|
|
64
64
|
* @param rightw - Right section width.
|
|
65
65
|
* @param toph - Top section height.
|
|
66
66
|
* @param bottomh - Bottomsection height.
|
|
67
|
-
* @returns
|
|
67
|
+
* @returns - DivRect.
|
|
68
68
|
*/
|
|
69
69
|
static createSections(leftw: number, rightw: number, toph: number, bottomh: number): DivRect;
|
|
70
70
|
/**
|
|
71
|
-
* Width.
|
|
71
|
+
* Width getter.
|
|
72
72
|
*/
|
|
73
73
|
get width(): number;
|
|
74
74
|
/**
|
|
75
|
-
* Height.
|
|
75
|
+
* Height getter.
|
|
76
76
|
*/
|
|
77
77
|
get height(): number;
|
|
78
78
|
/**
|
|
79
|
-
* Left section width.
|
|
79
|
+
* Left section width getter.
|
|
80
80
|
*/
|
|
81
81
|
get leftw(): number;
|
|
82
82
|
/**
|
|
83
|
-
* Right section width.
|
|
83
|
+
* Right section width getter.
|
|
84
84
|
*/
|
|
85
85
|
get rightw(): number;
|
|
86
86
|
/**
|
|
87
|
-
* Top section height.
|
|
87
|
+
* Top section height getter.
|
|
88
88
|
*/
|
|
89
89
|
get toph(): number;
|
|
90
90
|
/**
|
|
91
|
-
* Bottom section height.
|
|
91
|
+
* Bottom section height getter.
|
|
92
92
|
*/
|
|
93
93
|
get bottomh(): number;
|
|
94
94
|
/**
|
|
95
95
|
* Does this Rect contain given (x, y)-point?
|
|
96
96
|
*
|
|
97
|
-
* @param x -
|
|
98
|
-
* @param y -
|
|
99
|
-
* @returns
|
|
97
|
+
* @param x - X-coordinate.
|
|
98
|
+
* @param y - Y-coordinate.
|
|
99
|
+
* @returns - True/false.
|
|
100
100
|
*/
|
|
101
101
|
contains(x: number, y: number): boolean;
|
|
102
102
|
/**
|
|
103
103
|
* Do a and b rects overlap?
|
|
104
104
|
*
|
|
105
|
-
* @param a -
|
|
106
|
-
* @param b -
|
|
107
|
-
* @returns
|
|
105
|
+
* @param a - DivRect a.
|
|
106
|
+
* @param b - DivRect b.
|
|
107
|
+
* @returns - True/false.
|
|
108
108
|
*/
|
|
109
109
|
static overlap(a: DivRect, b: DivRect): boolean;
|
|
110
110
|
/**
|
|
111
111
|
* Do horizontal measures of a and b rects overlap?
|
|
112
112
|
*
|
|
113
|
-
* @param a -
|
|
114
|
-
* @param b -
|
|
115
|
-
* @returns
|
|
113
|
+
* @param a - DivRect a.
|
|
114
|
+
* @param b - DivRect b.
|
|
115
|
+
* @returns - True/false.
|
|
116
116
|
*/
|
|
117
117
|
static overlapX(a: DivRect, b: DivRect): boolean;
|
|
118
118
|
/**
|
|
119
119
|
* Check if this Rect equals with given Rect.
|
|
120
|
-
* @param
|
|
121
|
-
* @
|
|
120
|
+
* @param a - DivRect a.
|
|
121
|
+
* @param b - DivRect b.
|
|
122
|
+
* @returns - True/false.
|
|
122
123
|
*/
|
|
123
124
|
static equals(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
124
125
|
/**
|
|
125
|
-
* Check if frame
|
|
126
|
+
* Check if frame of this Rect equals with given Rect, ignoring center x- and center y-coordinates.
|
|
126
127
|
*
|
|
127
|
-
* @param
|
|
128
|
-
* @
|
|
128
|
+
* @param a - DivRect a.
|
|
129
|
+
* @param b - DivRect b.
|
|
130
|
+
* @returns - True/false.
|
|
129
131
|
*/
|
|
130
132
|
static equalsFrame(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
131
133
|
/**
|
|
132
134
|
* Created duplicate of this Rect.
|
|
133
135
|
*
|
|
134
|
-
* @returns
|
|
136
|
+
* @returns - Duplicate.
|
|
135
137
|
*/
|
|
136
138
|
copy(): DivRect;
|
|
137
139
|
/**
|
|
138
140
|
* Move this rect by (dx, dy). Modifies this Rect.
|
|
139
141
|
*
|
|
140
|
-
* @param dx -
|
|
141
|
-
* @param dy -
|
|
142
|
-
* @returns
|
|
142
|
+
* @param dx - Offset amount in x-direction.
|
|
143
|
+
* @param dy - Offset amount in y-direction.
|
|
144
|
+
* @returns - This DivRect instance.
|
|
143
145
|
*/
|
|
144
146
|
offsetInPlace(dx: number, dy: number): DivRect;
|
|
145
147
|
/**
|
|
146
148
|
* Move this rect by (dx, dy). Immutable, returns modified copy.
|
|
147
149
|
*
|
|
148
|
-
* @param dx -
|
|
149
|
-
* @param dy -
|
|
150
|
-
* @returns
|
|
150
|
+
* @param dx - Offset amount in x-direction.
|
|
151
|
+
* @param dy - Offset amount in y-direction.
|
|
152
|
+
* @returns - DivRect copy with applied offset.
|
|
151
153
|
*/
|
|
152
154
|
offsetCopy(dx: number, dy: number): DivRect;
|
|
153
155
|
/**
|
|
154
156
|
* Expand this Rect by given Rect. Modifies this Rect.
|
|
155
157
|
*
|
|
156
|
-
* @param rect -
|
|
157
|
-
* @returns
|
|
158
|
+
* @param rect - DivRect to expand this instance with.
|
|
159
|
+
* @returns - This DivRect instance.
|
|
158
160
|
*/
|
|
159
161
|
expandInPlace(rect: DivRect): DivRect;
|
|
160
162
|
/**
|
|
161
163
|
* Expand this Rect by given Rect. Immutable, returns modified copy.
|
|
162
164
|
*
|
|
163
|
-
* @param rect -
|
|
164
|
-
* @returns
|
|
165
|
+
* @param rect - DivRect to expand this instance with.
|
|
166
|
+
* @returns - Expanded copy of this DivRect.
|
|
165
167
|
*/
|
|
166
168
|
expandCopy(rect: DivRect): DivRect;
|
|
167
169
|
/**
|
|
168
170
|
* Clip this Rect by given Rect. Mmodifies this Rect.
|
|
169
171
|
*
|
|
170
|
-
* @param clipRect -
|
|
171
|
-
* @returns
|
|
172
|
+
* @param clipRect - DivRect to clip this instance with.
|
|
173
|
+
* @returns - This DivRect instance.
|
|
172
174
|
*/
|
|
173
175
|
clipInPlace(clipRect: DivRect): DivRect;
|
|
174
176
|
/**
|
|
175
177
|
* Clip this Rect by given Rect. Immutable, return modified copy.
|
|
176
178
|
*
|
|
177
|
-
* @param clipRect -
|
|
178
|
-
* @returns
|
|
179
|
+
* @param clipRect - DivRecto to clip this instance with.
|
|
180
|
+
* @returns - Clipped DivRect copy.
|
|
179
181
|
*/
|
|
180
182
|
clipCopy(clipRect: DivRect): DivRect;
|
|
181
183
|
/**
|
|
182
184
|
* Scale Rect. Anchor pos is (centerX, centerY). Modifies this Rect.
|
|
183
185
|
*
|
|
184
|
-
* @param scaleX -
|
|
185
|
-
* @param scaleY -
|
|
186
|
-
* @returns
|
|
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.
|
|
187
189
|
*/
|
|
188
190
|
scaleInPlace(scaleX: number, scaleY?: number): DivRect;
|
|
189
191
|
/**
|
|
190
192
|
* Scale Rect. Anchor pos is (centerX, centerY). Immutable, returns modified copy.
|
|
191
193
|
*
|
|
192
|
-
* @param scaleX -
|
|
193
|
-
* @param scaleY -
|
|
194
|
-
* @returns
|
|
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.
|
|
195
197
|
*/
|
|
196
198
|
scaleCopy(scaleX: number, scaleY?: number): DivRect;
|
|
199
|
+
/**
|
|
200
|
+
* Get this DivRect instance.
|
|
201
|
+
* @returns - This DivRect instance.
|
|
202
|
+
*/
|
|
197
203
|
getRect(): DivRect;
|
|
198
204
|
}
|
|
199
205
|
|
|
206
|
+
/** Staff preset values for score configuration. */
|
|
200
207
|
declare enum StaffPreset {
|
|
201
208
|
/** Treble staff has treble (G-) clef. */
|
|
202
209
|
Treble = "treble",
|
|
@@ -211,92 +218,157 @@ declare enum StaffPreset {
|
|
|
211
218
|
/** GuitarCombined has treble clef and tab for guitar. */
|
|
212
219
|
GuitarCombined = "guitarCombined"
|
|
213
220
|
}
|
|
221
|
+
/** Clef for staff notation lines. */
|
|
214
222
|
declare enum Clef {
|
|
223
|
+
/** G-clef (treble cleff) */
|
|
215
224
|
G = "G",
|
|
225
|
+
/** F-clef (bass cleff) */
|
|
216
226
|
F = "F"
|
|
217
227
|
}
|
|
228
|
+
/** Staff config to add staff notation line in score configuration. */
|
|
218
229
|
type StaffConfig = {
|
|
230
|
+
/** Config type, must be "staff" for staff config. */
|
|
219
231
|
type: "staff";
|
|
232
|
+
/** G-clef or F-clef for this staff config? */
|
|
220
233
|
clef: Clef | `${Clef}`;
|
|
234
|
+
/** Set name for this staff config. */
|
|
221
235
|
name?: string;
|
|
236
|
+
/** Set octave down with G-clef for guitar treble staff notation line. */
|
|
222
237
|
isOctaveDown?: boolean;
|
|
238
|
+
/** Lowest note (e.g. "C2")that can be presented in this staff notation line. */
|
|
223
239
|
minNote?: string;
|
|
240
|
+
/** Highest note (e.g. "C6") that can be presented in this staff notation line. */
|
|
224
241
|
maxNote?: string;
|
|
242
|
+
/** Voice ids that are presented in this staff notation line. */
|
|
225
243
|
voiceIds?: number[];
|
|
244
|
+
/** Set true for two staff configs with G-clef and F-clef to create grand staff. */
|
|
226
245
|
isGrand?: boolean;
|
|
227
246
|
};
|
|
247
|
+
/** Tab config to add guitar tab in score configuration. */
|
|
228
248
|
type TabConfig = {
|
|
249
|
+
/** Config type, must be "tab" for tab config. */
|
|
229
250
|
type: "tab";
|
|
251
|
+
/** Set name for this tab config. */
|
|
230
252
|
name?: string;
|
|
231
253
|
tuning?: string | string[];
|
|
254
|
+
/** Voice ids that are presented in this guitar tab notation line. */
|
|
232
255
|
voiceIds?: number[];
|
|
233
256
|
};
|
|
257
|
+
/** Score configuration. */
|
|
234
258
|
type ScoreConfiguration = StaffConfig | TabConfig | (StaffConfig | TabConfig)[];
|
|
259
|
+
/** VoiceId type. */
|
|
235
260
|
type VoiceId = 0 | 1 | 2 | 3;
|
|
261
|
+
/** Get supported VoiceIds. Returns [0, 1, 2, 3]. */
|
|
236
262
|
declare function getVoiceIds(): ReadonlyArray<VoiceId>;
|
|
263
|
+
/** Strng number type. */
|
|
237
264
|
type StringNumber = 1 | 2 | 3 | 4 | 5 | 6;
|
|
265
|
+
/** Get strin numbers. Returns [0, 1, 2, 3, 4, 5]. */
|
|
238
266
|
declare function getStringNumbers(): ReadonlyArray<StringNumber>;
|
|
267
|
+
/** Stem direction enum. */
|
|
239
268
|
declare enum Stem {
|
|
269
|
+
/** Auto stem direction. */
|
|
240
270
|
Auto = "auto",
|
|
271
|
+
/** Stem is upwards. */
|
|
241
272
|
Up = "up",
|
|
273
|
+
/** Stm is downwards. */
|
|
242
274
|
Down = "down"
|
|
243
275
|
}
|
|
276
|
+
/** Arpeggio direction enum. */
|
|
244
277
|
declare enum Arpeggio {
|
|
278
|
+
/** Upwards, chord played from lowes to highest. */
|
|
245
279
|
Up = "up",
|
|
280
|
+
/** Downwards, chord played from highest to loest. */
|
|
246
281
|
Down = "down"
|
|
247
282
|
}
|
|
283
|
+
/** Special tie length enum. */
|
|
248
284
|
declare enum TieType {
|
|
285
|
+
/** Stub tie is short tie that left anchors to note and has not right anchor point. */
|
|
249
286
|
Stub = "stub",
|
|
287
|
+
/** To measure end tie is tie that left anchors to note and right anchors to measure end. */
|
|
250
288
|
ToMeasureEnd = "toMeasureEnd"
|
|
251
289
|
}
|
|
290
|
+
/** Anchor point enum for connectives (ties, slurs, slides). */
|
|
252
291
|
declare enum NoteAnchor {
|
|
292
|
+
/** Automatically choose anchor point using simple logic. */
|
|
253
293
|
Auto = "auto",
|
|
294
|
+
/** Anchor connective above note head. */
|
|
254
295
|
Above = "above",
|
|
296
|
+
/** Anchor connective center/next to note head.*/
|
|
255
297
|
Center = "center",
|
|
298
|
+
/** Anchor connective below note head. */
|
|
256
299
|
Below = "below",
|
|
300
|
+
/** Anchor connective to stem tip. */
|
|
257
301
|
StemTip = "stemTip"
|
|
258
302
|
}
|
|
303
|
+
/** Connective enum. */
|
|
259
304
|
declare enum Connective {
|
|
305
|
+
/** Tie, connects two or more adjacent notes of same pitch with arc. */
|
|
260
306
|
Tie = "tie",
|
|
307
|
+
/** Slur, connects two or more adjacent notes of different pitch with arc. */
|
|
261
308
|
Slur = "slur",
|
|
309
|
+
/** Slide, connects two adjacent notes of different pitch with straight line. */
|
|
262
310
|
Slide = "slide"
|
|
263
311
|
}
|
|
312
|
+
/** Vertical position enum used to layout notation elements. */
|
|
264
313
|
declare enum VerticalPosition {
|
|
314
|
+
/** Automatic/default layout position depending on element. */
|
|
265
315
|
Auto = "auto",
|
|
316
|
+
/** Add element above staff/tab. */
|
|
266
317
|
Above = "above",
|
|
318
|
+
/** Add element below staff/tab. */
|
|
267
319
|
Below = "below",
|
|
320
|
+
/** Add element both above and below staff/tab. */
|
|
268
321
|
Both = "both"
|
|
269
322
|
}
|
|
323
|
+
/** Staff/tab/group type can be staff/tab index or staff/tab/group name. */
|
|
270
324
|
type StaffTabOrGroup = number | string;
|
|
325
|
+
/** Staff/tab/group snglevalue or array of values. */
|
|
271
326
|
type StaffTabOrGroups = StaffTabOrGroup | StaffTabOrGroup[];
|
|
327
|
+
/** Options for notes/chords. */
|
|
272
328
|
type NoteOptions = {
|
|
329
|
+
/** Stem direction. */
|
|
273
330
|
stem?: Stem | `${Stem}`;
|
|
331
|
+
/** Set color. */
|
|
274
332
|
color?: string;
|
|
333
|
+
/** Arepggio direction for chords. true = "up". */
|
|
275
334
|
arpeggio?: boolean | Arpeggio | `${Arpeggio}`;
|
|
335
|
+
/** Add staccato dot. */
|
|
276
336
|
staccato?: boolean;
|
|
337
|
+
/** Use diamond shaped note head. */
|
|
277
338
|
diamond?: boolean;
|
|
339
|
+
/** Set string number (array of numbers for chord) to use in guitar tab. */
|
|
278
340
|
string?: StringNumber | StringNumber[];
|
|
279
341
|
/** @deprecated - Use triplet NoteLength values instead, e.g. NoteLength.QuarterTriplet or "4t", etc. */
|
|
280
342
|
triplet?: boolean;
|
|
281
343
|
/** @deprecated - Use dotted NoteLength values instead, e.g. NoteLength.Quarter2Dots or "4..", etc. */
|
|
282
344
|
dotted?: boolean | number;
|
|
283
345
|
};
|
|
346
|
+
/** Options for rests. */
|
|
284
347
|
type RestOptions = {
|
|
348
|
+
/** Set staff position for this rest. Can be instance of Note, string (e.g. "C3"), or midiNumber. */
|
|
285
349
|
staffPos?: Note | string | number;
|
|
350
|
+
/** Set color. */
|
|
286
351
|
color?: string;
|
|
352
|
+
/** Hide this rest, still affects playing. */
|
|
287
353
|
hide?: boolean;
|
|
288
354
|
/** @deprecated - Use triplet NoteLength values instead, e.g. NoteLength.QuarterTriplet or "4t", etc. */
|
|
289
355
|
triplet?: boolean;
|
|
290
356
|
/** @deprecated - Use dotted NoteLength values instead, e.g. NoteLength.Quarter2Dots or "4..", etc. */
|
|
291
357
|
dotted?: boolean | number;
|
|
292
358
|
};
|
|
359
|
+
/** Tuplet options. */
|
|
293
360
|
type TupletOptions = {
|
|
361
|
+
/** Show tuplet ratio (e.g. "3:2") instead of number of parts (e.g. "3"). */
|
|
294
362
|
showRatio?: boolean;
|
|
295
363
|
};
|
|
364
|
+
/** Fermata enum. */
|
|
296
365
|
declare enum Fermata {
|
|
366
|
+
/** Anchor fermata to note/rest. */
|
|
297
367
|
AtNote = "atNote",
|
|
368
|
+
/** Anchor fermata to measure end. */
|
|
298
369
|
AtMeasureEnd = "atMeasureEnd"
|
|
299
370
|
}
|
|
371
|
+
/** Navigation element enum. */
|
|
300
372
|
declare enum Navigation {
|
|
301
373
|
/** Repeat back to beginning and play to the "Fine" marking. */
|
|
302
374
|
DC_al_Fine = "D.C. al Fine",
|
|
@@ -321,23 +393,53 @@ declare enum Navigation {
|
|
|
321
393
|
/** Jump to ending with correct passage number. */
|
|
322
394
|
Ending = "ending"
|
|
323
395
|
}
|
|
396
|
+
/** Annotation element enum. */
|
|
324
397
|
declare enum Annotation {
|
|
325
398
|
/** "ppp", "pp", "p", "mp", "m", "mf", "f", "ff", "fff", "cresc.", "decresc.", "dim." */
|
|
326
399
|
Dynamics = "dynamics",
|
|
327
400
|
/** "accel.", "rit.", "a tempo" */
|
|
328
401
|
Tempo = "tempo"
|
|
329
402
|
}
|
|
403
|
+
/** Some known dynamics annotations. */
|
|
404
|
+
declare enum DynamicsAnnotation {
|
|
405
|
+
cresc = "cresc.",
|
|
406
|
+
decresc = "decresc.",
|
|
407
|
+
dim = "dim.",
|
|
408
|
+
ppp = "ppp",
|
|
409
|
+
pp = "pp",
|
|
410
|
+
p = "p",
|
|
411
|
+
mp = "mp",
|
|
412
|
+
m = "m",
|
|
413
|
+
mf = "mf",
|
|
414
|
+
f = "f",
|
|
415
|
+
ff = "ff",
|
|
416
|
+
fff = "fff"
|
|
417
|
+
}
|
|
418
|
+
/** Some known tempo annotations. */
|
|
419
|
+
declare enum TempoAnnotation {
|
|
420
|
+
accel = "accel.",
|
|
421
|
+
rit = "rit.",
|
|
422
|
+
a_tempo = "a tempo"
|
|
423
|
+
}
|
|
424
|
+
/** Known annotation test type. */
|
|
425
|
+
type AnnotationText = `${DynamicsAnnotation}` | `${TempoAnnotation}`;
|
|
426
|
+
/** Label element enum. */
|
|
330
427
|
declare enum Label {
|
|
331
428
|
/** "C", "C#", "Db", "D", etc. */
|
|
332
429
|
Note = "note",
|
|
333
430
|
/** "C", "Am", "G7", etc. */
|
|
334
431
|
Chord = "chord"
|
|
335
432
|
}
|
|
433
|
+
/** Play state enum. */
|
|
336
434
|
declare enum PlayState {
|
|
435
|
+
/** Playing. */
|
|
337
436
|
Playing = 0,
|
|
437
|
+
/** Paused. */
|
|
338
438
|
Paused = 1,
|
|
439
|
+
/** Stopped. */
|
|
339
440
|
Stopped = 2
|
|
340
441
|
}
|
|
442
|
+
/** Play state change listener type. */
|
|
341
443
|
type PlayStateChangeListener = (playState: PlayState) => void;
|
|
342
444
|
|
|
343
445
|
declare class AccidentalState {
|
|
@@ -958,7 +1060,7 @@ declare class ObjMeasure extends MusicObject {
|
|
|
958
1060
|
setKeySignature(...args: unknown[]): void;
|
|
959
1061
|
updateKeySignature(): void;
|
|
960
1062
|
getTimeSignature(): TimeSignature;
|
|
961
|
-
setTimeSignature(timeSignature: TimeSignature
|
|
1063
|
+
setTimeSignature(timeSignature: TimeSignature): void;
|
|
962
1064
|
updateTimeSignature(): void;
|
|
963
1065
|
getTempo(): Tempo;
|
|
964
1066
|
setTempo(beatsPerMinute: number, beatLength?: NoteLength | NoteLengthStr, dotted?: boolean | number): void;
|
|
@@ -1458,350 +1560,750 @@ declare class ObjSignature extends MusicObject {
|
|
|
1458
1560
|
draw(renderer: Renderer): void;
|
|
1459
1561
|
}
|
|
1460
1562
|
|
|
1563
|
+
/** Score event type. */
|
|
1461
1564
|
type ScoreEventType = "enter" | "leave" | "click";
|
|
1565
|
+
/** Abstract score event class. */
|
|
1462
1566
|
declare abstract class ScoreEvent {
|
|
1463
1567
|
readonly type: ScoreEventType;
|
|
1568
|
+
/**
|
|
1569
|
+
* Create new score event instance.
|
|
1570
|
+
* @param type - Score event type.
|
|
1571
|
+
*/
|
|
1464
1572
|
constructor(type: ScoreEventType);
|
|
1465
1573
|
}
|
|
1574
|
+
/** Score staff position event for clicking/entering/leaving staff position (diatonic id) in staff notation line. */
|
|
1466
1575
|
declare class ScoreStaffPosEvent extends ScoreEvent {
|
|
1467
1576
|
readonly renderer: MRenderer;
|
|
1468
1577
|
readonly scoreRow: MScoreRow;
|
|
1469
1578
|
readonly diatonicId: number;
|
|
1579
|
+
/**
|
|
1580
|
+
* Create new score staff position event.
|
|
1581
|
+
* @param type - Score event type.
|
|
1582
|
+
* @param renderer - Renderer.
|
|
1583
|
+
* @param scoreRow - Score row.
|
|
1584
|
+
* @param diatonicId - Diatonic id that was clicked/entered/left.
|
|
1585
|
+
*/
|
|
1470
1586
|
constructor(type: ScoreEventType, renderer: MRenderer, scoreRow: MScoreRow, diatonicId: number);
|
|
1471
1587
|
}
|
|
1588
|
+
/** Score object event for clicking/entering/leaving score object. */
|
|
1472
1589
|
declare class ScoreObjectEvent extends ScoreEvent {
|
|
1473
1590
|
readonly renderer: MRenderer;
|
|
1474
1591
|
readonly objects: MusicInterface[];
|
|
1592
|
+
/**
|
|
1593
|
+
* Create new score object event.
|
|
1594
|
+
* @param type - Score event type.
|
|
1595
|
+
* @param renderer - Renderer.
|
|
1596
|
+
* @param objects - Array of objects, last object in this array is the top object that was clicked/entered/left, previous objects are it's parent objects.
|
|
1597
|
+
*/
|
|
1475
1598
|
constructor(type: ScoreEventType, renderer: MRenderer, objects: MusicInterface[]);
|
|
1599
|
+
/** Top object getter. */
|
|
1476
1600
|
get topObject(): MusicInterface;
|
|
1601
|
+
/**
|
|
1602
|
+
* Find object.
|
|
1603
|
+
* @param fn - Compare function.
|
|
1604
|
+
* @returns - First object that matched compare function, or undefined if no match.
|
|
1605
|
+
*/
|
|
1477
1606
|
findObject(fn: (obj: MusicInterface) => boolean): MusicInterface | undefined;
|
|
1478
1607
|
}
|
|
1608
|
+
/** Score event listener type. */
|
|
1479
1609
|
type ScoreEventListener = (event: ScoreEvent) => void;
|
|
1480
1610
|
|
|
1611
|
+
/** Music player class. */
|
|
1612
|
+
declare class MPlayer {
|
|
1613
|
+
private static currentlyPlaying;
|
|
1614
|
+
private readonly player;
|
|
1615
|
+
/**
|
|
1616
|
+
* Create new music player.
|
|
1617
|
+
* @param doc - Music document to play.
|
|
1618
|
+
* @param playStateChangeListener - Play state change listener.
|
|
1619
|
+
*/
|
|
1620
|
+
constructor(doc: MDocument, playStateChangeListener?: PlayStateChangeListener);
|
|
1621
|
+
/**
|
|
1622
|
+
* Stop all playing.
|
|
1623
|
+
*/
|
|
1624
|
+
static stopAll(): void;
|
|
1625
|
+
/**
|
|
1626
|
+
* Playe attached document.
|
|
1627
|
+
* @returns - This player instance.
|
|
1628
|
+
*/
|
|
1629
|
+
play(): this;
|
|
1630
|
+
/**
|
|
1631
|
+
* Pause playback of attached document.
|
|
1632
|
+
* @returns - This player instance.
|
|
1633
|
+
*/
|
|
1634
|
+
pause(): this;
|
|
1635
|
+
/**
|
|
1636
|
+
* Stop playback of attached document.
|
|
1637
|
+
* @returns - This player instance.
|
|
1638
|
+
*/
|
|
1639
|
+
stop(): this;
|
|
1640
|
+
}
|
|
1641
|
+
/** Renderer class. */
|
|
1642
|
+
declare class MRenderer {
|
|
1643
|
+
private readonly renderer;
|
|
1644
|
+
/**
|
|
1645
|
+
* Create new renderer instance.
|
|
1646
|
+
*/
|
|
1647
|
+
constructor();
|
|
1648
|
+
/**
|
|
1649
|
+
* Attach music document to this renderer.
|
|
1650
|
+
* @param doc - Music document.
|
|
1651
|
+
* @returns - This renderer instance.
|
|
1652
|
+
*/
|
|
1653
|
+
setDocument(doc?: MDocument): MRenderer;
|
|
1654
|
+
/**
|
|
1655
|
+
* Set target canvas html element for this renderer.
|
|
1656
|
+
* @param canvas - HTML canvas element or element id.
|
|
1657
|
+
* @returns - This renderer instance.
|
|
1658
|
+
*/
|
|
1659
|
+
setCanvas(canvas: HTMLCanvasElement | string): MRenderer;
|
|
1660
|
+
/**
|
|
1661
|
+
* Set score event listener.
|
|
1662
|
+
* @param scoreEventListener - Score event listener.
|
|
1663
|
+
*/
|
|
1664
|
+
setScoreEventListener(scoreEventListener: ScoreEventListener): void;
|
|
1665
|
+
/**
|
|
1666
|
+
* Draw given music object hilighted.
|
|
1667
|
+
* @param obj - Music object or undefined to remove hilighting.
|
|
1668
|
+
*/
|
|
1669
|
+
hilightObject(obj?: MusicInterface): void;
|
|
1670
|
+
/**
|
|
1671
|
+
* Draw given staff position hilighted.
|
|
1672
|
+
* @param staffPos - Staff position (score row and diatonic id) or undefined to remove hilighting.
|
|
1673
|
+
*/
|
|
1674
|
+
hilightStaffPos(staffPos?: {
|
|
1675
|
+
scoreRow: MScoreRow;
|
|
1676
|
+
diatonicId: number;
|
|
1677
|
+
}): void;
|
|
1678
|
+
/**
|
|
1679
|
+
* Draw contents of attached music document to attached canvas.
|
|
1680
|
+
*/
|
|
1681
|
+
draw(): void;
|
|
1682
|
+
}
|
|
1683
|
+
/** Playback buttons helper class. */
|
|
1684
|
+
declare class MPlaybackButtons {
|
|
1685
|
+
private playButton?;
|
|
1686
|
+
private stopButton?;
|
|
1687
|
+
private playStopButton?;
|
|
1688
|
+
private pauseButton?;
|
|
1689
|
+
private onPlay;
|
|
1690
|
+
private onStop;
|
|
1691
|
+
private onPlayStop;
|
|
1692
|
+
private onPause;
|
|
1693
|
+
private playLabel;
|
|
1694
|
+
private stopLabel;
|
|
1695
|
+
private pauseLabel;
|
|
1696
|
+
private playState;
|
|
1697
|
+
private player?;
|
|
1698
|
+
/**
|
|
1699
|
+
* Create new playback buttons helper class instance.
|
|
1700
|
+
*/
|
|
1701
|
+
constructor();
|
|
1702
|
+
/**
|
|
1703
|
+
* Attach music document whose playcak will be controlled by this playback buttons helper class instance.
|
|
1704
|
+
* @param doc - Music document.
|
|
1705
|
+
* @returns
|
|
1706
|
+
*/
|
|
1707
|
+
setDocument(doc?: MDocument): MPlaybackButtons;
|
|
1708
|
+
/**
|
|
1709
|
+
* Detach attached music document.
|
|
1710
|
+
*/
|
|
1711
|
+
detachDocument(): void;
|
|
1712
|
+
private updateButtons;
|
|
1713
|
+
/**
|
|
1714
|
+
* Set play button.
|
|
1715
|
+
* @param btn - HTML button element or element id.
|
|
1716
|
+
* @param btnLabel - Custom button label (e.g. "Play").
|
|
1717
|
+
* @returns - This playback buttons class instance.
|
|
1718
|
+
*/
|
|
1719
|
+
setPlayButton(btn: HTMLButtonElement | string, btnLabel?: string): MPlaybackButtons;
|
|
1720
|
+
/**
|
|
1721
|
+
* Set stop button.
|
|
1722
|
+
* @param btn - HTML button element or element id.
|
|
1723
|
+
* @param btnLabel - Custom button label (e.g. "Stop").
|
|
1724
|
+
* @returns - This playback buttons class instance.
|
|
1725
|
+
*/
|
|
1726
|
+
setStopButton(btn: HTMLButtonElement | string, btnLabel?: string): MPlaybackButtons;
|
|
1727
|
+
/**
|
|
1728
|
+
* Set play/stop button.
|
|
1729
|
+
* @param btn - HTML button element or element id.
|
|
1730
|
+
* @param playLabel - Custom button label for play action (e.g. "Play").
|
|
1731
|
+
* @param stopLabel - Custom button label for stop action (e.g. "Stop").
|
|
1732
|
+
* @returns - This playback buttons class instance.
|
|
1733
|
+
*/
|
|
1734
|
+
setPlayStopButton(btn: HTMLButtonElement | string, playLabel?: string, stopLabel?: string): MPlaybackButtons;
|
|
1735
|
+
/**
|
|
1736
|
+
* Set pause button.
|
|
1737
|
+
* @param btn - HTML button element or element id.
|
|
1738
|
+
* @param btnLabel - Custom button label (e.g. "Pause").
|
|
1739
|
+
* @returns - This playback buttons class instance.
|
|
1740
|
+
*/
|
|
1741
|
+
setPauseButton(btn: HTMLButtonElement | string, btnLabel?: string): MPlaybackButtons;
|
|
1742
|
+
private static savedOnClickListeners;
|
|
1743
|
+
private static removeOnClickListeners;
|
|
1744
|
+
private static addOnClickListener;
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
/** Abstract music interface object class. */
|
|
1481
1748
|
declare abstract class MusicInterface {
|
|
1482
1749
|
readonly name: string;
|
|
1750
|
+
/**
|
|
1751
|
+
* Create new music interface object.
|
|
1752
|
+
* @param name - OBject name.
|
|
1753
|
+
*/
|
|
1483
1754
|
constructor(name: string);
|
|
1484
1755
|
/** @internal */
|
|
1485
1756
|
abstract getMusicObject(): MusicObject;
|
|
1757
|
+
/**
|
|
1758
|
+
* Get parent object.
|
|
1759
|
+
* @returns - Parent object or undefined.
|
|
1760
|
+
*/
|
|
1486
1761
|
getParent(): MusicInterface | undefined;
|
|
1487
1762
|
}
|
|
1763
|
+
/** Accidental object. */
|
|
1488
1764
|
declare class MAccidental extends MusicInterface {
|
|
1489
1765
|
private readonly obj;
|
|
1766
|
+
/** Object name. */
|
|
1490
1767
|
static readonly Name = "Accidental";
|
|
1491
1768
|
/** @internal */
|
|
1492
1769
|
constructor(obj: ObjAccidental);
|
|
1493
1770
|
/** @internal */
|
|
1494
1771
|
getMusicObject(): ObjAccidental;
|
|
1772
|
+
/**
|
|
1773
|
+
* Get accidental.
|
|
1774
|
+
* @returns - Accidental (e.g. 1 = #).
|
|
1775
|
+
*/
|
|
1495
1776
|
getAccidental(): Accidental;
|
|
1496
1777
|
}
|
|
1778
|
+
/** Connective object. */
|
|
1497
1779
|
declare class MConnective extends MusicInterface {
|
|
1498
1780
|
private readonly obj;
|
|
1781
|
+
/** Object name. */
|
|
1499
1782
|
static readonly Name = "Connective";
|
|
1500
1783
|
/** @internal */
|
|
1501
1784
|
constructor(obj: ObjConnective);
|
|
1502
1785
|
/** @internal */
|
|
1503
1786
|
getMusicObject(): ObjConnective;
|
|
1504
1787
|
}
|
|
1788
|
+
/** Arpeggio object. */
|
|
1505
1789
|
declare class MArpeggio extends MusicInterface {
|
|
1506
1790
|
private readonly obj;
|
|
1791
|
+
/** Object name. */
|
|
1507
1792
|
static readonly Name = "Arpeggio";
|
|
1508
1793
|
/** @internal */
|
|
1509
1794
|
constructor(obj: ObjArpeggio);
|
|
1510
1795
|
/** @internal */
|
|
1511
1796
|
getMusicObject(): ObjArpeggio;
|
|
1797
|
+
/**
|
|
1798
|
+
* Get rhythm column this arpeggio is in.
|
|
1799
|
+
* @returns - Rhythm column.
|
|
1800
|
+
*/
|
|
1512
1801
|
getRhythmColumn(): MRhythmColumn;
|
|
1802
|
+
/**
|
|
1803
|
+
* Get notation line this arpeggio is in.
|
|
1804
|
+
* @returns - Staff or tab object.
|
|
1805
|
+
*/
|
|
1513
1806
|
getNotationLine(): MStaff | MTab;
|
|
1514
1807
|
}
|
|
1808
|
+
/** Beam group object. */
|
|
1515
1809
|
declare class MBeamGroup extends MusicInterface {
|
|
1516
1810
|
private readonly obj;
|
|
1811
|
+
/** OBject name. */
|
|
1517
1812
|
static readonly Name = "BeamGroup";
|
|
1518
1813
|
/** @internal */
|
|
1519
1814
|
constructor(obj: ObjBeamGroup);
|
|
1520
1815
|
/** @internal */
|
|
1521
1816
|
getMusicObject(): ObjBeamGroup;
|
|
1522
1817
|
}
|
|
1818
|
+
/** Beam group object of certain staff. */
|
|
1523
1819
|
declare class MStaffBeamGroup extends MusicInterface {
|
|
1524
1820
|
private readonly obj;
|
|
1821
|
+
/** Object name. */
|
|
1525
1822
|
static readonly Name = "StaffBeamGroup";
|
|
1526
1823
|
/** @internal */
|
|
1527
1824
|
constructor(obj: ObjStaffBeamGroup);
|
|
1528
1825
|
/** @internal */
|
|
1529
1826
|
getMusicObject(): ObjStaffBeamGroup;
|
|
1827
|
+
/**
|
|
1828
|
+
* Get staff this beam group is in.
|
|
1829
|
+
* @returns - Staff object.
|
|
1830
|
+
*/
|
|
1530
1831
|
getStaff(): MStaff;
|
|
1531
1832
|
}
|
|
1833
|
+
/** Document object. */
|
|
1532
1834
|
declare class MDocument extends MusicInterface {
|
|
1533
1835
|
private readonly obj;
|
|
1836
|
+
/** Object name. */
|
|
1534
1837
|
static readonly Name = "Document";
|
|
1535
1838
|
/** @internal */
|
|
1536
1839
|
constructor(obj: ObjDocument);
|
|
1537
1840
|
/** @internal */
|
|
1538
1841
|
getMusicObject(): ObjDocument;
|
|
1842
|
+
/**
|
|
1843
|
+
* Get title.
|
|
1844
|
+
* @returns - Title string or undefined.
|
|
1845
|
+
*/
|
|
1539
1846
|
getTitle(): string | undefined;
|
|
1847
|
+
/**
|
|
1848
|
+
* Get composer.
|
|
1849
|
+
* @returns - Composer string or undefined.
|
|
1850
|
+
*/
|
|
1540
1851
|
getComposer(): string | undefined;
|
|
1852
|
+
/**
|
|
1853
|
+
* Get arranger.
|
|
1854
|
+
* @returns - Arranger string or undefined.
|
|
1855
|
+
*/
|
|
1541
1856
|
getArranger(): string | undefined;
|
|
1857
|
+
/**
|
|
1858
|
+
* Get score rows.
|
|
1859
|
+
* @returns - Array or score rows.
|
|
1860
|
+
*/
|
|
1542
1861
|
getRows(): ReadonlyArray<MScoreRow>;
|
|
1862
|
+
/**
|
|
1863
|
+
* Get measures.
|
|
1864
|
+
* @returns - Array of measures.
|
|
1865
|
+
*/
|
|
1543
1866
|
getMeasures(): ReadonlyArray<MMeasure>;
|
|
1544
|
-
|
|
1867
|
+
/**
|
|
1868
|
+
* Play this document.
|
|
1869
|
+
* @param playStateChangeListener - Play state change listener function or undefined.
|
|
1870
|
+
* @returns - Player instance.
|
|
1871
|
+
*/
|
|
1872
|
+
play(playStateChangeListener?: PlayStateChangeListener): MPlayer;
|
|
1545
1873
|
}
|
|
1874
|
+
/** Ending object. */
|
|
1546
1875
|
declare class MEnding extends MusicInterface {
|
|
1547
1876
|
private readonly obj;
|
|
1877
|
+
/** Object name. */
|
|
1548
1878
|
static readonly Name = "Ending";
|
|
1549
1879
|
/** @internal */
|
|
1550
1880
|
constructor(obj: ObjEnding);
|
|
1551
1881
|
/** @internal */
|
|
1552
1882
|
getMusicObject(): ObjEnding;
|
|
1883
|
+
/**
|
|
1884
|
+
* Get passages.
|
|
1885
|
+
* @returns - Array of passage numbers, e.g. passage number 1 means that this ending is played on first pass.
|
|
1886
|
+
*/
|
|
1553
1887
|
getPassages(): ReadonlyArray<number>;
|
|
1888
|
+
/**
|
|
1889
|
+
* Has passage number?
|
|
1890
|
+
* @param passage - Passage number to find out.
|
|
1891
|
+
* @returns - Boolean whether this ending has asked passage number.
|
|
1892
|
+
*/
|
|
1554
1893
|
hasPassage(passage: number): boolean;
|
|
1555
1894
|
}
|
|
1895
|
+
/** Fermata object. */
|
|
1556
1896
|
declare class MFermata extends MusicInterface {
|
|
1557
1897
|
private readonly obj;
|
|
1898
|
+
/** OBject name. */
|
|
1558
1899
|
static readonly Name = "Fermata";
|
|
1559
1900
|
/** @internal */
|
|
1560
1901
|
constructor(obj: ObjFermata);
|
|
1561
1902
|
/** @internal */
|
|
1562
1903
|
getMusicObject(): ObjFermata;
|
|
1563
1904
|
}
|
|
1905
|
+
/** Header object. */
|
|
1564
1906
|
declare class MHeader extends MusicInterface {
|
|
1565
1907
|
private readonly obj;
|
|
1908
|
+
/** OBject name. */
|
|
1566
1909
|
static readonly Name = "Header";
|
|
1567
1910
|
/** @internal */
|
|
1568
1911
|
constructor(obj: ObjHeader);
|
|
1569
1912
|
/** @internal */
|
|
1570
1913
|
getMusicObject(): ObjHeader;
|
|
1914
|
+
/**
|
|
1915
|
+
* Get title.
|
|
1916
|
+
* @returns - Title string or undefined.
|
|
1917
|
+
*/
|
|
1571
1918
|
getTitle(): string | undefined;
|
|
1919
|
+
/**
|
|
1920
|
+
* Get composer.
|
|
1921
|
+
* @returns - Composer string or undefined.
|
|
1922
|
+
*/
|
|
1572
1923
|
getComposer(): string | undefined;
|
|
1924
|
+
/**
|
|
1925
|
+
* Get arranger.
|
|
1926
|
+
* @returns - Arranger string or undefined.
|
|
1927
|
+
*/
|
|
1573
1928
|
getArranger(): string | undefined;
|
|
1574
1929
|
}
|
|
1930
|
+
/** Image object. */
|
|
1575
1931
|
declare class MImage extends MusicInterface {
|
|
1576
1932
|
private readonly obj;
|
|
1933
|
+
/** Object name. */
|
|
1577
1934
|
static readonly Name = "Image";
|
|
1578
1935
|
/** @internal */
|
|
1579
1936
|
constructor(obj: ObjImage);
|
|
1580
1937
|
/** @internal */
|
|
1581
1938
|
getMusicObject(): ObjImage;
|
|
1582
1939
|
}
|
|
1940
|
+
/** Measure object. */
|
|
1583
1941
|
declare class MMeasure extends MusicInterface {
|
|
1584
1942
|
private readonly obj;
|
|
1943
|
+
/** OBject name. */
|
|
1585
1944
|
static readonly Name = "Measure";
|
|
1586
1945
|
/** @internal */
|
|
1587
1946
|
constructor(obj: ObjMeasure);
|
|
1588
1947
|
/** @internal */
|
|
1589
1948
|
getMusicObject(): ObjMeasure;
|
|
1949
|
+
/**
|
|
1950
|
+
* Get measure number.
|
|
1951
|
+
* @returns - Measure number starting from 1, or 0 if upbeat.
|
|
1952
|
+
*/
|
|
1590
1953
|
getMeasureNumber(): number;
|
|
1954
|
+
/**
|
|
1955
|
+
* Get rhythm columns.
|
|
1956
|
+
* @returns - Array of rhythm columns.
|
|
1957
|
+
*/
|
|
1591
1958
|
getRhythmColumns(): ReadonlyArray<MRhythmColumn>;
|
|
1959
|
+
/**
|
|
1960
|
+
* Get score row that this measure is in.
|
|
1961
|
+
* @returns - Score row.
|
|
1962
|
+
*/
|
|
1592
1963
|
getRow(): MScoreRow;
|
|
1593
1964
|
}
|
|
1965
|
+
/** Right bar line object. */
|
|
1594
1966
|
declare class MBarLineRight extends MusicInterface {
|
|
1595
1967
|
private readonly obj;
|
|
1968
|
+
/** OBject name. */
|
|
1596
1969
|
static readonly Name = "BarLineRight";
|
|
1597
1970
|
/** @internal */
|
|
1598
1971
|
constructor(obj: ObjBarLineRight);
|
|
1599
1972
|
/** @internal */
|
|
1600
1973
|
getMusicObject(): ObjBarLineRight;
|
|
1601
1974
|
}
|
|
1975
|
+
/** Left bar line object. */
|
|
1602
1976
|
declare class MBarLineLeft extends MusicInterface {
|
|
1603
1977
|
private readonly obj;
|
|
1978
|
+
/** Object name. */
|
|
1604
1979
|
static readonly Name = "BarLineLeft";
|
|
1605
1980
|
/** @internal */
|
|
1606
1981
|
constructor(obj: ObjBarLineLeft);
|
|
1607
1982
|
/** @internal */
|
|
1608
1983
|
getMusicObject(): ObjBarLineLeft;
|
|
1609
1984
|
}
|
|
1985
|
+
/** Bar line object for certain staff or tab. */
|
|
1610
1986
|
declare class MStaffTabBarLine extends MusicInterface {
|
|
1611
1987
|
private readonly obj;
|
|
1988
|
+
/** Object name. */
|
|
1612
1989
|
static readonly Name = "StaffTabBarLine";
|
|
1613
1990
|
/** @internal */
|
|
1614
1991
|
constructor(obj: ObjStaffTabBarLine);
|
|
1615
1992
|
/** @internal */
|
|
1616
1993
|
getMusicObject(): ObjStaffTabBarLine;
|
|
1994
|
+
/**
|
|
1995
|
+
* Get parent bar line object.
|
|
1996
|
+
* @returns - Parent bar line object.
|
|
1997
|
+
*/
|
|
1617
1998
|
getBarLine(): MBarLineLeft | MBarLineRight;
|
|
1999
|
+
/**
|
|
2000
|
+
* Get staff or tab this bar lien object is in.
|
|
2001
|
+
* @returns - Staff or tab.
|
|
2002
|
+
*/
|
|
1618
2003
|
getNotationLine(): MStaff | MTab;
|
|
1619
2004
|
}
|
|
2005
|
+
/** Note group object. */
|
|
1620
2006
|
declare class MNoteGroup extends MusicInterface {
|
|
1621
2007
|
private readonly obj;
|
|
2008
|
+
/** Object name. */
|
|
1622
2009
|
static readonly Name = "NoteGroup";
|
|
1623
2010
|
/** @internal */
|
|
1624
2011
|
constructor(obj: ObjNoteGroup);
|
|
1625
2012
|
/** @internal */
|
|
1626
2013
|
getMusicObject(): ObjNoteGroup;
|
|
2014
|
+
/**
|
|
2015
|
+
* Get notes of this note group.
|
|
2016
|
+
* @returns - Array of Note instances.
|
|
2017
|
+
*/
|
|
1627
2018
|
getNotes(): ReadonlyArray<Note>;
|
|
2019
|
+
/**
|
|
2020
|
+
* Get rhythm props of this note group.
|
|
2021
|
+
* @returns - Rhythm props.
|
|
2022
|
+
*/
|
|
1628
2023
|
getRhythmProps(): RhythmProps;
|
|
2024
|
+
/**
|
|
2025
|
+
* Get rhythm column this note group is in.
|
|
2026
|
+
* @returns - Rhythm column.
|
|
2027
|
+
*/
|
|
1629
2028
|
getRhythmColumn(): MRhythmColumn;
|
|
2029
|
+
/**
|
|
2030
|
+
* Get the measure this note group is in.
|
|
2031
|
+
* @returns - Measure.
|
|
2032
|
+
*/
|
|
1630
2033
|
getMeasure(): MMeasure;
|
|
1631
2034
|
}
|
|
2035
|
+
/** Note group object of certain staff. */
|
|
1632
2036
|
declare class MStaffNoteGroup extends MusicInterface {
|
|
1633
2037
|
private readonly obj;
|
|
2038
|
+
/** Object name. */
|
|
1634
2039
|
static readonly Name = "StaffNoteGroup";
|
|
1635
2040
|
/** @internal */
|
|
1636
2041
|
constructor(obj: ObjStaffNoteGroup);
|
|
1637
2042
|
/** @internal */
|
|
1638
2043
|
getMusicObject(): ObjStaffNoteGroup;
|
|
2044
|
+
/**
|
|
2045
|
+
* Get parent note group.
|
|
2046
|
+
* @returns - Parent note group.
|
|
2047
|
+
*/
|
|
1639
2048
|
getNoteGroup(): MNoteGroup;
|
|
2049
|
+
/**
|
|
2050
|
+
* Get rhythm column this note group is in.
|
|
2051
|
+
* @returns - Rhythm column.
|
|
2052
|
+
*/
|
|
1640
2053
|
getRhythmColumn(): MRhythmColumn;
|
|
2054
|
+
/**
|
|
2055
|
+
* Get the measure this note group is in.
|
|
2056
|
+
* @returns - Measure.
|
|
2057
|
+
*/
|
|
1641
2058
|
getMeasure(): MMeasure;
|
|
2059
|
+
/**
|
|
2060
|
+
* Get staff notation line this note group is in.
|
|
2061
|
+
* @returns - Staff object.
|
|
2062
|
+
*/
|
|
1642
2063
|
getStaff(): MStaff;
|
|
1643
2064
|
}
|
|
2065
|
+
/** Note group object of certain tab. Contains fret numbers for tab. */
|
|
1644
2066
|
declare class MTabNoteGroup extends MusicInterface {
|
|
1645
2067
|
private readonly obj;
|
|
2068
|
+
/** OBject name. */
|
|
1646
2069
|
static readonly Name = "TabNoteGroup";
|
|
1647
2070
|
/** @internal */
|
|
1648
2071
|
constructor(obj: ObjTabNoteGroup);
|
|
1649
2072
|
/** @internal */
|
|
1650
2073
|
getMusicObject(): ObjTabNoteGroup;
|
|
2074
|
+
/**
|
|
2075
|
+
* Get parent note group.
|
|
2076
|
+
* @returns - Parent note group.
|
|
2077
|
+
*/
|
|
1651
2078
|
getNoteGroup(): MNoteGroup;
|
|
2079
|
+
/**
|
|
2080
|
+
* Get rhythm column this note group is in.
|
|
2081
|
+
* @returns - Rhythm column.
|
|
2082
|
+
*/
|
|
1652
2083
|
getRhythmColumn(): MRhythmColumn;
|
|
2084
|
+
/**
|
|
2085
|
+
* Get the measure this note group is in.
|
|
2086
|
+
* @returns - Measure.
|
|
2087
|
+
*/
|
|
1653
2088
|
getMeasure(): MMeasure;
|
|
2089
|
+
/**
|
|
2090
|
+
* Get guitar tab this note group is in.
|
|
2091
|
+
* @returns - Tab object.
|
|
2092
|
+
*/
|
|
1654
2093
|
getTab(): MTab;
|
|
1655
2094
|
}
|
|
2095
|
+
/** Rest object. */
|
|
1656
2096
|
declare class MRest extends MusicInterface {
|
|
1657
2097
|
private readonly obj;
|
|
2098
|
+
/** OBject name. */
|
|
1658
2099
|
static readonly Name = "Rest";
|
|
1659
2100
|
/** @internal */
|
|
1660
2101
|
constructor(obj: ObjRest);
|
|
1661
2102
|
/** @internal */
|
|
1662
2103
|
getMusicObject(): ObjRest;
|
|
2104
|
+
/**
|
|
2105
|
+
* Get rhythm props of this rest.
|
|
2106
|
+
* @returns - Rhythm props.
|
|
2107
|
+
*/
|
|
1663
2108
|
getRhythmProps(): RhythmProps;
|
|
2109
|
+
/**
|
|
2110
|
+
* Get rhythm column this rest is in.
|
|
2111
|
+
* @returns - Rhythm column.
|
|
2112
|
+
*/
|
|
1664
2113
|
getRhythmColumn(): MRhythmColumn;
|
|
2114
|
+
/**
|
|
2115
|
+
* Get the measure this rest is in.
|
|
2116
|
+
* @returns - Measure.
|
|
2117
|
+
*/
|
|
1665
2118
|
getMeasure(): MMeasure;
|
|
1666
2119
|
}
|
|
2120
|
+
/** Rest object for certain tab. */
|
|
1667
2121
|
declare class MStaffRest extends MusicInterface {
|
|
1668
2122
|
private readonly obj;
|
|
2123
|
+
/** Object name. */
|
|
1669
2124
|
static readonly Name = "StaffRest";
|
|
1670
2125
|
/** @internal */
|
|
1671
2126
|
constructor(obj: ObjStaffRest);
|
|
1672
2127
|
/** @internal */
|
|
1673
2128
|
getMusicObject(): ObjStaffRest;
|
|
2129
|
+
/**
|
|
2130
|
+
* Get parent rest object.
|
|
2131
|
+
* @returns - Parent rest object.
|
|
2132
|
+
*/
|
|
1674
2133
|
getRest(): MRest;
|
|
2134
|
+
/**
|
|
2135
|
+
* Get rhythm column this rest is in.
|
|
2136
|
+
* @returns - Rhythm column.
|
|
2137
|
+
*/
|
|
1675
2138
|
getRhythmColumn(): MRhythmColumn;
|
|
2139
|
+
/**
|
|
2140
|
+
* Get the measure this rest is in.
|
|
2141
|
+
* @returns - Measure.
|
|
2142
|
+
*/
|
|
1676
2143
|
getMeasure(): MMeasure;
|
|
2144
|
+
/**
|
|
2145
|
+
* Get staff notation line this rest is in.
|
|
2146
|
+
* @returns - Staff object.
|
|
2147
|
+
*/
|
|
1677
2148
|
getStaff(): MStaff;
|
|
1678
2149
|
}
|
|
2150
|
+
/** Rhythm column object. */
|
|
1679
2151
|
declare class MRhythmColumn extends MusicInterface {
|
|
1680
2152
|
private readonly obj;
|
|
2153
|
+
/** OBject name. */
|
|
1681
2154
|
static readonly Name = "RhythmColumn";
|
|
1682
2155
|
/** @internal */
|
|
1683
2156
|
constructor(obj: ObjRhythmColumn);
|
|
1684
2157
|
/** @internal */
|
|
1685
2158
|
getMusicObject(): ObjRhythmColumn;
|
|
2159
|
+
/**
|
|
2160
|
+
* Get symbol (note group or rest) of this column for given voice id.
|
|
2161
|
+
* @param voiceId - Voice id.
|
|
2162
|
+
* @returns - Note group, rest or undefined.
|
|
2163
|
+
*/
|
|
1686
2164
|
getRhythmSymbol(voiceId: number): MNoteGroup | MRest | undefined;
|
|
1687
|
-
|
|
2165
|
+
/**
|
|
2166
|
+
* Get symbol (note group or rest) of this column for given voice id.
|
|
2167
|
+
* @deprecated - Use getRhythmSymbol(voiceId) instead.
|
|
2168
|
+
* @param voiceId - Voice id.
|
|
2169
|
+
* @returns - Note group, rest or undefined.
|
|
2170
|
+
*/
|
|
1688
2171
|
getVoiceSymbol(voiceId: VoiceId): MNoteGroup | MRest | undefined;
|
|
2172
|
+
/**
|
|
2173
|
+
* Get the measure this rhythm column is in.
|
|
2174
|
+
* @returns - Measure.
|
|
2175
|
+
*/
|
|
2176
|
+
getMeasure(): MMeasure;
|
|
1689
2177
|
}
|
|
2178
|
+
/** Score row object. */
|
|
1690
2179
|
declare class MScoreRow extends MusicInterface {
|
|
1691
2180
|
private readonly obj;
|
|
2181
|
+
/** Object name. */
|
|
1692
2182
|
static readonly Name = "ScoreRow";
|
|
1693
2183
|
/** @internal */
|
|
1694
2184
|
constructor(obj: ObjScoreRow);
|
|
1695
2185
|
/** @internal */
|
|
1696
2186
|
getMusicObject(): ObjScoreRow;
|
|
2187
|
+
/**
|
|
2188
|
+
* Parent music document.
|
|
2189
|
+
* @returns - Parent music document.
|
|
2190
|
+
*/
|
|
1697
2191
|
getDocument(): MDocument;
|
|
2192
|
+
/**
|
|
2193
|
+
* Get measures of this score row.
|
|
2194
|
+
* @returns - Array of measures.
|
|
2195
|
+
*/
|
|
1698
2196
|
getMeasures(): ReadonlyArray<MMeasure>;
|
|
2197
|
+
/**
|
|
2198
|
+
* Get notation lines (staves and tabs) of this score row.
|
|
2199
|
+
* @returns - Array of staves and tabs.
|
|
2200
|
+
*/
|
|
1699
2201
|
getNotationLines(): ReadonlyArray<MStaff | MTab>;
|
|
1700
2202
|
}
|
|
2203
|
+
/** Staff notatio line object. */
|
|
1701
2204
|
declare class MStaff extends MusicInterface {
|
|
1702
2205
|
private readonly obj;
|
|
2206
|
+
/** Object name. */
|
|
1703
2207
|
static readonly Name = "Staff";
|
|
1704
2208
|
/** @internal */
|
|
1705
2209
|
constructor(obj: ObjStaff);
|
|
1706
2210
|
/** @internal */
|
|
1707
2211
|
getMusicObject(): ObjStaff;
|
|
2212
|
+
/**
|
|
2213
|
+
* Get index of this staff in score row.
|
|
2214
|
+
* @returns - Index (0=top notation line).
|
|
2215
|
+
*/
|
|
1708
2216
|
getId(): number;
|
|
2217
|
+
/**
|
|
2218
|
+
* Get name of this staff.
|
|
2219
|
+
* @returns - Staff name.
|
|
2220
|
+
*/
|
|
1709
2221
|
getName(): string | undefined;
|
|
2222
|
+
/**
|
|
2223
|
+
* Get the score row this staff is in.
|
|
2224
|
+
* @returns - Score row.
|
|
2225
|
+
*/
|
|
1710
2226
|
getRow(): MScoreRow;
|
|
1711
2227
|
}
|
|
2228
|
+
/** Guitar tab notation line object. */
|
|
1712
2229
|
declare class MTab extends MusicInterface {
|
|
1713
2230
|
private readonly obj;
|
|
2231
|
+
/** Object name. */
|
|
1714
2232
|
static readonly Name = "Tab";
|
|
1715
2233
|
/** @internal */
|
|
1716
2234
|
constructor(obj: ObjTab);
|
|
1717
2235
|
/** @internal */
|
|
1718
2236
|
getMusicObject(): ObjTab;
|
|
2237
|
+
/**
|
|
2238
|
+
* Get index of this guitar tab in score row.
|
|
2239
|
+
* @returns - Index (0=top notation line).
|
|
2240
|
+
*/
|
|
1719
2241
|
getId(): number;
|
|
2242
|
+
/**
|
|
2243
|
+
* Get name of this guitar tab.
|
|
2244
|
+
* @returns - Staff name.
|
|
2245
|
+
*/
|
|
1720
2246
|
getName(): string | undefined;
|
|
2247
|
+
/**
|
|
2248
|
+
* Get the score row this guitar tab is in.
|
|
2249
|
+
* @returns - Score row.
|
|
2250
|
+
*/
|
|
1721
2251
|
getRow(): MScoreRow;
|
|
1722
2252
|
}
|
|
2253
|
+
/** Signature object contains clef, key signature, time signature and tempo, all optional depending on measure. */
|
|
1723
2254
|
declare class MSignature extends MusicInterface {
|
|
1724
2255
|
private readonly obj;
|
|
2256
|
+
/** Object name. */
|
|
1725
2257
|
static readonly Name = "Signature";
|
|
1726
2258
|
/** @internal */
|
|
1727
2259
|
constructor(obj: ObjSignature);
|
|
1728
2260
|
/** @internal */
|
|
1729
2261
|
getMusicObject(): ObjSignature;
|
|
2262
|
+
/**
|
|
2263
|
+
* Get staff notation line this signature is in.
|
|
2264
|
+
* @returns - Staff object.
|
|
2265
|
+
*/
|
|
1730
2266
|
getStaff(): MStaff;
|
|
1731
2267
|
}
|
|
2268
|
+
/** Spacial text object contains text and possibly special symbols (e.g. Segno or Coda). */
|
|
1732
2269
|
declare class MSpecialText extends MusicInterface {
|
|
1733
2270
|
private readonly obj;
|
|
2271
|
+
/** Object name. */
|
|
1734
2272
|
static readonly Name = "SpecialText";
|
|
1735
2273
|
/** @internal */
|
|
1736
2274
|
constructor(obj: ObjSpecialText);
|
|
1737
2275
|
/** @internal */
|
|
1738
2276
|
getMusicObject(): ObjSpecialText;
|
|
2277
|
+
/**
|
|
2278
|
+
* Get text content.
|
|
2279
|
+
* @returns - Text content.
|
|
2280
|
+
*/
|
|
1739
2281
|
getText(): string;
|
|
1740
2282
|
}
|
|
2283
|
+
/** Text object. */
|
|
1741
2284
|
declare class MText extends MusicInterface {
|
|
1742
2285
|
private readonly obj;
|
|
2286
|
+
/** Object name. */
|
|
1743
2287
|
static readonly Name = "Text";
|
|
1744
2288
|
/** @internal */
|
|
1745
2289
|
constructor(obj: ObjText);
|
|
1746
2290
|
/** @internal */
|
|
1747
2291
|
getMusicObject(): ObjText;
|
|
2292
|
+
/**
|
|
2293
|
+
* Get text content.
|
|
2294
|
+
* @returns - Text content.
|
|
2295
|
+
*/
|
|
1748
2296
|
getText(): string;
|
|
1749
2297
|
}
|
|
2298
|
+
/** Extension line object. */
|
|
1750
2299
|
declare class MExtensionLine extends MusicInterface {
|
|
1751
2300
|
private readonly obj;
|
|
2301
|
+
/** OBject name. */
|
|
1752
2302
|
static readonly Name = "ExtensionLine";
|
|
1753
2303
|
/** @internal */
|
|
1754
2304
|
constructor(obj: ObjExtensionLine);
|
|
1755
2305
|
/** @internal */
|
|
1756
2306
|
getMusicObject(): ObjExtensionLine;
|
|
1757
2307
|
}
|
|
1758
|
-
declare class MPlayer {
|
|
1759
|
-
private static currentlyPlaying;
|
|
1760
|
-
private readonly player;
|
|
1761
|
-
constructor(doc: MDocument, fn?: PlayStateChangeListener);
|
|
1762
|
-
static stopAll(): void;
|
|
1763
|
-
play(): this;
|
|
1764
|
-
pause(): this;
|
|
1765
|
-
stop(): this;
|
|
1766
|
-
}
|
|
1767
|
-
declare class MRenderer {
|
|
1768
|
-
private readonly renderer;
|
|
1769
|
-
constructor();
|
|
1770
|
-
setDocument(doc?: MDocument): this;
|
|
1771
|
-
setCanvas(canvas: HTMLCanvasElement | string): this;
|
|
1772
|
-
setScoreEventListener(fn: ScoreEventListener): void;
|
|
1773
|
-
hilightObject(obj?: MusicInterface): void;
|
|
1774
|
-
hilightStaffPos(staffPos?: {
|
|
1775
|
-
scoreRow: MScoreRow;
|
|
1776
|
-
diatonicId: number;
|
|
1777
|
-
}): void;
|
|
1778
|
-
draw(): void;
|
|
1779
|
-
}
|
|
1780
|
-
declare class MPlaybackButtons {
|
|
1781
|
-
private playButton?;
|
|
1782
|
-
private stopButton?;
|
|
1783
|
-
private playStopButton?;
|
|
1784
|
-
private pauseButton?;
|
|
1785
|
-
private onPlay;
|
|
1786
|
-
private onStop;
|
|
1787
|
-
private onPlayStop;
|
|
1788
|
-
private onPause;
|
|
1789
|
-
private playLabel;
|
|
1790
|
-
private stopLabel;
|
|
1791
|
-
private pauseLabel;
|
|
1792
|
-
private playState;
|
|
1793
|
-
private player?;
|
|
1794
|
-
constructor();
|
|
1795
|
-
setDocument(doc?: MDocument): this;
|
|
1796
|
-
detachDocument(): void;
|
|
1797
|
-
private updateButtons;
|
|
1798
|
-
setPlayButton(btn: HTMLButtonElement | string, btnLabel?: string): this;
|
|
1799
|
-
setStopButton(btn: HTMLButtonElement | string, btnLabel?: string): this;
|
|
1800
|
-
setPlayStopButton(btn: HTMLButtonElement | string, playLabel?: string, stopLabel?: string): this;
|
|
1801
|
-
setPauseButton(btn: HTMLButtonElement | string, btnLabel?: string): this;
|
|
1802
|
-
private static savedOnClickListeners;
|
|
1803
|
-
private static removeOnClickListeners;
|
|
1804
|
-
private static addOnClickListener;
|
|
1805
|
-
}
|
|
1806
2308
|
|
|
1807
|
-
export {
|
|
2309
|
+
export { Clef as $, type AnnotationText as A, MBarLineRight as B, Connective as C, DivRect as D, MBarLineLeft as E, Fermata as F, MStaffTabBarLine as G, MNoteGroup as H, MStaffNoteGroup as I, MTabNoteGroup as J, MRest as K, Label as L, MDocument as M, type NoteOptions as N, MStaffRest as O, MRhythmColumn as P, MScoreRow as Q, type RestOptions as R, StaffPreset as S, type TupletOptions as T, MStaff as U, type VoiceId as V, MTab as W, MSignature as X, MSpecialText as Y, MText as Z, MExtensionLine as _, type ScoreConfiguration as a, type StaffConfig as a0, type TabConfig as a1, getVoiceIds as a2, type StringNumber as a3, getStringNumbers as a4, Stem as a5, Arpeggio as a6, type StaffTabOrGroup as a7, DynamicsAnnotation as a8, TempoAnnotation as a9, PlayState as aa, type PlayStateChangeListener as ab, type StaffTabOrGroups as b, Navigation as c, Annotation as d, TieType as e, NoteAnchor as f, VerticalPosition as g, type ScoreEventType as h, ScoreEvent as i, ScoreStaffPosEvent as j, ScoreObjectEvent as k, type ScoreEventListener as l, MPlayer as m, MRenderer as n, MPlaybackButtons as o, MusicInterface as p, MAccidental as q, MConnective as r, MArpeggio as s, MBeamGroup as t, MStaffBeamGroup as u, MEnding as v, MFermata as w, MHeader as x, MImage as y, MMeasure as z };
|