web-music-score 0.0.1 → 6.0.0-pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +200 -0
- package/LICENSE +62 -1
- package/README.md +46 -2
- package/dist/audio/index.d.ts +50 -0
- package/dist/audio/index.js +1858 -0
- package/dist/audio/index.mjs +92 -0
- package/dist/audio-cg/index.d.ts +21 -0
- package/dist/audio-cg/index.js +17568 -0
- package/dist/audio-cg/index.mjs +90 -0
- package/dist/audio-synth/index.d.ts +15 -0
- package/dist/audio-synth/index.js +18497 -0
- package/dist/audio-synth/index.mjs +63 -0
- package/dist/chunk-A7C2G7OG.mjs +101 -0
- package/dist/chunk-GNT3ECDB.mjs +267 -0
- package/dist/chunk-LO4NI4AU.mjs +18381 -0
- package/dist/chunk-PW2SO6EZ.mjs +37 -0
- package/dist/chunk-VHB57TXT.mjs +11 -0
- package/dist/chunk-X7BMJX7E.mjs +3867 -0
- package/dist/core/index.d.ts +31 -0
- package/dist/core/index.js +74 -0
- package/dist/core/index.mjs +22 -0
- package/dist/iife/audio-cg.global.js +220 -0
- package/dist/iife/index.global.js +228 -0
- package/dist/instrument-DS-9C6_8.d.ts +44 -0
- package/dist/music-objects-DLmp5uL6.d.ts +2398 -0
- package/dist/note-RVXvpfyV.d.ts +306 -0
- package/dist/pieces/index.d.ts +46 -0
- package/dist/pieces/index.js +79 -0
- package/dist/pieces/index.mjs +50 -0
- package/dist/react-ui/index.d.ts +86 -0
- package/dist/react-ui/index.js +132 -0
- package/dist/react-ui/index.mjs +96 -0
- package/dist/scale-B1M10_fu.d.ts +230 -0
- package/dist/score/index.d.ts +466 -0
- package/dist/score/index.js +13964 -0
- package/dist/score/index.mjs +10092 -0
- package/dist/tempo-D-JF-8b_.d.ts +409 -0
- package/dist/theory/index.d.ts +78 -0
- package/dist/theory/index.js +4842 -0
- package/dist/theory/index.mjs +1986 -0
- package/package.json +131 -3
- package/workspace.code-workspace +0 -9
|
@@ -0,0 +1,2398 @@
|
|
|
1
|
+
import { N as Note, A as Accidental } from './note-RVXvpfyV.js';
|
|
2
|
+
import { R as RhythmProps, N as NoteLength, h as NoteLengthStr, k as TupletRatio, c as Tempo, K as KeySignature, a as TimeSignature } from './tempo-D-JF-8b_.js';
|
|
3
|
+
import { AnchoredRect, UniMap, Rect, Vec } from '@tspro/ts-utils-lib';
|
|
4
|
+
|
|
5
|
+
/** Staff preset values for score configuration. */
|
|
6
|
+
declare enum StaffPreset {
|
|
7
|
+
/** Treble staff has treble (G-) clef. */
|
|
8
|
+
Treble = "treble",
|
|
9
|
+
/** Bass staff has bass (F-) clef. */
|
|
10
|
+
Bass = "bass",
|
|
11
|
+
/** Grand staff has both treble and bass clefs. */
|
|
12
|
+
Grand = "grand",
|
|
13
|
+
/** GuitarTreble has treble clef but is one octave lower. */
|
|
14
|
+
GuitarTreble = "guitarTreble",
|
|
15
|
+
/** GuitarTab has tab for guitar. */
|
|
16
|
+
GuitarTab = "guitarTab",
|
|
17
|
+
/** GuitarCombined has treble clef and tab for guitar. */
|
|
18
|
+
GuitarCombined = "guitarCombined"
|
|
19
|
+
}
|
|
20
|
+
/** Clef for staff notation lines. */
|
|
21
|
+
declare enum Clef {
|
|
22
|
+
/** G-clef (treble cleff) */
|
|
23
|
+
G = "G",
|
|
24
|
+
/** F-clef (bass cleff) */
|
|
25
|
+
F = "F"
|
|
26
|
+
}
|
|
27
|
+
/** Base config for staff and tab configs. */
|
|
28
|
+
type BaseConfig = {
|
|
29
|
+
/** Name for this staff/tab config. */
|
|
30
|
+
name?: string;
|
|
31
|
+
/** Voice id that is presented in this staff/tab. Single value or array.*/
|
|
32
|
+
voiceId?: VoiceId | VoiceId[];
|
|
33
|
+
/**
|
|
34
|
+
* Instrument name for this staf/tab.<br />
|
|
35
|
+
* Consecutive staves/tabs with the same name are grouped together.<br />
|
|
36
|
+
* Hint!<br />
|
|
37
|
+
* `"!Piano"` hides name.<br />
|
|
38
|
+
* `"!{Piano"` hides both name and left brace of the group.
|
|
39
|
+
* */
|
|
40
|
+
instrument?: string;
|
|
41
|
+
};
|
|
42
|
+
/** Staff config to add staff notation line in score configuration. */
|
|
43
|
+
type StaffConfig = BaseConfig & {
|
|
44
|
+
/** Config type, must be "staff" for staff config. */
|
|
45
|
+
type: "staff";
|
|
46
|
+
/** G-clef or F-clef for this staff config? */
|
|
47
|
+
clef: Clef | `${Clef}`;
|
|
48
|
+
/** Set octave down with G-clef for guitar treble staff notation line. */
|
|
49
|
+
isOctaveDown?: boolean;
|
|
50
|
+
/** Lowest note (e.g. "C2")that can be presented in this staff notation line. */
|
|
51
|
+
minNote?: string;
|
|
52
|
+
/** Highest note (e.g. "C6") that can be presented in this staff notation line. */
|
|
53
|
+
maxNote?: string;
|
|
54
|
+
/**
|
|
55
|
+
* To create grand staff: use same `grandId` value (e.g. "grand1") for two
|
|
56
|
+
* consequtive staves, first having G-clef and second having F-clef.
|
|
57
|
+
*/
|
|
58
|
+
grandId?: string;
|
|
59
|
+
};
|
|
60
|
+
/** Tab config to add guitar tab in score configuration. */
|
|
61
|
+
type TabConfig = BaseConfig & {
|
|
62
|
+
/** Config type, must be "tab" for tab config. */
|
|
63
|
+
type: "tab";
|
|
64
|
+
/** Tuning name or array six notes (tune for each string). */
|
|
65
|
+
tuning?: string | string[];
|
|
66
|
+
};
|
|
67
|
+
/** Score configuration. */
|
|
68
|
+
type ScoreConfiguration = StaffConfig | TabConfig | (StaffConfig | TabConfig)[];
|
|
69
|
+
/** Voice id. */
|
|
70
|
+
type VoiceId = 0 | 1 | 2 | 3;
|
|
71
|
+
/** Get supported voice ids. Returns [0, 1, 2, 3]. */
|
|
72
|
+
declare function getVoiceIds(): ReadonlyArray<VoiceId>;
|
|
73
|
+
declare function isVoiceId(voiceId: unknown): voiceId is VoiceId;
|
|
74
|
+
declare function validateVoiceId(voiceId: unknown): VoiceId;
|
|
75
|
+
/** Strng number. */
|
|
76
|
+
type StringNumber = 1 | 2 | 3 | 4 | 5 | 6;
|
|
77
|
+
/** Get string numbers. Returns [0, 1, 2, 3, 4, 5]. */
|
|
78
|
+
declare function getStringNumbers(): ReadonlyArray<StringNumber>;
|
|
79
|
+
declare function isStringNumber(stringNum: unknown): stringNum is VerseNumber;
|
|
80
|
+
declare function validateStringNumber(stringNum: unknown): VerseNumber;
|
|
81
|
+
/** Verse number. */
|
|
82
|
+
type VerseNumber = 1 | 2 | 3;
|
|
83
|
+
/** Get supported verse numbers. Returns [1, 2, 3]. */
|
|
84
|
+
declare function getVerseNumbers(): ReadonlyArray<VerseNumber>;
|
|
85
|
+
declare function isVerseNumber(verse: unknown): verse is VerseNumber;
|
|
86
|
+
declare function validateVerseNumber(verseNum: unknown): VerseNumber;
|
|
87
|
+
/** Stem direction enum. */
|
|
88
|
+
declare enum Stem {
|
|
89
|
+
/** Auto stem direction. */
|
|
90
|
+
Auto = "auto",
|
|
91
|
+
/** Stem is upwards. */
|
|
92
|
+
Up = "up",
|
|
93
|
+
/** Stm is downwards. */
|
|
94
|
+
Down = "down"
|
|
95
|
+
}
|
|
96
|
+
/** Arpeggio direction enum. */
|
|
97
|
+
declare enum Arpeggio {
|
|
98
|
+
/** Upwards, chord played from lowes to highest. */
|
|
99
|
+
Up = "up",
|
|
100
|
+
/** Downwards, chord played from highest to loest. */
|
|
101
|
+
Down = "down"
|
|
102
|
+
}
|
|
103
|
+
/** Special tie length enum. */
|
|
104
|
+
declare enum TieType {
|
|
105
|
+
/** Stub tie is short tie that left anchors to note and has not right anchor point. */
|
|
106
|
+
Stub = "stub",
|
|
107
|
+
/** To measure end tie is tie that left anchors to note and right anchors to measure end. */
|
|
108
|
+
ToMeasureEnd = "toMeasureEnd"
|
|
109
|
+
}
|
|
110
|
+
/** Anchor point enum for connectives (ties, slurs, slides). */
|
|
111
|
+
declare enum NoteAnchor {
|
|
112
|
+
/** Automatically choose anchor point using simple logic. */
|
|
113
|
+
Auto = "auto",
|
|
114
|
+
/** Anchor connective above note head. */
|
|
115
|
+
Above = "above",
|
|
116
|
+
/** Anchor connective center/next to note head.*/
|
|
117
|
+
Center = "center",
|
|
118
|
+
/** Anchor connective below note head. */
|
|
119
|
+
Below = "below",
|
|
120
|
+
/** Anchor connective to stem tip. */
|
|
121
|
+
StemTip = "stemTip"
|
|
122
|
+
}
|
|
123
|
+
/** Connective enum. */
|
|
124
|
+
declare enum Connective {
|
|
125
|
+
/** Tie, connects two or more adjacent notes of same pitch with arc. */
|
|
126
|
+
Tie = "tie",
|
|
127
|
+
/** Slur, connects two or more adjacent notes of different pitch with arc. */
|
|
128
|
+
Slur = "slur",
|
|
129
|
+
/** Slide, connects two adjacent notes of different pitch with straight line. */
|
|
130
|
+
Slide = "slide"
|
|
131
|
+
}
|
|
132
|
+
/** Vertical position enum used to layout notation elements. */
|
|
133
|
+
declare enum VerticalPosition {
|
|
134
|
+
/** Automatic/default layout position depending on element. */
|
|
135
|
+
Auto = "auto",
|
|
136
|
+
/** Add element above staff/tab. */
|
|
137
|
+
Above = "above",
|
|
138
|
+
/** Add element below staff/tab. */
|
|
139
|
+
Below = "below",
|
|
140
|
+
/** Add element both above and below staff/tab. */
|
|
141
|
+
Both = "both"
|
|
142
|
+
}
|
|
143
|
+
/** Staff/tab/group type can be staff/tab index or staff/tab/group name. */
|
|
144
|
+
type StaffTabOrGroup = number | string;
|
|
145
|
+
/** Staff/tab/group snglevalue or array of values. */
|
|
146
|
+
type StaffTabOrGroups = StaffTabOrGroup | StaffTabOrGroup[];
|
|
147
|
+
/** Measure options. */
|
|
148
|
+
type MeasureOptions = {
|
|
149
|
+
/** show measure number? */
|
|
150
|
+
showNumber?: boolean;
|
|
151
|
+
};
|
|
152
|
+
/** Options for notes/chords. */
|
|
153
|
+
type NoteOptions = {
|
|
154
|
+
/** Stem direction. */
|
|
155
|
+
stem?: Stem | `${Stem}`;
|
|
156
|
+
/** Set color. */
|
|
157
|
+
color?: string;
|
|
158
|
+
/** Arepggio direction for chords. true = "up". */
|
|
159
|
+
arpeggio?: boolean | Arpeggio | `${Arpeggio}`;
|
|
160
|
+
/** Add staccato dot. */
|
|
161
|
+
staccato?: boolean;
|
|
162
|
+
/** Use diamond shaped note head. */
|
|
163
|
+
diamond?: boolean;
|
|
164
|
+
/** Set string number (array of numbers for chord) to use in guitar tab. */
|
|
165
|
+
string?: StringNumber | StringNumber[];
|
|
166
|
+
};
|
|
167
|
+
/** Options for rests. */
|
|
168
|
+
type RestOptions = {
|
|
169
|
+
/** Set staff position for this rest. Can be instance of Note, string (e.g. "C3"), or midiNumber. */
|
|
170
|
+
staffPos?: Note | string | number;
|
|
171
|
+
/** Set color. */
|
|
172
|
+
color?: string;
|
|
173
|
+
/** Hide this rest, still affects playing. */
|
|
174
|
+
hide?: boolean;
|
|
175
|
+
};
|
|
176
|
+
/** Tuplet options. */
|
|
177
|
+
type TupletOptions = {
|
|
178
|
+
/** Show tuplet ratio (e.g. "3:2") instead of number of parts (e.g. "3"). */
|
|
179
|
+
showRatio?: boolean;
|
|
180
|
+
};
|
|
181
|
+
/** Lyrics text/syllable alignment.*/
|
|
182
|
+
declare enum LyricsAlign {
|
|
183
|
+
/** Left align lyrics text/syllable. */
|
|
184
|
+
Left = "left",
|
|
185
|
+
/** Center align lyrics text/syllable. */
|
|
186
|
+
Center = "center",
|
|
187
|
+
/** Right align lyrics text/syllable. */
|
|
188
|
+
Right = "right"
|
|
189
|
+
}
|
|
190
|
+
/** Lyrics hyphen.*/
|
|
191
|
+
declare enum LyricsHyphen {
|
|
192
|
+
/** Hyphen. */
|
|
193
|
+
Hyphen = "-",
|
|
194
|
+
/** Extender. */
|
|
195
|
+
Extender = "---"
|
|
196
|
+
}
|
|
197
|
+
/** Lyrics options. */
|
|
198
|
+
type LyricsOptions = {
|
|
199
|
+
/** Alignment of lyrics text/syllable. */
|
|
200
|
+
align?: LyricsAlign | `${LyricsAlign}`;
|
|
201
|
+
/** Hyphen or extender after lyrics text/syllable. */
|
|
202
|
+
hyphen?: LyricsHyphen | `${LyricsHyphen}`;
|
|
203
|
+
};
|
|
204
|
+
/** Fermata enum. */
|
|
205
|
+
declare enum Fermata {
|
|
206
|
+
/** Anchor fermata to note/rest. */
|
|
207
|
+
AtNote = "atNote",
|
|
208
|
+
/** Anchor fermata to measure end. */
|
|
209
|
+
AtMeasureEnd = "atMeasureEnd"
|
|
210
|
+
}
|
|
211
|
+
/** Navigation element enum. */
|
|
212
|
+
declare enum Navigation {
|
|
213
|
+
/** Repeat back to beginning and play to the "Fine" marking. */
|
|
214
|
+
DC_al_Fine = "D.C. al Fine",
|
|
215
|
+
/** Repeat back to beginning and play to the "to Coda 𝄌", then jump to the "𝄌 Coda". */
|
|
216
|
+
DC_al_Coda = "D.C. al Coda",
|
|
217
|
+
/** Repeat back to Segno sign (𝄋) and play to the "Fine" marking. */
|
|
218
|
+
DS_al_Fine = "D.S. al Fine",
|
|
219
|
+
/** Repeat back to Segno sign (𝄋) and play to the "to Coda 𝄌", then jump to the "𝄌 Coda". */
|
|
220
|
+
DS_al_Coda = "D.S. al Coda",
|
|
221
|
+
/** "𝄌 Coda" section. */
|
|
222
|
+
Coda = "Coda",
|
|
223
|
+
/** From "toCoda 𝄌" jump to the "𝄌 Coda" section. */
|
|
224
|
+
toCoda = "toCoda",
|
|
225
|
+
/** Jump here from D.S. al Fine or D.S. al Coda. */
|
|
226
|
+
Segno = "Segno",
|
|
227
|
+
/** Stop playing after D.C. al Fine or D.S. al Fine. */
|
|
228
|
+
Fine = "Fine",
|
|
229
|
+
/** Start of repeat section. */
|
|
230
|
+
StartRepeat = "startRepeat",
|
|
231
|
+
/** End of repeat section. Jump to start of repeat section. */
|
|
232
|
+
EndRepeat = "endRepeat",
|
|
233
|
+
/** Jump to ending with correct passage number. */
|
|
234
|
+
Ending = "ending"
|
|
235
|
+
}
|
|
236
|
+
/** Annotation element enum. */
|
|
237
|
+
declare enum Annotation {
|
|
238
|
+
/** "ppp", "pp", "p", "mp", "m", "mf", "f", "ff", "fff", "cresc.", "decresc.", "dim." */
|
|
239
|
+
Dynamics = "dynamics",
|
|
240
|
+
/** "accel.", "rit.", "a tempo" */
|
|
241
|
+
Tempo = "tempo"
|
|
242
|
+
}
|
|
243
|
+
/** Some known dynamics annotations. */
|
|
244
|
+
declare enum DynamicsAnnotation {
|
|
245
|
+
cresc = "cresc.",
|
|
246
|
+
decresc = "decresc.",
|
|
247
|
+
dim = "dim.",
|
|
248
|
+
ppp = "ppp",
|
|
249
|
+
pp = "pp",
|
|
250
|
+
p = "p",
|
|
251
|
+
mp = "mp",
|
|
252
|
+
m = "m",
|
|
253
|
+
mf = "mf",
|
|
254
|
+
f = "f",
|
|
255
|
+
ff = "ff",
|
|
256
|
+
fff = "fff"
|
|
257
|
+
}
|
|
258
|
+
/** Some known tempo annotations. */
|
|
259
|
+
declare enum TempoAnnotation {
|
|
260
|
+
accel = "accel.",
|
|
261
|
+
rit = "rit.",
|
|
262
|
+
a_tempo = "a tempo"
|
|
263
|
+
}
|
|
264
|
+
/** Known annotation test type. */
|
|
265
|
+
type AnnotationText = `${DynamicsAnnotation}` | `${TempoAnnotation}`;
|
|
266
|
+
/** Label element enum. */
|
|
267
|
+
declare enum Label {
|
|
268
|
+
/** "C", "C#", "Db", "D", etc. */
|
|
269
|
+
Note = "note",
|
|
270
|
+
/** "C", "Am", "G7", etc. */
|
|
271
|
+
Chord = "chord"
|
|
272
|
+
}
|
|
273
|
+
/** Play state enum. */
|
|
274
|
+
declare enum PlayState {
|
|
275
|
+
/** Playing. */
|
|
276
|
+
Playing = 0,
|
|
277
|
+
/** Paused. */
|
|
278
|
+
Paused = 1,
|
|
279
|
+
/** Stopped. */
|
|
280
|
+
Stopped = 2
|
|
281
|
+
}
|
|
282
|
+
/** Play state change listener type. */
|
|
283
|
+
type PlayStateChangeListener = (playState: PlayState) => void;
|
|
284
|
+
|
|
285
|
+
declare class AccidentalState {
|
|
286
|
+
readonly measure: ObjMeasure;
|
|
287
|
+
private readonly accidentalByDiatonicId;
|
|
288
|
+
constructor(measure: ObjMeasure);
|
|
289
|
+
getAccidentalFromKeySignature(diatonicId: number): Accidental | undefined;
|
|
290
|
+
setAccidental(note: Note): void;
|
|
291
|
+
needAccidental(note: Note): boolean;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
declare class ConnectiveProps {
|
|
295
|
+
readonly connective: Connective;
|
|
296
|
+
readonly span: number | TieType | `${TieType}`;
|
|
297
|
+
noteAnchor: NoteAnchor;
|
|
298
|
+
noteGroups: ObjNoteGroup[];
|
|
299
|
+
arcDir: "up" | "down";
|
|
300
|
+
constructor(connective: Connective, span: number | TieType | `${TieType}`, noteAnchor: NoteAnchor, startNoteGroup: ObjNoteGroup);
|
|
301
|
+
getStartNoteGroup(): ObjNoteGroup;
|
|
302
|
+
startsWith(noteGroup: ObjNoteGroup): boolean;
|
|
303
|
+
/**
|
|
304
|
+
*
|
|
305
|
+
* @param noteGroup -
|
|
306
|
+
* @returns true if noteGroup was added, false if not.
|
|
307
|
+
*/
|
|
308
|
+
addNoteGroup(noteGroup: ObjNoteGroup): boolean;
|
|
309
|
+
private computeParams;
|
|
310
|
+
removeConnectives(): void;
|
|
311
|
+
createConnectives(): void;
|
|
312
|
+
private createObjConnectiveWithTieType;
|
|
313
|
+
private createObjConnective;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
declare class ObjAccidental extends MusicObject {
|
|
317
|
+
readonly diatonicId: number;
|
|
318
|
+
readonly accidental: Accidental;
|
|
319
|
+
readonly color: string;
|
|
320
|
+
readonly mi: MAccidental;
|
|
321
|
+
constructor(parent: MusicObject, diatonicId: number, accidental: Accidental, color?: string);
|
|
322
|
+
getMusicInterface(): MAccidental;
|
|
323
|
+
pick(x: number, y: number): MusicObject[];
|
|
324
|
+
layout(ctx: RenderContext): void;
|
|
325
|
+
offset(dx: number, dy: number): void;
|
|
326
|
+
draw(ctx: RenderContext): void;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
type BoxType = "square" | "rectangle" | "circle" | "ellipse";
|
|
330
|
+
type TextProps = string | {
|
|
331
|
+
text: string;
|
|
332
|
+
scale?: number;
|
|
333
|
+
color?: string;
|
|
334
|
+
bold?: boolean;
|
|
335
|
+
italic?: boolean;
|
|
336
|
+
boxed?: BoxType;
|
|
337
|
+
padding?: number;
|
|
338
|
+
bgcolor?: string;
|
|
339
|
+
};
|
|
340
|
+
declare class ObjText extends MusicObject {
|
|
341
|
+
private anchorX;
|
|
342
|
+
private anchorY;
|
|
343
|
+
private readonly text;
|
|
344
|
+
private readonly scale;
|
|
345
|
+
private readonly color;
|
|
346
|
+
private readonly bold;
|
|
347
|
+
private readonly italic;
|
|
348
|
+
private readonly boxed;
|
|
349
|
+
private readonly padding;
|
|
350
|
+
private readonly bgcolor?;
|
|
351
|
+
private font;
|
|
352
|
+
private textLines;
|
|
353
|
+
private lineWidths;
|
|
354
|
+
private lineHeight;
|
|
355
|
+
readonly mi: MText;
|
|
356
|
+
constructor(parent: MusicObject, text: TextProps, anchorX: number, anchorY: number);
|
|
357
|
+
getMusicInterface(): MText;
|
|
358
|
+
getText(): string;
|
|
359
|
+
pick(x: number, y: number): MusicObject[];
|
|
360
|
+
layout(ctx: RenderContext): void;
|
|
361
|
+
offset(dx: number, dy: number): void;
|
|
362
|
+
draw(ctx: RenderContext): void;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
declare class ObjScoreRowGroup extends MusicObject {
|
|
366
|
+
readonly lines: readonly ObjNotationLine[];
|
|
367
|
+
private space;
|
|
368
|
+
readonly instrument: string;
|
|
369
|
+
readonly hasBrace: boolean;
|
|
370
|
+
private readonly instrText;
|
|
371
|
+
private braceRect;
|
|
372
|
+
readonly mi: MScoreRowGroup;
|
|
373
|
+
constructor(lines: readonly ObjNotationLine[]);
|
|
374
|
+
getMusicInterface(): MScoreRowGroup;
|
|
375
|
+
get row(): ObjScoreRow;
|
|
376
|
+
get hasInstrument(): boolean;
|
|
377
|
+
hasNotationLine(line: ObjNotationLine): boolean;
|
|
378
|
+
pick(x: number, y: number): MusicObject[];
|
|
379
|
+
updateRect(): void;
|
|
380
|
+
layout(ctx: RenderContext): void;
|
|
381
|
+
layoutToNotationLines(): void;
|
|
382
|
+
offset(dx: number, dy: number): void;
|
|
383
|
+
draw(ctx: RenderContext): void;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
type NotationLineObject = {
|
|
387
|
+
getRect: () => AnchoredRect;
|
|
388
|
+
offset?: (dx: number, dy: number) => void;
|
|
389
|
+
offsetInPlace?: (dx: number, dy: number) => void;
|
|
390
|
+
};
|
|
391
|
+
declare abstract class ObjNotationLine extends MusicObject {
|
|
392
|
+
readonly row: ObjScoreRow;
|
|
393
|
+
protected readonly objects: NotationLineObject[];
|
|
394
|
+
abstract readonly id: number;
|
|
395
|
+
abstract readonly name: string;
|
|
396
|
+
private layoutGroups;
|
|
397
|
+
constructor(row: ObjScoreRow);
|
|
398
|
+
getRowGroup(): ObjScoreRowGroup;
|
|
399
|
+
addObject(o: NotationLineObject): void;
|
|
400
|
+
removeObjects(): void;
|
|
401
|
+
getLayoutGroup(lauoutGroupId: LayoutGroupId): LayoutGroup;
|
|
402
|
+
resetLayoutGroups(ctx: RenderContext): void;
|
|
403
|
+
layoutLayoutGroups(ctx: RenderContext): void;
|
|
404
|
+
private setObjectY;
|
|
405
|
+
private alignObjectsY;
|
|
406
|
+
layoutLayoutGroup(ctx: RenderContext, layoutGroup: LayoutGroup, verticalPos: VerticalPos): void;
|
|
407
|
+
drawVerticalLine(ctx: RenderContext, left: number, width: number, isSystemBarLine?: boolean): void;
|
|
408
|
+
abstract getConfig(): StaffConfig | TabConfig;
|
|
409
|
+
abstract calcTop(): number;
|
|
410
|
+
abstract calcBottom(): number;
|
|
411
|
+
abstract getTopLineY(): number;
|
|
412
|
+
abstract getBottomLineY(): number;
|
|
413
|
+
abstract containsVoiceId(voiceId: number): boolean;
|
|
414
|
+
abstract containsDiatonicId(diatonicId: number): boolean;
|
|
415
|
+
abstract layoutWidth(ctx: RenderContext): void;
|
|
416
|
+
abstract layoutHeight(ctx: RenderContext): void;
|
|
417
|
+
abstract offset(dx: number, dy: number): void;
|
|
418
|
+
abstract draw(ctx: RenderContext): void;
|
|
419
|
+
}
|
|
420
|
+
declare class ObjStaff extends ObjNotationLine {
|
|
421
|
+
readonly staffConfig: StaffConfig;
|
|
422
|
+
readonly id: number;
|
|
423
|
+
readonly clefImageAsset: ImageAsset;
|
|
424
|
+
readonly clefLineDiatonicId: number;
|
|
425
|
+
readonly topLineDiatonicId: number;
|
|
426
|
+
readonly middleLineDiatonicId: number;
|
|
427
|
+
readonly bottomLineDiatonicId: number;
|
|
428
|
+
readonly minDiatonicId?: number;
|
|
429
|
+
readonly maxDiatonicId?: number;
|
|
430
|
+
private joinedGrandStaff?;
|
|
431
|
+
private topLineY;
|
|
432
|
+
private bottomLineY;
|
|
433
|
+
readonly mi: MStaff;
|
|
434
|
+
constructor(row: ObjScoreRow, staffConfig: StaffConfig, id: number);
|
|
435
|
+
getMusicInterface(): MStaff;
|
|
436
|
+
get isOctaveDown(): boolean;
|
|
437
|
+
get name(): string;
|
|
438
|
+
getConfig(): StaffConfig | TabConfig;
|
|
439
|
+
getTopLineY(): number;
|
|
440
|
+
getMiddleLineY(): number;
|
|
441
|
+
getBottomLineY(): number;
|
|
442
|
+
joinGrandStaff(staff: ObjStaff): void;
|
|
443
|
+
isGrandTreble(): boolean;
|
|
444
|
+
isGrandBass(): boolean;
|
|
445
|
+
getLineSpacing(): number;
|
|
446
|
+
getDiatonicSpacing(): number;
|
|
447
|
+
containsDiatonicId(diatonicId: number): boolean;
|
|
448
|
+
getDiatonicIdY(diatonicId: number): number;
|
|
449
|
+
getActualStaff(diatonicId: number): ObjStaff | undefined;
|
|
450
|
+
getDiatonicIdAt(y: number): number | undefined;
|
|
451
|
+
isLine(diatonicId: number): boolean;
|
|
452
|
+
isSpace(diatonicId: number): boolean;
|
|
453
|
+
containsVoiceId(voiceId: VoiceId): boolean;
|
|
454
|
+
calcTop(): number;
|
|
455
|
+
calcBottom(): number;
|
|
456
|
+
pick(x: number, y: number): MusicObject[];
|
|
457
|
+
layoutHeight(ctx: RenderContext): void;
|
|
458
|
+
layoutWidth(ctx: RenderContext): void;
|
|
459
|
+
offset(dx: number, dy: number): void;
|
|
460
|
+
draw(ctx: RenderContext): void;
|
|
461
|
+
}
|
|
462
|
+
declare class ObjTab extends ObjNotationLine {
|
|
463
|
+
readonly tabConfig: TabConfig;
|
|
464
|
+
readonly id: number;
|
|
465
|
+
private top;
|
|
466
|
+
private bottom;
|
|
467
|
+
private readonly tuningName?;
|
|
468
|
+
private readonly tuningStrings;
|
|
469
|
+
readonly mi: MTab;
|
|
470
|
+
constructor(row: ObjScoreRow, tabConfig: TabConfig, id: number);
|
|
471
|
+
getMusicInterface(): MTab;
|
|
472
|
+
get name(): string;
|
|
473
|
+
getConfig(): StaffConfig | TabConfig;
|
|
474
|
+
getTuningName(): string | undefined;
|
|
475
|
+
getTuningStrings(): ReadonlyArray<Note>;
|
|
476
|
+
/** Return Y coordinate of string. */
|
|
477
|
+
getStringY(stringId: number): number;
|
|
478
|
+
getTopStringY(): number;
|
|
479
|
+
getBottomStringY(): number;
|
|
480
|
+
getTopLineY(): number;
|
|
481
|
+
getBottomLineY(): number;
|
|
482
|
+
getTop(): number;
|
|
483
|
+
getBottom(): number;
|
|
484
|
+
containsVoiceId(voiceId: VoiceId): boolean;
|
|
485
|
+
containsDiatonicId(diatonicId: number): boolean;
|
|
486
|
+
calcTop(): number;
|
|
487
|
+
calcBottom(): number;
|
|
488
|
+
pick(x: number, y: number): MusicObject[];
|
|
489
|
+
layoutHeight(ctx: RenderContext): void;
|
|
490
|
+
layoutWidth(ctx: RenderContext): void;
|
|
491
|
+
offset(dx: number, dy: number): void;
|
|
492
|
+
draw(ctx: RenderContext): void;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
declare class ObjStaffNoteGroup extends MusicObject {
|
|
496
|
+
readonly staff: ObjStaff;
|
|
497
|
+
readonly noteGroup: ObjNoteGroup;
|
|
498
|
+
noteHeadRects: AnchoredRect[];
|
|
499
|
+
dotRects: AnchoredRect[];
|
|
500
|
+
accidentals: ObjAccidental[];
|
|
501
|
+
stemTip?: AnchoredRect;
|
|
502
|
+
stemBase?: AnchoredRect;
|
|
503
|
+
flagRects: AnchoredRect[];
|
|
504
|
+
private prevTopNoteY;
|
|
505
|
+
private prevBottomNoteY;
|
|
506
|
+
readonly mi: MStaffNoteGroup;
|
|
507
|
+
constructor(staff: ObjStaff, noteGroup: ObjNoteGroup);
|
|
508
|
+
getMusicInterface(): MusicInterface;
|
|
509
|
+
pick(x: number, y: number): MusicObject[];
|
|
510
|
+
updateRect(): void;
|
|
511
|
+
getRect(): AnchoredRect;
|
|
512
|
+
offset(dx: number, dy: number): void;
|
|
513
|
+
}
|
|
514
|
+
declare class ObjTabNoteGroup extends MusicObject {
|
|
515
|
+
readonly tab: ObjTab;
|
|
516
|
+
readonly noteGroup: ObjNoteGroup;
|
|
517
|
+
fretNumbers: ObjText[];
|
|
518
|
+
readonly mi: MTabNoteGroup;
|
|
519
|
+
constructor(tab: ObjTab, noteGroup: ObjNoteGroup);
|
|
520
|
+
getMusicInterface(): MusicInterface;
|
|
521
|
+
pick(x: number, y: number): MusicObject[];
|
|
522
|
+
updateRect(): void;
|
|
523
|
+
offset(dx: number, dy: number): void;
|
|
524
|
+
}
|
|
525
|
+
declare class ObjNoteGroup extends MusicObject {
|
|
526
|
+
readonly col: ObjRhythmColumn;
|
|
527
|
+
readonly voiceId: VoiceId;
|
|
528
|
+
readonly notes: ReadonlyArray<Note>;
|
|
529
|
+
readonly options?: NoteOptions | undefined;
|
|
530
|
+
readonly setDiatonicId: number;
|
|
531
|
+
readonly setStringsNumbers?: StringNumber[];
|
|
532
|
+
private runningDiatonicId;
|
|
533
|
+
private runningStemDir;
|
|
534
|
+
private runningStringNumbers;
|
|
535
|
+
readonly color: string;
|
|
536
|
+
readonly staccato: boolean;
|
|
537
|
+
readonly diamond: boolean;
|
|
538
|
+
readonly arpeggio: Arpeggio | undefined;
|
|
539
|
+
readonly oldStyleTriplet: boolean;
|
|
540
|
+
readonly rhythmProps: RhythmProps;
|
|
541
|
+
private startConnnectives;
|
|
542
|
+
private runningConnectives;
|
|
543
|
+
private leftBeamCount;
|
|
544
|
+
private rightBeamCount;
|
|
545
|
+
private beamGroup?;
|
|
546
|
+
private readonly staffObjects;
|
|
547
|
+
private readonly tabObjects;
|
|
548
|
+
private isNoteDisplaced;
|
|
549
|
+
readonly mi: MNoteGroup;
|
|
550
|
+
constructor(col: ObjRhythmColumn, voiceId: VoiceId, notes: ReadonlyArray<Note>, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions | undefined, tupletRatio?: TupletRatio);
|
|
551
|
+
getMusicInterface(): MNoteGroup;
|
|
552
|
+
get doc(): ObjDocument;
|
|
553
|
+
get measure(): ObjMeasure;
|
|
554
|
+
get row(): ObjScoreRow;
|
|
555
|
+
get minDiatonicId(): number;
|
|
556
|
+
get maxDiatonicId(): number;
|
|
557
|
+
getDiatonicId(staff?: ObjStaff): number;
|
|
558
|
+
get stemDir(): Stem.Up | Stem.Down;
|
|
559
|
+
setNoteDisplacement(note: Note, isDisplaced: boolean): void;
|
|
560
|
+
enableConnective(line: ObjNotationLine): boolean;
|
|
561
|
+
startConnective(connectiveProps: ConnectiveProps): void;
|
|
562
|
+
updateRunningArguments(diatonicId: number, stemDir: Stem.Up | Stem.Down, stringNumbers: StringNumber[]): void;
|
|
563
|
+
pick(x: number, y: number): MusicObject[];
|
|
564
|
+
getTopNote(): Note;
|
|
565
|
+
getBottomNote(): Note;
|
|
566
|
+
getConnectiveAnchorPoint(connectiveProps: ConnectiveProps, line: ObjNotationLine, noteIndex: number, noteAnchor: NoteAnchor, side: "left" | "right"): {
|
|
567
|
+
x: number;
|
|
568
|
+
y: number;
|
|
569
|
+
};
|
|
570
|
+
getFretNumberString(noteIndex: number): StringNumber | undefined;
|
|
571
|
+
getFretNumber(tab: ObjTab, noteIndex: number): number | undefined;
|
|
572
|
+
private getNextNoteGroup;
|
|
573
|
+
collectConnectiveProps(): void;
|
|
574
|
+
removeConnectiveProps(): void;
|
|
575
|
+
getPlaySlur(): "first" | "slurred" | undefined;
|
|
576
|
+
getBeamGroup(): ObjBeamGroup | undefined;
|
|
577
|
+
setBeamGroup(beamGroup: ObjBeamGroup): void;
|
|
578
|
+
resetBeamGroup(): void;
|
|
579
|
+
getBeamCoords(): ({
|
|
580
|
+
staff: ObjStaff;
|
|
581
|
+
x: number;
|
|
582
|
+
y: number;
|
|
583
|
+
stemHeight: number;
|
|
584
|
+
} | undefined)[];
|
|
585
|
+
getStemHeight(ctx: RenderContext): number;
|
|
586
|
+
hasBeamCount(): boolean;
|
|
587
|
+
getLeftBeamCount(): number;
|
|
588
|
+
getRightBeamCount(): number;
|
|
589
|
+
setLeftBeamCount(count: number): void;
|
|
590
|
+
setRightBeamCount(count: number): void;
|
|
591
|
+
hasTuplet(): boolean;
|
|
592
|
+
isEmpty(): boolean;
|
|
593
|
+
visibleInStaff(staff: ObjStaff): boolean;
|
|
594
|
+
getPlayTicks(note: Note): number;
|
|
595
|
+
updateAccidentalState(accState: AccidentalState): void;
|
|
596
|
+
layout(ctx: RenderContext, accState: AccidentalState): void;
|
|
597
|
+
updateRect(): void;
|
|
598
|
+
setStemTipY(staff: ObjStaff, stemTipY: number): void;
|
|
599
|
+
offset(dx: number, dy: number): void;
|
|
600
|
+
draw(ctx: RenderContext): void;
|
|
601
|
+
getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem): 1 | 0 | -1;
|
|
602
|
+
static hasSameNotes(ng1: ObjNoteGroup, ng2: ObjNoteGroup): boolean;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
declare enum BeamGroupType {
|
|
606
|
+
RegularBeam = 0,
|
|
607
|
+
TupletBeam = 1,
|
|
608
|
+
TupletGroup = 2
|
|
609
|
+
}
|
|
610
|
+
declare class BeamPoint {
|
|
611
|
+
staff: ObjStaff;
|
|
612
|
+
beamGroup: ObjBeamGroup;
|
|
613
|
+
symbol: RhythmSymbol;
|
|
614
|
+
x: number;
|
|
615
|
+
y: number;
|
|
616
|
+
topBeamsHeight: number;
|
|
617
|
+
bottomBeamsHeight: number;
|
|
618
|
+
constructor(staff: ObjStaff, beamGroup: ObjBeamGroup, symbol: RhythmSymbol, x: number, y: number);
|
|
619
|
+
offset(dx: number, dy: number): void;
|
|
620
|
+
getRect(): AnchoredRect;
|
|
621
|
+
}
|
|
622
|
+
declare class ObjStaffBeamGroup extends MusicObject {
|
|
623
|
+
readonly staff: ObjStaff;
|
|
624
|
+
readonly beamGroup: ObjBeamGroup;
|
|
625
|
+
tupletNumber?: ObjText;
|
|
626
|
+
tupletNumberOffsetY: number;
|
|
627
|
+
points: BeamPoint[];
|
|
628
|
+
readonly mi: MStaffBeamGroup;
|
|
629
|
+
constructor(staff: ObjStaff, beamGroup: ObjBeamGroup);
|
|
630
|
+
getMusicInterface(): MusicInterface;
|
|
631
|
+
pick(x: number, y: number): MusicObject[];
|
|
632
|
+
offset(dx: number, dy: number): void;
|
|
633
|
+
updateRect(): void;
|
|
634
|
+
}
|
|
635
|
+
declare class ObjBeamGroup extends MusicObject {
|
|
636
|
+
private readonly symbols;
|
|
637
|
+
readonly tupletRatio: TupletRatio & TupletOptions | undefined;
|
|
638
|
+
readonly mi: MBeamGroup;
|
|
639
|
+
private readonly type;
|
|
640
|
+
private readonly staffObjects;
|
|
641
|
+
private constructor();
|
|
642
|
+
get stemDir(): Stem.Up | Stem.Down;
|
|
643
|
+
private get showTupletRatio();
|
|
644
|
+
static createBeam(noteGroups: ObjNoteGroup[]): boolean;
|
|
645
|
+
static createOldStyleTriplet(symbols: RhythmSymbol[]): number;
|
|
646
|
+
static createTuplet(symbols: RhythmSymbol[], tupletRatio: TupletRatio & TupletOptions): void;
|
|
647
|
+
getMusicInterface(): MBeamGroup;
|
|
648
|
+
detach(): void;
|
|
649
|
+
isEmpty(): boolean;
|
|
650
|
+
pick(x: number, y: number): MusicObject[];
|
|
651
|
+
getType(): BeamGroupType;
|
|
652
|
+
isTuplet(): boolean;
|
|
653
|
+
getTupletRatioText(): string;
|
|
654
|
+
getSymbols(): ReadonlyArray<RhythmSymbol>;
|
|
655
|
+
getFirstSymbol(): RhythmSymbol | undefined;
|
|
656
|
+
getLastSymbol(): RhythmSymbol | undefined;
|
|
657
|
+
private get color();
|
|
658
|
+
layout(ctx: RenderContext): void;
|
|
659
|
+
updateRect(): void;
|
|
660
|
+
updateStemTips(): void;
|
|
661
|
+
offset(dx: number, dy: number): void;
|
|
662
|
+
draw(ctx: RenderContext): void;
|
|
663
|
+
private setBeamCounts;
|
|
664
|
+
private setTupletBeamCounts;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
declare class ObjStaffRest extends MusicObject {
|
|
668
|
+
readonly staff: ObjStaff;
|
|
669
|
+
readonly rest: ObjRest;
|
|
670
|
+
restRect: AnchoredRect;
|
|
671
|
+
dotRects: AnchoredRect[];
|
|
672
|
+
readonly mi: MStaffRest;
|
|
673
|
+
constructor(staff: ObjStaff, rest: ObjRest);
|
|
674
|
+
getMusicInterface(): MusicInterface;
|
|
675
|
+
pick(x: number, y: number): MusicObject[];
|
|
676
|
+
offset(dx: number, dy: number): void;
|
|
677
|
+
updateRect(): void;
|
|
678
|
+
}
|
|
679
|
+
declare class ObjRest extends MusicObject {
|
|
680
|
+
readonly col: ObjRhythmColumn;
|
|
681
|
+
readonly voiceId: VoiceId;
|
|
682
|
+
readonly options?: RestOptions | undefined;
|
|
683
|
+
readonly color: string;
|
|
684
|
+
readonly hide: boolean;
|
|
685
|
+
readonly oldStyleTriplet: boolean;
|
|
686
|
+
readonly rhythmProps: RhythmProps;
|
|
687
|
+
static UndefinedDiatonicId: number;
|
|
688
|
+
readonly setDiatonicId: number;
|
|
689
|
+
private runningDiatonicId;
|
|
690
|
+
private runningStemDir;
|
|
691
|
+
private beamGroup?;
|
|
692
|
+
readonly staffObjects: ObjStaffRest[];
|
|
693
|
+
readonly mi: MRest;
|
|
694
|
+
constructor(col: ObjRhythmColumn, voiceId: VoiceId, noteLength: NoteLength | NoteLengthStr, options?: RestOptions | undefined, tupletRatio?: TupletRatio);
|
|
695
|
+
getMusicInterface(): MRest;
|
|
696
|
+
get doc(): ObjDocument;
|
|
697
|
+
get measure(): ObjMeasure;
|
|
698
|
+
get row(): ObjScoreRow;
|
|
699
|
+
get noteLength(): NoteLength;
|
|
700
|
+
getDiatonicId(staff?: ObjStaff): number;
|
|
701
|
+
get stemDir(): Stem.Up | Stem.Down;
|
|
702
|
+
updateRunningArguments(diatonicId: number, stemDir: Stem.Up | Stem.Down, stringNumbers: StringNumber[]): void;
|
|
703
|
+
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
704
|
+
pick(x: number, y: number): MusicObject[];
|
|
705
|
+
getBeamGroup(): ObjBeamGroup | undefined;
|
|
706
|
+
setBeamGroup(beamGroup: ObjBeamGroup): void;
|
|
707
|
+
resetBeamGroup(): void;
|
|
708
|
+
getBeamCoords(): ({
|
|
709
|
+
staff: ObjStaff;
|
|
710
|
+
x: number;
|
|
711
|
+
y: number;
|
|
712
|
+
stemHeight: number;
|
|
713
|
+
} | undefined)[];
|
|
714
|
+
hasTuplet(): boolean;
|
|
715
|
+
isEmpty(): boolean;
|
|
716
|
+
visibleInStaff(staff: ObjStaff): boolean;
|
|
717
|
+
private getRestDotVerticalDisplacement;
|
|
718
|
+
updateAccidentalState(accState: AccidentalState): void;
|
|
719
|
+
layout(ctx: RenderContext, accState: AccidentalState): void;
|
|
720
|
+
updateRect(): void;
|
|
721
|
+
offset(dx: number, dy: number): void;
|
|
722
|
+
draw(ctx: RenderContext): void;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
declare class ObjLyrics extends MusicObject {
|
|
726
|
+
readonly col: ObjRhythmColumn;
|
|
727
|
+
readonly verse: VerseNumber;
|
|
728
|
+
readonly line: ObjNotationLine;
|
|
729
|
+
readonly vpos: VerticalPos;
|
|
730
|
+
private nextLyricsObject?;
|
|
731
|
+
readonly rhythmProps: RhythmProps;
|
|
732
|
+
private readonly color;
|
|
733
|
+
private readonly hyphen?;
|
|
734
|
+
private readonly text;
|
|
735
|
+
readonly mi: MLyrics;
|
|
736
|
+
constructor(col: ObjRhythmColumn, verse: VerseNumber, line: ObjNotationLine, vpos: VerticalPos, lyricsLength: NoteLength, lyricsText: string, lyricsOptions?: LyricsOptions);
|
|
737
|
+
getMusicInterface(): MLyrics;
|
|
738
|
+
get measure(): ObjMeasure;
|
|
739
|
+
getText(): string;
|
|
740
|
+
setNextLyricsObject(lyricsObj: ObjLyrics): void;
|
|
741
|
+
pick(x: number, y: number): MusicObject[];
|
|
742
|
+
layout(ctx: RenderContext): void;
|
|
743
|
+
offset(dx: number, dy: number): void;
|
|
744
|
+
draw(ctx: RenderContext): void;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
type ScorePlayerNote = {
|
|
748
|
+
note: Note;
|
|
749
|
+
ticks: number;
|
|
750
|
+
staccato: boolean;
|
|
751
|
+
slur: undefined | "first" | "slurred";
|
|
752
|
+
};
|
|
753
|
+
type RhythmSymbol = ObjNoteGroup | ObjRest;
|
|
754
|
+
declare class ObjRhythmColumn extends MusicObject {
|
|
755
|
+
readonly measure: ObjMeasure;
|
|
756
|
+
readonly positionTicks: number;
|
|
757
|
+
private readonly voiceSymbol;
|
|
758
|
+
private readonly lyricsObject;
|
|
759
|
+
private minDiatonicId?;
|
|
760
|
+
private maxDiatonicId?;
|
|
761
|
+
private staffMinDiatonicId;
|
|
762
|
+
private staffMaxDiatonicId;
|
|
763
|
+
private arpeggioDir;
|
|
764
|
+
private arpeggios;
|
|
765
|
+
private readonly playerProps;
|
|
766
|
+
private needLayout;
|
|
767
|
+
private shapeRects;
|
|
768
|
+
readonly mi: MRhythmColumn;
|
|
769
|
+
constructor(measure: ObjMeasure, positionTicks: number);
|
|
770
|
+
getMusicInterface(): MRhythmColumn;
|
|
771
|
+
getPlayerProps(): PlayerColumnProps;
|
|
772
|
+
/**
|
|
773
|
+
* Get next column in column's measure.
|
|
774
|
+
* @returns
|
|
775
|
+
*/
|
|
776
|
+
getNextColumnInMeasure(): ObjRhythmColumn | undefined;
|
|
777
|
+
/**
|
|
778
|
+
* Get next column. Goes into next measure if necessary.
|
|
779
|
+
* Does not care navigation elements: repeats, endings, etc.
|
|
780
|
+
* @returns
|
|
781
|
+
*/
|
|
782
|
+
getNextColumn(): ObjRhythmColumn | undefined;
|
|
783
|
+
getTicksToNextColumn(): number;
|
|
784
|
+
getShapeRects(): AnchoredRect[];
|
|
785
|
+
get doc(): ObjDocument;
|
|
786
|
+
get row(): ObjScoreRow;
|
|
787
|
+
pick(x: number, y: number): MusicObject[];
|
|
788
|
+
hasArpeggio(): boolean;
|
|
789
|
+
getArpeggioDir(): Arpeggio;
|
|
790
|
+
setVoiceSymbol(voiceId: VoiceId, symbol: RhythmSymbol): void;
|
|
791
|
+
getVoiceSymbol(voiceId: VoiceId): RhythmSymbol | undefined;
|
|
792
|
+
getLyricsObject(verse: VerseNumber, line: ObjNotationLine, vpos: VerticalPos): ObjLyrics | undefined;
|
|
793
|
+
addLyricsObject(lyricsObj: ObjLyrics): void;
|
|
794
|
+
updateNoteDisplacements(): void;
|
|
795
|
+
isEmpty(): boolean;
|
|
796
|
+
getPlayerNotes(): ScorePlayerNote[];
|
|
797
|
+
requestLayout(): void;
|
|
798
|
+
layout(ctx: RenderContext, accState: AccidentalState): void;
|
|
799
|
+
layoutReserveSpace(ctx: RenderContext): void;
|
|
800
|
+
layoutDone(): void;
|
|
801
|
+
updateRect(): void;
|
|
802
|
+
offset(dx: number, dy: number): void;
|
|
803
|
+
draw(ctx: RenderContext): void;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
type PlayerColumn = ObjRhythmColumn | ObjBarLineRight;
|
|
807
|
+
declare class PlayerColumnProps {
|
|
808
|
+
readonly col: PlayerColumn;
|
|
809
|
+
private speed;
|
|
810
|
+
private volume;
|
|
811
|
+
constructor(col: PlayerColumn);
|
|
812
|
+
get measure(): ObjMeasure;
|
|
813
|
+
reset(): void;
|
|
814
|
+
setSpeed(speed: number): void;
|
|
815
|
+
getSpeed(): number;
|
|
816
|
+
getTempo(): Tempo;
|
|
817
|
+
setVolume(volume: number): void;
|
|
818
|
+
getVolume(): number;
|
|
819
|
+
hasFermata(): boolean;
|
|
820
|
+
getFermataHoldTicks(): number;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
declare enum BarLineType {
|
|
824
|
+
None = 0,
|
|
825
|
+
Single = 1,
|
|
826
|
+
Double = 2,
|
|
827
|
+
EndSong = 3,
|
|
828
|
+
StartRepeat = 4,
|
|
829
|
+
EndRepeat = 5,
|
|
830
|
+
EndStartRepeat = 6
|
|
831
|
+
}
|
|
832
|
+
declare class ObjStaffBarLine extends MusicObject {
|
|
833
|
+
readonly barLine: ObjBarLine;
|
|
834
|
+
readonly line: ObjNotationLine;
|
|
835
|
+
readonly rowGroup: ObjScoreRowGroup;
|
|
836
|
+
vlines: {
|
|
837
|
+
left: number;
|
|
838
|
+
width: number;
|
|
839
|
+
}[];
|
|
840
|
+
dots: {
|
|
841
|
+
x: number;
|
|
842
|
+
y: number;
|
|
843
|
+
r: number;
|
|
844
|
+
}[];
|
|
845
|
+
readonly mi: MStaffBarLine;
|
|
846
|
+
constructor(barLine: ObjBarLine, line: ObjNotationLine, rowGroup: ObjScoreRowGroup);
|
|
847
|
+
getMusicInterface(): MusicInterface;
|
|
848
|
+
pick(x: number, y: number): MusicObject[];
|
|
849
|
+
updateRect(): void;
|
|
850
|
+
offset(dx: number, dy: number): void;
|
|
851
|
+
}
|
|
852
|
+
declare abstract class ObjBarLine extends MusicObject {
|
|
853
|
+
readonly measure: ObjMeasure;
|
|
854
|
+
protected notationLineObjects: ObjStaffBarLine[];
|
|
855
|
+
protected notationLineObjectsByGrp: UniMap<ObjScoreRowGroup, ObjStaffBarLine[]>;
|
|
856
|
+
protected barLineType: BarLineType;
|
|
857
|
+
constructor(measure: ObjMeasure);
|
|
858
|
+
abstract solveBarLineType(): BarLineType;
|
|
859
|
+
get doc(): ObjDocument;
|
|
860
|
+
get row(): ObjScoreRow;
|
|
861
|
+
pick(x: number, y: number): MusicObject[];
|
|
862
|
+
layout(ctx: RenderContext): void;
|
|
863
|
+
updateRect(): void;
|
|
864
|
+
offset(dx: number, dy: number): void;
|
|
865
|
+
draw(ctx: RenderContext): void;
|
|
866
|
+
}
|
|
867
|
+
declare class ObjBarLineLeft extends ObjBarLine {
|
|
868
|
+
readonly mi: MBarLineLeft;
|
|
869
|
+
constructor(measure: ObjMeasure);
|
|
870
|
+
getMusicInterface(): MBarLineLeft;
|
|
871
|
+
solveBarLineType(): BarLineType;
|
|
872
|
+
}
|
|
873
|
+
declare class ObjBarLineRight extends ObjBarLine {
|
|
874
|
+
private readonly playerProps;
|
|
875
|
+
readonly mi: MBarLineRight;
|
|
876
|
+
constructor(measure: ObjMeasure);
|
|
877
|
+
getMusicInterface(): MBarLineRight;
|
|
878
|
+
getPlayerProps(): PlayerColumnProps;
|
|
879
|
+
solveBarLineType(): BarLineType;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
declare class ObjConnective extends MusicObject {
|
|
883
|
+
readonly connectiveProps: ConnectiveProps;
|
|
884
|
+
readonly measure: ObjMeasure;
|
|
885
|
+
private lx;
|
|
886
|
+
private ly;
|
|
887
|
+
private rx;
|
|
888
|
+
private ry;
|
|
889
|
+
private cp1x;
|
|
890
|
+
private cp1y;
|
|
891
|
+
private cp2x;
|
|
892
|
+
private cp2y;
|
|
893
|
+
private arcHeight;
|
|
894
|
+
private readonly line;
|
|
895
|
+
private readonly leftNoteGroup;
|
|
896
|
+
private readonly leftNoteId;
|
|
897
|
+
private readonly rightNoteGroup?;
|
|
898
|
+
private readonly rightNoteId?;
|
|
899
|
+
private readonly tieType?;
|
|
900
|
+
readonly mi: MConnective;
|
|
901
|
+
constructor(connectiveProps: ConnectiveProps, line: ObjNotationLine, measure: ObjMeasure, leftNoteGroup: ObjNoteGroup, leftNoteId: number, rightNoteGroup: ObjNoteGroup, rightNoteId: number);
|
|
902
|
+
constructor(connectiveProps: ConnectiveProps, line: ObjNotationLine, measure: ObjMeasure, leftNoteGroup: ObjNoteGroup, leftNoteId: number, tie: TieType);
|
|
903
|
+
getMusicInterface(): MConnective;
|
|
904
|
+
get doc(): ObjDocument;
|
|
905
|
+
isInsideMeasure(): boolean;
|
|
906
|
+
pick(x: number, y: number): MusicObject[];
|
|
907
|
+
layout(ctx: RenderContext): void;
|
|
908
|
+
offset(dx: number, dy: number): void;
|
|
909
|
+
draw(ctx: RenderContext): void;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
declare class ObjSpecialText extends MusicObject {
|
|
913
|
+
readonly text: string;
|
|
914
|
+
readonly color: string;
|
|
915
|
+
static toCoda: string;
|
|
916
|
+
static Coda: string;
|
|
917
|
+
static Segno: string;
|
|
918
|
+
private components;
|
|
919
|
+
readonly mi: MSpecialText;
|
|
920
|
+
constructor(parent: MusicObject, text: string, color?: string);
|
|
921
|
+
getMusicInterface(): MSpecialText;
|
|
922
|
+
getText(): string;
|
|
923
|
+
pick(x: number, y: number): MusicObject[];
|
|
924
|
+
layout(ctx: RenderContext): void;
|
|
925
|
+
offset(dx: number, dy: number): void;
|
|
926
|
+
draw(ctx: RenderContext): void;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
type ExtensionStartObject = ObjText | ObjSpecialText;
|
|
930
|
+
type ExtensionLineLeftObject = ObjBarLineLeft | MusicObject;
|
|
931
|
+
type ExtensionLineRightObject = ObjRhythmColumn | ObjBarLineRight;
|
|
932
|
+
type ExtensionStopObject = ObjBarLineRight | ObjText | ObjSpecialText;
|
|
933
|
+
type ExtensionObjectAll = ExtensionStartObject | ExtensionLineLeftObject | ExtensionLineRightObject | ExtensionStopObject;
|
|
934
|
+
declare class ObjExtensionLine extends MusicObject {
|
|
935
|
+
readonly measure: ObjMeasure;
|
|
936
|
+
readonly line: ObjNotationLine;
|
|
937
|
+
readonly extension: Extension;
|
|
938
|
+
readonly cols: ExtensionObjectAll[];
|
|
939
|
+
readonly mi: MExtensionLine;
|
|
940
|
+
constructor(measure: ObjMeasure, line: ObjNotationLine, extension: Extension, cols: ExtensionObjectAll[]);
|
|
941
|
+
get row(): ObjScoreRow;
|
|
942
|
+
getMusicInterface(): MExtensionLine;
|
|
943
|
+
private getLineLeft;
|
|
944
|
+
private getLineRight;
|
|
945
|
+
layoutFitToMeasure(ctx: RenderContext): void;
|
|
946
|
+
pick(x: number, y: number): MusicObject[];
|
|
947
|
+
layout(ctx: RenderContext): void;
|
|
948
|
+
offset(dx: number, dy: number): void;
|
|
949
|
+
draw(ctx: RenderContext): void;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
type ExtensionLineStyle = "solid" | "dashed";
|
|
953
|
+
type ExtensionLinePos = "bottom" | "middle";
|
|
954
|
+
declare class ExtensionRange {
|
|
955
|
+
readonly startColumn: ObjRhythmColumn;
|
|
956
|
+
readonly columnRange: ObjRhythmColumn[];
|
|
957
|
+
stopObject?: ExtensionStopObject;
|
|
958
|
+
constructor(startColumn: ObjRhythmColumn);
|
|
959
|
+
get endColumn(): ObjRhythmColumn;
|
|
960
|
+
addColumn(col: ObjRhythmColumn): void;
|
|
961
|
+
setStopObject(obj: ExtensionStopObject): void;
|
|
962
|
+
}
|
|
963
|
+
declare class Extension extends MusicObjectLink {
|
|
964
|
+
readonly headObj: LayoutObjectWrapper;
|
|
965
|
+
private readonly length;
|
|
966
|
+
private readonly visible;
|
|
967
|
+
private readonly lineStyle;
|
|
968
|
+
private readonly linePos;
|
|
969
|
+
private readonly startColumn;
|
|
970
|
+
constructor(headObj: LayoutObjectWrapper, startColumn: ObjRhythmColumn, length: number, visible: boolean, lineStyle: ExtensionLineStyle, linePos: ExtensionLinePos);
|
|
971
|
+
isVisible(): boolean;
|
|
972
|
+
getLineStyle(): ExtensionLineStyle;
|
|
973
|
+
getLinePos(): ExtensionLinePos;
|
|
974
|
+
private static StopNavigations;
|
|
975
|
+
private whatStopped;
|
|
976
|
+
getRange(): ExtensionRange;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
declare class ObjMeasure extends MusicObject {
|
|
980
|
+
readonly row: ObjScoreRow;
|
|
981
|
+
private readonly options;
|
|
982
|
+
private prevMeasure;
|
|
983
|
+
private nextMeasure;
|
|
984
|
+
private keySignature;
|
|
985
|
+
private timeSignature;
|
|
986
|
+
private tempo;
|
|
987
|
+
private alterKeySignature?;
|
|
988
|
+
private alterTimeSignature?;
|
|
989
|
+
private alterTempo?;
|
|
990
|
+
private signatures;
|
|
991
|
+
private tabStringNotes;
|
|
992
|
+
private barLineLeft;
|
|
993
|
+
private columns;
|
|
994
|
+
private barLineRight;
|
|
995
|
+
private connectives;
|
|
996
|
+
private beamGroups;
|
|
997
|
+
private measureId;
|
|
998
|
+
private regions;
|
|
999
|
+
private needLayout;
|
|
1000
|
+
private voiceSymbols;
|
|
1001
|
+
private lastAddedRhythmColumn?;
|
|
1002
|
+
private lastAddedRhythmSymbol?;
|
|
1003
|
+
private addExtensionTo;
|
|
1004
|
+
private layoutObjects;
|
|
1005
|
+
private postMeasureBreakWidth;
|
|
1006
|
+
private passCount;
|
|
1007
|
+
private needBeamsUpdate;
|
|
1008
|
+
private navigationSet;
|
|
1009
|
+
private isEndSong;
|
|
1010
|
+
private isEndSection;
|
|
1011
|
+
private endRepeatPlayCount;
|
|
1012
|
+
private endRepeatPlayCountText?;
|
|
1013
|
+
private staticObjectsCache;
|
|
1014
|
+
private lyricsObjectsCache;
|
|
1015
|
+
readonly mi: MMeasure;
|
|
1016
|
+
constructor(row: ObjScoreRow, options: MeasureOptions);
|
|
1017
|
+
getMusicInterface(): MMeasure;
|
|
1018
|
+
get doc(): ObjDocument;
|
|
1019
|
+
isPartialMeasure(): boolean;
|
|
1020
|
+
isUpBeat(): boolean;
|
|
1021
|
+
resetPassCount(): void;
|
|
1022
|
+
incPassCount(): void;
|
|
1023
|
+
getPassCount(): number;
|
|
1024
|
+
updateRunningArguments(runningArgs?: {
|
|
1025
|
+
diatonicId: number;
|
|
1026
|
+
stemDir: Stem;
|
|
1027
|
+
stringNumbers: StringNumber[];
|
|
1028
|
+
}[]): void;
|
|
1029
|
+
pick(x: number, y: number): MusicObject[];
|
|
1030
|
+
getMeasureNumber(): number;
|
|
1031
|
+
getColumns(): ReadonlyArray<ObjRhythmColumn>;
|
|
1032
|
+
getColumnCount(): number;
|
|
1033
|
+
getColumn(columnId: number): ObjRhythmColumn | undefined;
|
|
1034
|
+
isFirstMeasure(): boolean;
|
|
1035
|
+
isLastMeasure(): boolean;
|
|
1036
|
+
isFirstMeasureInRow(): boolean;
|
|
1037
|
+
isLastMeasureInRow(): boolean;
|
|
1038
|
+
getNextMeasure(): ObjMeasure | undefined;
|
|
1039
|
+
getPrevMeasure(): ObjMeasure | undefined;
|
|
1040
|
+
getKeySignature(): KeySignature;
|
|
1041
|
+
setKeySignature(...args: unknown[]): void;
|
|
1042
|
+
updateKeySignature(): void;
|
|
1043
|
+
getTimeSignature(): TimeSignature;
|
|
1044
|
+
setTimeSignature(timeSignature: TimeSignature): void;
|
|
1045
|
+
updateTimeSignature(): void;
|
|
1046
|
+
getTempo(): Tempo;
|
|
1047
|
+
setTempo(beatsPerMinute: number, beatLength?: NoteLength | NoteLengthStr): void;
|
|
1048
|
+
updateTempo(): void;
|
|
1049
|
+
hasPostMeasureBreak(): boolean;
|
|
1050
|
+
getPostMeasureBreakWidth(): number;
|
|
1051
|
+
private addLayoutObject;
|
|
1052
|
+
private forEachStaffGroup;
|
|
1053
|
+
addFermata(staffTabOrGroups: StaffTabOrGroups | undefined, fermata: Fermata): void;
|
|
1054
|
+
hasFermata(anchor: ObjRhythmColumn | ObjBarLineRight): boolean;
|
|
1055
|
+
addNavigation(staffTabOrGroups: StaffTabOrGroups | undefined, navigation: Navigation, ...args: unknown[]): void;
|
|
1056
|
+
hasNavigation(n: Navigation): boolean;
|
|
1057
|
+
addAnnotation(staffTabOrGroups: StaffTabOrGroups | undefined, annotation: Annotation, text: string): void;
|
|
1058
|
+
addLabel(staffTabOrGroups: StaffTabOrGroups | undefined, label: Label, text: string): void;
|
|
1059
|
+
addConnective(connective: Connective.Tie, tieSpan?: number | TieType, notAnchor?: NoteAnchor): void;
|
|
1060
|
+
addConnective(connective: Connective.Slur, slurSpan?: number, notAnchor?: NoteAnchor): void;
|
|
1061
|
+
addConnective(connective: Connective.Slide, notAnchor?: NoteAnchor): void;
|
|
1062
|
+
addExtension(extensionLength: number | NoteLengthStr | (NoteLengthStr | number)[], extensionVisible: boolean): void;
|
|
1063
|
+
private enableExtension;
|
|
1064
|
+
private disableExtension;
|
|
1065
|
+
getEnding(): ObjEnding | undefined;
|
|
1066
|
+
getEndRepeatPlayCount(): number;
|
|
1067
|
+
endSong(): void;
|
|
1068
|
+
hasEndSong(): boolean;
|
|
1069
|
+
endSection(): void;
|
|
1070
|
+
hasEndSection(): boolean;
|
|
1071
|
+
endRow(): void;
|
|
1072
|
+
private addRhythmSymbol;
|
|
1073
|
+
addNoteGroup(voiceId: VoiceId, notes: (Note | string)[], noteLength: NoteLength | NoteLengthStr, options?: NoteOptions, tupletRatio?: TupletRatio): ObjNoteGroup;
|
|
1074
|
+
addRest(voiceId: VoiceId, restLength: NoteLength | NoteLengthStr, options?: RestOptions, tupletRatio?: TupletRatio): ObjRest;
|
|
1075
|
+
addLyrics(staffTabOrGroups: StaffTabOrGroups | undefined, verse: VerseNumber, lyricsLength: NoteLength | NoteLengthStr, lyricsText: string, lyricsOptions: LyricsOptions): void;
|
|
1076
|
+
/**
|
|
1077
|
+
*
|
|
1078
|
+
* @param positionTicks - get ObjRhythmColumn with positionTicks. Insert new if necessary.
|
|
1079
|
+
* @returns
|
|
1080
|
+
*/
|
|
1081
|
+
private getRhythmColumn;
|
|
1082
|
+
getMeasureTicks(): number;
|
|
1083
|
+
getConsumedTicks(voiceId?: VoiceId): number;
|
|
1084
|
+
getColumnsContentRect(): AnchoredRect;
|
|
1085
|
+
getLeftSolidWidth(): number;
|
|
1086
|
+
getMinColumnsWidth(): number;
|
|
1087
|
+
getRightSolidWidth(): number;
|
|
1088
|
+
getTotalSolidWidth(): number;
|
|
1089
|
+
getMinWidth(): number;
|
|
1090
|
+
getStaffLineLeft(): number;
|
|
1091
|
+
getStaffLineRight(): number;
|
|
1092
|
+
getPrevLyricsObject(lyricsObj: ObjLyrics): ObjLyrics | undefined;
|
|
1093
|
+
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
1094
|
+
addStaticObject(line: ObjNotationLine, staticObj: MusicObject): void;
|
|
1095
|
+
removeLayoutObjects(musicObj: MusicObject): void;
|
|
1096
|
+
addConnectiveObject(connective: ObjConnective): void;
|
|
1097
|
+
removeConnectiveObjects(): void;
|
|
1098
|
+
createExtensions(): void;
|
|
1099
|
+
addBeamGroup(beam: ObjBeamGroup): void;
|
|
1100
|
+
requestBeamsUpdate(): void;
|
|
1101
|
+
private createOldStyleTriplets;
|
|
1102
|
+
getBeamGroups(): ReadonlyArray<ObjBeamGroup>;
|
|
1103
|
+
createBeams(): void;
|
|
1104
|
+
getBarLineLeft(): ObjBarLineLeft;
|
|
1105
|
+
getBarLineRight(): ObjBarLineRight;
|
|
1106
|
+
getVoiceSymbols(voiceId: VoiceId): ReadonlyArray<RhythmSymbol>;
|
|
1107
|
+
completeRests(voiceId?: VoiceId | VoiceId[]): void;
|
|
1108
|
+
requestLayout(): void;
|
|
1109
|
+
layout(ctx: RenderContext): void;
|
|
1110
|
+
layoutWidth(ctx: RenderContext, width: number): void;
|
|
1111
|
+
layoutConnectives(ctx: RenderContext): void;
|
|
1112
|
+
layoutBeams(ctx: RenderContext): void;
|
|
1113
|
+
alignStemsToBeams(): void;
|
|
1114
|
+
layoutDone(): void;
|
|
1115
|
+
updateRect(): void;
|
|
1116
|
+
offset(dx: number, dy: number): void;
|
|
1117
|
+
draw(ctx: RenderContext): void;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
declare class ScoreRowRegions {
|
|
1121
|
+
instrWidth: number;
|
|
1122
|
+
staffWidth: number;
|
|
1123
|
+
resetWidths(): void;
|
|
1124
|
+
addRowInstrWidth(w: number): void;
|
|
1125
|
+
addRowstaffWidth(w: number): void;
|
|
1126
|
+
get instrLeft(): number;
|
|
1127
|
+
get instrRight(): number;
|
|
1128
|
+
get staffLeft(): number;
|
|
1129
|
+
get staffRight(): number;
|
|
1130
|
+
get left(): number;
|
|
1131
|
+
get right(): number;
|
|
1132
|
+
get width(): number;
|
|
1133
|
+
}
|
|
1134
|
+
declare class ObjScoreRow extends MusicObject {
|
|
1135
|
+
readonly doc: ObjDocument;
|
|
1136
|
+
private readonly prevRow;
|
|
1137
|
+
private readonly scoreConfig;
|
|
1138
|
+
private nextRow?;
|
|
1139
|
+
private readonly notationLines;
|
|
1140
|
+
private readonly rowGroups;
|
|
1141
|
+
private readonly staves;
|
|
1142
|
+
private readonly tabs;
|
|
1143
|
+
private readonly measures;
|
|
1144
|
+
private rowGroupByLine;
|
|
1145
|
+
private needLayout;
|
|
1146
|
+
readonly mi: MScoreRow;
|
|
1147
|
+
constructor(doc: ObjDocument, prevRow: ObjScoreRow | undefined, scoreConfig: (StaffConfig | TabConfig)[]);
|
|
1148
|
+
getMusicInterface(): MScoreRow;
|
|
1149
|
+
private createNotationLines;
|
|
1150
|
+
getNotationLines(): ReadonlyArray<ObjNotationLine>;
|
|
1151
|
+
getRowGroups(): ReadonlyArray<ObjScoreRowGroup>;
|
|
1152
|
+
getRowGroupByLineId(id: number): ObjScoreRowGroup;
|
|
1153
|
+
findMatchingLine(line: ObjNotationLine): ObjNotationLine | undefined;
|
|
1154
|
+
get regions(): ScoreRowRegions;
|
|
1155
|
+
getStaves(): ReadonlyArray<ObjStaff>;
|
|
1156
|
+
getTabs(): ReadonlyArray<ObjTab>;
|
|
1157
|
+
get hasStaff(): boolean;
|
|
1158
|
+
get hasTab(): boolean;
|
|
1159
|
+
getTopStaff(): ObjStaff;
|
|
1160
|
+
getBottomStaff(): ObjStaff;
|
|
1161
|
+
getStaff(diatonicId: number): ObjStaff | undefined;
|
|
1162
|
+
resetLayoutGroups(ctx: RenderContext): void;
|
|
1163
|
+
layoutLayoutGroups(ctx: RenderContext): void;
|
|
1164
|
+
pick(x: number, y: number): MusicObject[];
|
|
1165
|
+
getConnectivesContentRect(): AnchoredRect;
|
|
1166
|
+
getDiatonicIdAt(y: number): number | undefined;
|
|
1167
|
+
addMeasure(m: ObjMeasure): void;
|
|
1168
|
+
getMeasures(): ReadonlyArray<ObjMeasure>;
|
|
1169
|
+
isFirstRow(): boolean;
|
|
1170
|
+
isLastRow(): boolean;
|
|
1171
|
+
getPrevRow(): ObjScoreRow | undefined;
|
|
1172
|
+
getNextRow(): ObjScoreRow | undefined;
|
|
1173
|
+
getFirstMeasure(): ObjMeasure | undefined;
|
|
1174
|
+
getLastMeasure(): ObjMeasure | undefined;
|
|
1175
|
+
solveAutoStemDir(symbols: ReadonlyArray<RhythmSymbol>): Stem.Up | Stem.Down;
|
|
1176
|
+
requestLayout(): void;
|
|
1177
|
+
layout(ctx: RenderContext): void;
|
|
1178
|
+
layoutStretch(ctx: RenderContext): void;
|
|
1179
|
+
updateRect(): void;
|
|
1180
|
+
alignStemsToBeams(): void;
|
|
1181
|
+
layoutSetNotationLines(ctx: RenderContext): void;
|
|
1182
|
+
layoutDone(): void;
|
|
1183
|
+
offset(dx: number, dy: number): void;
|
|
1184
|
+
getStaffLineLeft(): number | undefined;
|
|
1185
|
+
draw(ctx: RenderContext): void;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
declare class ObjDocument extends MusicObject {
|
|
1189
|
+
private needLayout;
|
|
1190
|
+
private ctx?;
|
|
1191
|
+
readonly regions: ScoreRowRegions;
|
|
1192
|
+
private readonly rows;
|
|
1193
|
+
private readonly measures;
|
|
1194
|
+
private measuresPerRow;
|
|
1195
|
+
private curScoreConfig;
|
|
1196
|
+
private header?;
|
|
1197
|
+
private newRowRequested;
|
|
1198
|
+
private allConnectiveProps;
|
|
1199
|
+
private staffGroups;
|
|
1200
|
+
private readonly mi;
|
|
1201
|
+
constructor();
|
|
1202
|
+
getMusicInterface(): MDocument;
|
|
1203
|
+
setScoreConfiguration(config: StaffPreset | ScoreConfiguration): void;
|
|
1204
|
+
setMeasuresPerRow(measuresPerRow: number): void;
|
|
1205
|
+
addConnectiveProps(connectiveProps: ConnectiveProps): void;
|
|
1206
|
+
setRenderContext(ctx?: RenderContext): void;
|
|
1207
|
+
setHeader(title?: string, composer?: string, arranger?: string): void;
|
|
1208
|
+
getTitle(): string | undefined;
|
|
1209
|
+
getComposer(): string | undefined;
|
|
1210
|
+
getArranger(): string | undefined;
|
|
1211
|
+
hasSingleMeasure(): boolean;
|
|
1212
|
+
getFirstMeasure(): ObjMeasure | undefined;
|
|
1213
|
+
getLastMeasure(): ObjMeasure | undefined;
|
|
1214
|
+
private addNewRow;
|
|
1215
|
+
getFirstRow(): ObjScoreRow;
|
|
1216
|
+
getLastRow(): ObjScoreRow;
|
|
1217
|
+
getRows(): ReadonlyArray<ObjScoreRow>;
|
|
1218
|
+
getMeasures(): ReadonlyArray<ObjMeasure>;
|
|
1219
|
+
requestNewRow(): void;
|
|
1220
|
+
addMeasure(measureOptions: MeasureOptions): ObjMeasure;
|
|
1221
|
+
addStaffGroup(groupName: string, layoutElements: number | string | (number | string)[], verticalPosition: VerticalPosition): void;
|
|
1222
|
+
getStaffGroup(groupName: string): StaffGroup | undefined;
|
|
1223
|
+
getVoiceSymbols(voiceId: VoiceId): ReadonlyArray<RhythmSymbol>;
|
|
1224
|
+
removeLayoutObjects(musicObj: MusicObject): void;
|
|
1225
|
+
private forEachMeasure;
|
|
1226
|
+
resetMeasures(): void;
|
|
1227
|
+
updateCursorRect(cursorRect?: Rect): void;
|
|
1228
|
+
requestLayout(): void;
|
|
1229
|
+
requestFullLayout(): void;
|
|
1230
|
+
layout(): void;
|
|
1231
|
+
offset(dx: number, dy: number): void;
|
|
1232
|
+
drawContent(): void;
|
|
1233
|
+
pickStaffPosAt(x: number, y: number): {
|
|
1234
|
+
scoreRow: ObjScoreRow;
|
|
1235
|
+
diatonicId: number;
|
|
1236
|
+
} | undefined;
|
|
1237
|
+
pick(x: number, y: number): MusicObject[];
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
declare enum ImageAsset {
|
|
1241
|
+
G_Clef = 0,
|
|
1242
|
+
F_Clef = 1
|
|
1243
|
+
}
|
|
1244
|
+
declare class RenderContext {
|
|
1245
|
+
private readonly mi;
|
|
1246
|
+
readonly devicePixelRatio: number;
|
|
1247
|
+
readonly fontSize: number;
|
|
1248
|
+
readonly unitSize: number;
|
|
1249
|
+
readonly _lineWidth: number;
|
|
1250
|
+
private scoreEventListener?;
|
|
1251
|
+
private canvas?;
|
|
1252
|
+
private ctx?;
|
|
1253
|
+
private mdoc?;
|
|
1254
|
+
private cursorRect?;
|
|
1255
|
+
private mousePos?;
|
|
1256
|
+
private curStaffPos?;
|
|
1257
|
+
private curObjects?;
|
|
1258
|
+
private hilightedStaffPos?;
|
|
1259
|
+
private hilightedObj?;
|
|
1260
|
+
private usingTouch;
|
|
1261
|
+
private onClickFn;
|
|
1262
|
+
private onMouseMoveFn;
|
|
1263
|
+
private onMouseLeaveFn;
|
|
1264
|
+
private onTouchEndFn;
|
|
1265
|
+
constructor(mi: MRenderContext);
|
|
1266
|
+
getMusicInterface(): MRenderContext;
|
|
1267
|
+
get doc(): ObjDocument | undefined;
|
|
1268
|
+
getImageAsset(asset: ImageAsset, color?: string): HTMLImageElement | undefined;
|
|
1269
|
+
private forceDraw;
|
|
1270
|
+
private onImageLoaded;
|
|
1271
|
+
setDocument(mdoc?: MDocument): void;
|
|
1272
|
+
setCanvas(canvas: HTMLCanvasElement): void;
|
|
1273
|
+
setScoreEventListener(fn: ScoreEventListener): void;
|
|
1274
|
+
needMouseInput(): boolean;
|
|
1275
|
+
getMousePos(e: MouseEvent): Vec;
|
|
1276
|
+
private updateCurStaffPos;
|
|
1277
|
+
private updateCurObjects;
|
|
1278
|
+
onClick(e: MouseEvent): void;
|
|
1279
|
+
onMouseMove(e: MouseEvent): void;
|
|
1280
|
+
onMouseLeave(e: MouseEvent): void;
|
|
1281
|
+
onTouchEnd(e: TouchEvent): void;
|
|
1282
|
+
hilightObject(obj?: MusicObject): void;
|
|
1283
|
+
hilightStaffPos(staffPos?: {
|
|
1284
|
+
scoreRow: ObjScoreRow;
|
|
1285
|
+
diatonicId: number;
|
|
1286
|
+
}): void;
|
|
1287
|
+
updateCursorRect(cursorRect: Rect | undefined): void;
|
|
1288
|
+
updateCanvasSize(): void;
|
|
1289
|
+
draw(): void;
|
|
1290
|
+
drawHilightStaffPosRect(): void;
|
|
1291
|
+
drawHilightObjectRect(): void;
|
|
1292
|
+
drawPlayCursor(): void;
|
|
1293
|
+
txFromScreenCoord(screenCoord: Vec): Vec;
|
|
1294
|
+
txToScreenCoord(coord: Vec): Vec;
|
|
1295
|
+
clearCanvas(): void;
|
|
1296
|
+
drawDebugRect(r: AnchoredRect | Rect): void;
|
|
1297
|
+
drawLedgerLines(staff: ObjStaff, diatonicId: number, x: number): void;
|
|
1298
|
+
getRestRect(restSize: number): AnchoredRect;
|
|
1299
|
+
drawRest(restSize: number, x: number, y: number): void;
|
|
1300
|
+
drawFlag(rect: Rect | AnchoredRect, dir: "up" | "down"): void;
|
|
1301
|
+
color(color: string): RenderContext;
|
|
1302
|
+
lineColor(color: string): RenderContext;
|
|
1303
|
+
fillColor(color: string): RenderContext;
|
|
1304
|
+
lineWidth(lineWidth?: number): RenderContext;
|
|
1305
|
+
font(font: string): RenderContext;
|
|
1306
|
+
beginPath(): RenderContext;
|
|
1307
|
+
stroke(): RenderContext;
|
|
1308
|
+
fill(): RenderContext;
|
|
1309
|
+
moveTo(x: number, y: number): RenderContext;
|
|
1310
|
+
lineTo(x: number, y: number): RenderContext;
|
|
1311
|
+
bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): RenderContext;
|
|
1312
|
+
quadraticCurveTo(x1: number, y1: number, x2: number, y2: number): RenderContext;
|
|
1313
|
+
fillRect(x: number, y: number, w: number, h: number): RenderContext;
|
|
1314
|
+
setLineDash(pattern: number[]): RenderContext;
|
|
1315
|
+
drawImage(img: CanvasImageSource, x: number, y: number, w: number, h: number): RenderContext;
|
|
1316
|
+
ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number): RenderContext;
|
|
1317
|
+
clip(): RenderContext;
|
|
1318
|
+
save(): RenderContext;
|
|
1319
|
+
restore(): RenderContext;
|
|
1320
|
+
rect(x: number, y: number, w: number, h: number): RenderContext;
|
|
1321
|
+
scale(x: number, y: number): RenderContext;
|
|
1322
|
+
strokeRect(x: number, y: number, w: number, h: number): RenderContext;
|
|
1323
|
+
fillText(text: string, x: number, y: number): RenderContext;
|
|
1324
|
+
getTextWidth(text: string, font: string): number;
|
|
1325
|
+
arc(x: number, y: number, radius: number, startRadians: number, endRadians: number): RenderContext;
|
|
1326
|
+
fillCircle(x: number, y: number, radius: number): RenderContext;
|
|
1327
|
+
strokeLine(startX: number, startY: number, endX: number, endY: number): RenderContext;
|
|
1328
|
+
strokePartialLine(startX: number, startY: number, endX: number, endY: number, startT: number, endT: number): RenderContext;
|
|
1329
|
+
drawBracket(rect: AnchoredRect, bracket: "(" | ")" | "[" | "]" | "{" | "}" | "<" | ">"): RenderContext;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
declare class ObjEnding extends MusicObject {
|
|
1333
|
+
readonly measure: ObjMeasure;
|
|
1334
|
+
readonly color: string;
|
|
1335
|
+
readonly passages: number[];
|
|
1336
|
+
private endingText;
|
|
1337
|
+
private shapeRects;
|
|
1338
|
+
readonly mi: MEnding;
|
|
1339
|
+
constructor(measure: ObjMeasure, color: string, passages: number[]);
|
|
1340
|
+
getMusicInterface(): MEnding;
|
|
1341
|
+
getShapeRects(): AnchoredRect[];
|
|
1342
|
+
isSingleMeasureEnding(): boolean;
|
|
1343
|
+
hasPassage(pass: number): boolean;
|
|
1344
|
+
getHighestPassage(): number;
|
|
1345
|
+
pick(x: number, y: number): MusicObject[];
|
|
1346
|
+
layout(ctx: RenderContext): void;
|
|
1347
|
+
layoutFitToMeasure(ctx: RenderContext): void;
|
|
1348
|
+
offset(dx: number, dy: number): void;
|
|
1349
|
+
draw(ctx: RenderContext): void;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
declare class ObjFermata extends MusicObject {
|
|
1353
|
+
readonly pos: VerticalPos;
|
|
1354
|
+
readonly color: string;
|
|
1355
|
+
readonly mi: MFermata;
|
|
1356
|
+
constructor(parent: ObjRhythmColumn | ObjBarLineRight, pos: VerticalPos, color: string);
|
|
1357
|
+
getMusicInterface(): MFermata;
|
|
1358
|
+
static getFermataPositions(anchor: ObjRhythmColumn | ObjBarLineRight): VerticalPos[];
|
|
1359
|
+
pick(x: number, y: number): MusicObject[];
|
|
1360
|
+
layout(ctx: RenderContext): void;
|
|
1361
|
+
offset(dx: number, dy: number): void;
|
|
1362
|
+
draw(ctx: RenderContext): void;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
declare class ObjTabRhythm extends MusicObject {
|
|
1366
|
+
readonly measure: ObjMeasure;
|
|
1367
|
+
readonly tab: ObjTab;
|
|
1368
|
+
private readonly voiceId;
|
|
1369
|
+
readonly mi: MTabRhythm;
|
|
1370
|
+
constructor(measure: ObjMeasure, tab: ObjTab);
|
|
1371
|
+
getMusicInterface(): MTabRhythm;
|
|
1372
|
+
get doc(): ObjDocument;
|
|
1373
|
+
pick(x: number, y: number): MusicObject[];
|
|
1374
|
+
layout(ctx: RenderContext): void;
|
|
1375
|
+
private hasTuplets;
|
|
1376
|
+
layoutFitToMeasure(ctx: RenderContext): void;
|
|
1377
|
+
offset(dx: number, dy: number): void;
|
|
1378
|
+
private readonly tupletPartsTextObjMap;
|
|
1379
|
+
draw(ctx: RenderContext): void;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
declare enum LayoutGroupId {
|
|
1383
|
+
TabRhythm = 0,
|
|
1384
|
+
Fermata = 1,
|
|
1385
|
+
NoteLabel = 2,
|
|
1386
|
+
Navigation = 3,
|
|
1387
|
+
Ending = 4,
|
|
1388
|
+
TempoAnnotation = 5,
|
|
1389
|
+
DynamicsAnnotation = 6,
|
|
1390
|
+
ChordLabel = 7,
|
|
1391
|
+
LyricsVerse1 = 8,
|
|
1392
|
+
LyricsVerse2 = 9,
|
|
1393
|
+
LyricsVerse3 = 10
|
|
1394
|
+
}
|
|
1395
|
+
declare enum VerticalPos {
|
|
1396
|
+
Above = 0,
|
|
1397
|
+
Below = 1
|
|
1398
|
+
}
|
|
1399
|
+
type LayoutableMusicObject = ObjText | ObjSpecialText | ObjExtensionLine | ObjFermata | ObjEnding | ObjLyrics | ObjTabRhythm;
|
|
1400
|
+
declare class StaffGroup {
|
|
1401
|
+
readonly groupName: string;
|
|
1402
|
+
readonly staffsTabsAndGroups: number | string | (number | string)[];
|
|
1403
|
+
readonly verticalPosition: VerticalPosition;
|
|
1404
|
+
constructor(groupName: string, staffsTabsAndGroups: number | string | (number | string)[], verticalPosition: VerticalPosition);
|
|
1405
|
+
}
|
|
1406
|
+
declare class LayoutObjectWrapper {
|
|
1407
|
+
readonly musicObj: LayoutableMusicObject;
|
|
1408
|
+
readonly line: ObjNotationLine;
|
|
1409
|
+
readonly layoutGroupId: LayoutGroupId;
|
|
1410
|
+
readonly verticalPos: VerticalPos;
|
|
1411
|
+
readonly anchor: MusicObject;
|
|
1412
|
+
readonly measure: ObjMeasure;
|
|
1413
|
+
readonly row: ObjScoreRow;
|
|
1414
|
+
readonly layoutGroup: LayoutGroup;
|
|
1415
|
+
private positionResolved;
|
|
1416
|
+
constructor(musicObj: LayoutableMusicObject, line: ObjNotationLine, layoutGroupId: LayoutGroupId, verticalPos: VerticalPos);
|
|
1417
|
+
resetPositionResolved(): void;
|
|
1418
|
+
setPositionResolved(): void;
|
|
1419
|
+
isPositionResolved(): boolean;
|
|
1420
|
+
resolveClosestToStaffY(ctx: RenderContext): number;
|
|
1421
|
+
layout(ctx: RenderContext): void;
|
|
1422
|
+
offset(dx: number, dy: number): void;
|
|
1423
|
+
setAnchorY(y: number): void;
|
|
1424
|
+
getRect(): AnchoredRect;
|
|
1425
|
+
}
|
|
1426
|
+
declare class LayoutGroup {
|
|
1427
|
+
readonly layoutGroupId: number;
|
|
1428
|
+
private readonly layoutObject;
|
|
1429
|
+
readonly rowAlign: boolean;
|
|
1430
|
+
readonly reserveSpace: boolean;
|
|
1431
|
+
readonly padding: number;
|
|
1432
|
+
constructor(layoutGroupId: number);
|
|
1433
|
+
getLayoutObjects(verticalPos: VerticalPos): Readonly<LayoutObjectWrapper[]>;
|
|
1434
|
+
add(layoutObj: LayoutObjectWrapper): void;
|
|
1435
|
+
remove(layoutObj: LayoutObjectWrapper): void;
|
|
1436
|
+
layout(ctx: RenderContext): void;
|
|
1437
|
+
getPadding(ctx: RenderContext): number;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
declare class MusicObjectLink {
|
|
1441
|
+
private head;
|
|
1442
|
+
private tail;
|
|
1443
|
+
constructor(head: MusicObject);
|
|
1444
|
+
getHead(): MusicObject;
|
|
1445
|
+
getTails(): ReadonlyArray<MusicObject>;
|
|
1446
|
+
addTail(obj: MusicObject): void;
|
|
1447
|
+
detachTail(obj: MusicObject): void;
|
|
1448
|
+
}
|
|
1449
|
+
declare abstract class MusicObject {
|
|
1450
|
+
protected readonly parent: MusicObject | undefined;
|
|
1451
|
+
private anchoredLayoutObjects;
|
|
1452
|
+
private link?;
|
|
1453
|
+
readonly userData: Record<string, unknown>;
|
|
1454
|
+
constructor(parent: MusicObject | undefined);
|
|
1455
|
+
abstract getMusicInterface(): MusicInterface;
|
|
1456
|
+
getParent(): MusicObject | undefined;
|
|
1457
|
+
protected rect: AnchoredRect;
|
|
1458
|
+
private needRectUpdate;
|
|
1459
|
+
requestRectUpdate(): void;
|
|
1460
|
+
updateRect(): void;
|
|
1461
|
+
forceRectUpdate(): void;
|
|
1462
|
+
getRect(): AnchoredRect;
|
|
1463
|
+
abstract offset(dx: number, dy: number): void;
|
|
1464
|
+
offsetX(dx: number): void;
|
|
1465
|
+
offsetY(dy: number): void;
|
|
1466
|
+
setLeft(x: number): void;
|
|
1467
|
+
setRight(x: number): void;
|
|
1468
|
+
setTop(y: number): void;
|
|
1469
|
+
setBottom(y: number): void;
|
|
1470
|
+
setAnchor(x: number, y: number): void;
|
|
1471
|
+
setAnchorX(x: number): void;
|
|
1472
|
+
setAnchorY(y: number): void;
|
|
1473
|
+
setCenter(x: number, y: number): void;
|
|
1474
|
+
setCenterX(x: number): void;
|
|
1475
|
+
setCenterY(y: number): void;
|
|
1476
|
+
/**
|
|
1477
|
+
* Most objects are simple rects in shape.
|
|
1478
|
+
* Some objects might be more complex consisting of multiple rects.
|
|
1479
|
+
* These rects are used to dodge overlapping objects.
|
|
1480
|
+
*
|
|
1481
|
+
* @returns Array of rects.
|
|
1482
|
+
*/
|
|
1483
|
+
getShapeRects(): AnchoredRect[];
|
|
1484
|
+
/**
|
|
1485
|
+
* Pick objects.
|
|
1486
|
+
*
|
|
1487
|
+
* @param x - X-coordinate.
|
|
1488
|
+
* @param y - Y-coordinate.
|
|
1489
|
+
* @returns Array of objects under (x, y)-coordinate in hierarchical order. Last object in array is the top-most object.
|
|
1490
|
+
*/
|
|
1491
|
+
abstract pick(x: number, y: number): MusicObject[];
|
|
1492
|
+
addAnchoredLayoutObject(layoutObj: LayoutObjectWrapper): void;
|
|
1493
|
+
getAnchoredLayoutObjects(): ReadonlyArray<LayoutObjectWrapper>;
|
|
1494
|
+
setLink(link: MusicObjectLink): void;
|
|
1495
|
+
getLink(): MusicObjectLink | undefined;
|
|
1496
|
+
isLinked(): boolean;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
declare class ObjArpeggio extends MusicObject {
|
|
1500
|
+
readonly col: ObjRhythmColumn;
|
|
1501
|
+
readonly line: ObjNotationLine;
|
|
1502
|
+
readonly arpeggioDir: Arpeggio;
|
|
1503
|
+
private topArrowHeight;
|
|
1504
|
+
private bottomArrowHeight;
|
|
1505
|
+
private cycleHeight;
|
|
1506
|
+
private numCycles;
|
|
1507
|
+
private color;
|
|
1508
|
+
readonly mi: MArpeggio;
|
|
1509
|
+
constructor(col: ObjRhythmColumn, line: ObjNotationLine, arpeggioDir: Arpeggio);
|
|
1510
|
+
getMusicInterface(): MArpeggio;
|
|
1511
|
+
pick(x: number, y: number): MusicObject[];
|
|
1512
|
+
layout(ctx: RenderContext): void;
|
|
1513
|
+
offset(dx: number, dy: number): void;
|
|
1514
|
+
draw(ctx: RenderContext): void;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
declare class ObjHeader extends MusicObject {
|
|
1518
|
+
readonly doc: ObjDocument;
|
|
1519
|
+
readonly title?: string | undefined;
|
|
1520
|
+
readonly composer?: string | undefined;
|
|
1521
|
+
readonly arranger?: string | undefined;
|
|
1522
|
+
private titleText?;
|
|
1523
|
+
private composerText?;
|
|
1524
|
+
private arrangerText?;
|
|
1525
|
+
readonly mi: MHeader;
|
|
1526
|
+
constructor(doc: ObjDocument, title?: string | undefined, composer?: string | undefined, arranger?: string | undefined);
|
|
1527
|
+
getMusicInterface(): MHeader;
|
|
1528
|
+
pick(x: number, y: number): MusicObject[];
|
|
1529
|
+
layout(ctx: RenderContext): void;
|
|
1530
|
+
offset(dx: number, dy: number): void;
|
|
1531
|
+
draw(ctx: RenderContext): void;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
declare class ObjImage extends MusicObject {
|
|
1535
|
+
readonly image: HTMLImageElement;
|
|
1536
|
+
readonly anchorX: number;
|
|
1537
|
+
readonly anchorY: number;
|
|
1538
|
+
readonly imageScale: number;
|
|
1539
|
+
readonly mi: MImage;
|
|
1540
|
+
constructor(parent: MusicObject, image: HTMLImageElement, anchorX: number, anchorY: number, imageScale: number);
|
|
1541
|
+
getMusicInterface(): MImage;
|
|
1542
|
+
pick(x: number, y: number): MusicObject[];
|
|
1543
|
+
layout(ctx: RenderContext): void;
|
|
1544
|
+
offset(dx: number, dy: number): void;
|
|
1545
|
+
draw(ctx: RenderContext): void;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
declare class ObjStaffSignature extends MusicObject {
|
|
1549
|
+
readonly measure: ObjMeasure;
|
|
1550
|
+
readonly staff: ObjStaff;
|
|
1551
|
+
private clefImage?;
|
|
1552
|
+
private eightBelowClef?;
|
|
1553
|
+
private measureNumber?;
|
|
1554
|
+
private ksNeutralizeAccidentals;
|
|
1555
|
+
private ksNewAccidentals;
|
|
1556
|
+
private beatCountText?;
|
|
1557
|
+
private beatSizeText?;
|
|
1558
|
+
private tempoText?;
|
|
1559
|
+
readonly mi: MStaffSignature;
|
|
1560
|
+
constructor(measure: ObjMeasure, staff: ObjStaff);
|
|
1561
|
+
get doc(): ObjDocument;
|
|
1562
|
+
getMusicInterface(): MStaffSignature;
|
|
1563
|
+
updateClefImage(ctx: RenderContext, showClef: boolean): void;
|
|
1564
|
+
updateMeasureNumber(showMeasureNumber: boolean): void;
|
|
1565
|
+
updateKeySignature(showKeySignature: boolean): void;
|
|
1566
|
+
updateTimeSignature(showTimeSignature: boolean): void;
|
|
1567
|
+
updateTempo(showTempo: boolean): void;
|
|
1568
|
+
private getAccidentalDiatonicId;
|
|
1569
|
+
pick(x: number, y: number): MusicObject[];
|
|
1570
|
+
layout(ctx: RenderContext): void;
|
|
1571
|
+
offset(dx: number, dy: number): void;
|
|
1572
|
+
draw(ctx: RenderContext): void;
|
|
1573
|
+
}
|
|
1574
|
+
declare class ObjTabSignature extends MusicObject {
|
|
1575
|
+
readonly measure: ObjMeasure;
|
|
1576
|
+
readonly tab: ObjTab;
|
|
1577
|
+
private measureNumber?;
|
|
1578
|
+
private beatCountText?;
|
|
1579
|
+
private beatSizeText?;
|
|
1580
|
+
private tempoText?;
|
|
1581
|
+
readonly mi: MTabSignature;
|
|
1582
|
+
constructor(measure: ObjMeasure, tab: ObjTab);
|
|
1583
|
+
getMusicInterface(): MTabSignature;
|
|
1584
|
+
get doc(): ObjDocument;
|
|
1585
|
+
updateMeasureNumber(showMeasureNumber: boolean): void;
|
|
1586
|
+
updateTimeSignature(showTimeSignature: boolean): void;
|
|
1587
|
+
updateTempo(showTempo: boolean): void;
|
|
1588
|
+
pick(x: number, y: number): MusicObject[];
|
|
1589
|
+
layout(ctx: RenderContext): void;
|
|
1590
|
+
offset(dx: number, dy: number): void;
|
|
1591
|
+
draw(ctx: RenderContext): void;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
/** Score event type. */
|
|
1595
|
+
type ScoreEventType = "enter" | "leave" | "click";
|
|
1596
|
+
/** Abstract score event class. */
|
|
1597
|
+
declare abstract class ScoreEvent {
|
|
1598
|
+
readonly type: ScoreEventType;
|
|
1599
|
+
/**
|
|
1600
|
+
* Create new score event instance.
|
|
1601
|
+
* @param type - Score event type.
|
|
1602
|
+
*/
|
|
1603
|
+
constructor(type: ScoreEventType);
|
|
1604
|
+
}
|
|
1605
|
+
/** Score staff position event for clicking/entering/leaving staff position (diatonic id) in staff notation line. */
|
|
1606
|
+
declare class ScoreStaffPosEvent extends ScoreEvent {
|
|
1607
|
+
readonly renderContext: MRenderContext;
|
|
1608
|
+
readonly scoreRow: MScoreRow;
|
|
1609
|
+
readonly diatonicId: number;
|
|
1610
|
+
/**
|
|
1611
|
+
* Create new score staff position event.
|
|
1612
|
+
* @param type - Score event type.
|
|
1613
|
+
* @param renderContext - Render context.
|
|
1614
|
+
* @param scoreRow - Score row.
|
|
1615
|
+
* @param diatonicId - Diatonic id that was clicked/entered/left.
|
|
1616
|
+
*/
|
|
1617
|
+
constructor(type: ScoreEventType, renderContext: MRenderContext, scoreRow: MScoreRow, diatonicId: number);
|
|
1618
|
+
}
|
|
1619
|
+
/** Score object event for clicking/entering/leaving score object. */
|
|
1620
|
+
declare class ScoreObjectEvent extends ScoreEvent {
|
|
1621
|
+
readonly renderContext: MRenderContext;
|
|
1622
|
+
readonly objects: MusicInterface[];
|
|
1623
|
+
/**
|
|
1624
|
+
* Create new score object event.
|
|
1625
|
+
* @param type - Score event type.
|
|
1626
|
+
* @param renderContext - Render context.
|
|
1627
|
+
* @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.
|
|
1628
|
+
*/
|
|
1629
|
+
constructor(type: ScoreEventType, renderContext: MRenderContext, objects: MusicInterface[]);
|
|
1630
|
+
/** Top object getter. */
|
|
1631
|
+
get topObject(): MusicInterface;
|
|
1632
|
+
/**
|
|
1633
|
+
* Find object.
|
|
1634
|
+
* @param fn - Compare function.
|
|
1635
|
+
* @returns - First object that matched compare function, or undefined if no match.
|
|
1636
|
+
*/
|
|
1637
|
+
findObject(fn: (obj: MusicInterface) => boolean): MusicInterface | undefined;
|
|
1638
|
+
}
|
|
1639
|
+
/** Score event listener type. */
|
|
1640
|
+
type ScoreEventListener = (event: ScoreEvent) => void;
|
|
1641
|
+
|
|
1642
|
+
/** Music player class. */
|
|
1643
|
+
declare class MPlayer {
|
|
1644
|
+
private static currentlyPlaying;
|
|
1645
|
+
private readonly player;
|
|
1646
|
+
/**
|
|
1647
|
+
* Create new music player.
|
|
1648
|
+
* @param doc - Music document to play.
|
|
1649
|
+
* @param playStateChangeListener - Play state change listener.
|
|
1650
|
+
*/
|
|
1651
|
+
constructor(doc: MDocument, playStateChangeListener?: PlayStateChangeListener);
|
|
1652
|
+
/**
|
|
1653
|
+
* Stop all playing.
|
|
1654
|
+
*/
|
|
1655
|
+
static stopAll(): void;
|
|
1656
|
+
/**
|
|
1657
|
+
* Playe attached document.
|
|
1658
|
+
* @returns - This player instance.
|
|
1659
|
+
*/
|
|
1660
|
+
play(): this;
|
|
1661
|
+
/**
|
|
1662
|
+
* Pause playback of attached document.
|
|
1663
|
+
* @returns - This player instance.
|
|
1664
|
+
*/
|
|
1665
|
+
pause(): this;
|
|
1666
|
+
/**
|
|
1667
|
+
* Stop playback of attached document.
|
|
1668
|
+
* @returns - This player instance.
|
|
1669
|
+
*/
|
|
1670
|
+
stop(): this;
|
|
1671
|
+
}
|
|
1672
|
+
/** Render context class. */
|
|
1673
|
+
declare class MRenderContext {
|
|
1674
|
+
private readonly ctx;
|
|
1675
|
+
/**
|
|
1676
|
+
* Create new render context instance.
|
|
1677
|
+
*/
|
|
1678
|
+
constructor();
|
|
1679
|
+
/**
|
|
1680
|
+
* Attach music document to this render context.
|
|
1681
|
+
* @param doc - Music document.
|
|
1682
|
+
* @returns - This render context instance.
|
|
1683
|
+
*/
|
|
1684
|
+
setDocument(doc?: MDocument): MRenderContext;
|
|
1685
|
+
/**
|
|
1686
|
+
* Set target canvas html element for this render context.
|
|
1687
|
+
* @param canvas - HTML canvas element or element id.
|
|
1688
|
+
* @returns - This render context instance.
|
|
1689
|
+
*/
|
|
1690
|
+
setCanvas(canvas: HTMLCanvasElement | string): MRenderContext;
|
|
1691
|
+
/**
|
|
1692
|
+
* Set score event listener.
|
|
1693
|
+
* @param scoreEventListener - Score event listener.
|
|
1694
|
+
*/
|
|
1695
|
+
setScoreEventListener(scoreEventListener: ScoreEventListener): void;
|
|
1696
|
+
/**
|
|
1697
|
+
* Draw given music object hilighted.
|
|
1698
|
+
* @param obj - Music object or undefined to remove hilighting.
|
|
1699
|
+
*/
|
|
1700
|
+
hilightObject(obj?: MusicInterface): void;
|
|
1701
|
+
/**
|
|
1702
|
+
* Draw given staff position hilighted.
|
|
1703
|
+
* @param staffPos - Staff position (score row and diatonic id) or undefined to remove hilighting.
|
|
1704
|
+
*/
|
|
1705
|
+
hilightStaffPos(staffPos?: {
|
|
1706
|
+
scoreRow: MScoreRow;
|
|
1707
|
+
diatonicId: number;
|
|
1708
|
+
}): void;
|
|
1709
|
+
/**
|
|
1710
|
+
* Draw contents of attached music document to attached canvas.
|
|
1711
|
+
*/
|
|
1712
|
+
draw(): void;
|
|
1713
|
+
}
|
|
1714
|
+
/** Playback buttons helper class. */
|
|
1715
|
+
declare class MPlaybackButtons {
|
|
1716
|
+
private playButton?;
|
|
1717
|
+
private stopButton?;
|
|
1718
|
+
private playStopButton?;
|
|
1719
|
+
private pauseButton?;
|
|
1720
|
+
private onPlay;
|
|
1721
|
+
private onStop;
|
|
1722
|
+
private onPlayStop;
|
|
1723
|
+
private onPause;
|
|
1724
|
+
private playLabel;
|
|
1725
|
+
private stopLabel;
|
|
1726
|
+
private pauseLabel;
|
|
1727
|
+
private playState;
|
|
1728
|
+
private player?;
|
|
1729
|
+
/**
|
|
1730
|
+
* Create new playback buttons helper class instance.
|
|
1731
|
+
*/
|
|
1732
|
+
constructor();
|
|
1733
|
+
/**
|
|
1734
|
+
* Attach music document whose playcak will be controlled by this playback buttons helper class instance.
|
|
1735
|
+
* @param doc - Music document.
|
|
1736
|
+
* @returns
|
|
1737
|
+
*/
|
|
1738
|
+
setDocument(doc?: MDocument): MPlaybackButtons;
|
|
1739
|
+
/**
|
|
1740
|
+
* Detach attached music document.
|
|
1741
|
+
*/
|
|
1742
|
+
detachDocument(): void;
|
|
1743
|
+
private updateButtons;
|
|
1744
|
+
/**
|
|
1745
|
+
* Set play button.
|
|
1746
|
+
* @param btn - HTML button element or element id.
|
|
1747
|
+
* @param btnLabel - Custom button label (e.g. "Play").
|
|
1748
|
+
* @returns - This playback buttons class instance.
|
|
1749
|
+
*/
|
|
1750
|
+
setPlayButton(btn: HTMLButtonElement | string, btnLabel?: string): MPlaybackButtons;
|
|
1751
|
+
/**
|
|
1752
|
+
* Set stop button.
|
|
1753
|
+
* @param btn - HTML button element or element id.
|
|
1754
|
+
* @param btnLabel - Custom button label (e.g. "Stop").
|
|
1755
|
+
* @returns - This playback buttons class instance.
|
|
1756
|
+
*/
|
|
1757
|
+
setStopButton(btn: HTMLButtonElement | string, btnLabel?: string): MPlaybackButtons;
|
|
1758
|
+
/**
|
|
1759
|
+
* Set play/stop button.
|
|
1760
|
+
* @param btn - HTML button element or element id.
|
|
1761
|
+
* @param playLabel - Custom button label for play action (e.g. "Play").
|
|
1762
|
+
* @param stopLabel - Custom button label for stop action (e.g. "Stop").
|
|
1763
|
+
* @returns - This playback buttons class instance.
|
|
1764
|
+
*/
|
|
1765
|
+
setPlayStopButton(btn: HTMLButtonElement | string, playLabel?: string, stopLabel?: string): MPlaybackButtons;
|
|
1766
|
+
/**
|
|
1767
|
+
* Set pause button.
|
|
1768
|
+
* @param btn - HTML button element or element id.
|
|
1769
|
+
* @param btnLabel - Custom button label (e.g. "Pause").
|
|
1770
|
+
* @returns - This playback buttons class instance.
|
|
1771
|
+
*/
|
|
1772
|
+
setPauseButton(btn: HTMLButtonElement | string, btnLabel?: string): MPlaybackButtons;
|
|
1773
|
+
private static savedOnClickListeners;
|
|
1774
|
+
private static removeOnClickListeners;
|
|
1775
|
+
private static addOnClickListener;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
/** Abstract music interface object class. */
|
|
1779
|
+
declare abstract class MusicInterface {
|
|
1780
|
+
readonly name: string;
|
|
1781
|
+
/**
|
|
1782
|
+
* Create new music interface object.
|
|
1783
|
+
* @param name - OBject name.
|
|
1784
|
+
*/
|
|
1785
|
+
constructor(name: string);
|
|
1786
|
+
/** @internal */
|
|
1787
|
+
abstract getMusicObject(): MusicObject;
|
|
1788
|
+
/**
|
|
1789
|
+
* Get parent object.
|
|
1790
|
+
* @returns - Parent object or undefined.
|
|
1791
|
+
*/
|
|
1792
|
+
getParent(): MusicInterface | undefined;
|
|
1793
|
+
}
|
|
1794
|
+
/** Accidental object. */
|
|
1795
|
+
declare class MAccidental extends MusicInterface {
|
|
1796
|
+
private readonly obj;
|
|
1797
|
+
/** Object name. */
|
|
1798
|
+
static readonly Name = "Accidental";
|
|
1799
|
+
/** @internal */
|
|
1800
|
+
constructor(obj: ObjAccidental);
|
|
1801
|
+
/** @internal */
|
|
1802
|
+
getMusicObject(): ObjAccidental;
|
|
1803
|
+
/**
|
|
1804
|
+
* Get accidental.
|
|
1805
|
+
* @returns - Accidental (e.g. 1 = #).
|
|
1806
|
+
*/
|
|
1807
|
+
getAccidental(): Accidental;
|
|
1808
|
+
}
|
|
1809
|
+
/** Connective object. */
|
|
1810
|
+
declare class MConnective extends MusicInterface {
|
|
1811
|
+
private readonly obj;
|
|
1812
|
+
/** Object name. */
|
|
1813
|
+
static readonly Name = "Connective";
|
|
1814
|
+
/** @internal */
|
|
1815
|
+
constructor(obj: ObjConnective);
|
|
1816
|
+
/** @internal */
|
|
1817
|
+
getMusicObject(): ObjConnective;
|
|
1818
|
+
}
|
|
1819
|
+
/** Arpeggio object. */
|
|
1820
|
+
declare class MArpeggio extends MusicInterface {
|
|
1821
|
+
private readonly obj;
|
|
1822
|
+
/** Object name. */
|
|
1823
|
+
static readonly Name = "Arpeggio";
|
|
1824
|
+
/** @internal */
|
|
1825
|
+
constructor(obj: ObjArpeggio);
|
|
1826
|
+
/** @internal */
|
|
1827
|
+
getMusicObject(): ObjArpeggio;
|
|
1828
|
+
/**
|
|
1829
|
+
* Get rhythm column this arpeggio is in.
|
|
1830
|
+
* @returns - Rhythm column.
|
|
1831
|
+
*/
|
|
1832
|
+
getRhythmColumn(): MRhythmColumn;
|
|
1833
|
+
/**
|
|
1834
|
+
* Get notation line this arpeggio is in.
|
|
1835
|
+
* @returns - Staff or tab object.
|
|
1836
|
+
*/
|
|
1837
|
+
getNotationLine(): MStaff | MTab;
|
|
1838
|
+
}
|
|
1839
|
+
/** Beam group object. */
|
|
1840
|
+
declare class MBeamGroup extends MusicInterface {
|
|
1841
|
+
private readonly obj;
|
|
1842
|
+
/** OBject name. */
|
|
1843
|
+
static readonly Name = "BeamGroup";
|
|
1844
|
+
/** @internal */
|
|
1845
|
+
constructor(obj: ObjBeamGroup);
|
|
1846
|
+
/** @internal */
|
|
1847
|
+
getMusicObject(): ObjBeamGroup;
|
|
1848
|
+
}
|
|
1849
|
+
/** Beam group object of certain staff. */
|
|
1850
|
+
declare class MStaffBeamGroup extends MusicInterface {
|
|
1851
|
+
private readonly obj;
|
|
1852
|
+
/** Object name. */
|
|
1853
|
+
static readonly Name = "StaffBeamGroup";
|
|
1854
|
+
/** @internal */
|
|
1855
|
+
constructor(obj: ObjStaffBeamGroup);
|
|
1856
|
+
/** @internal */
|
|
1857
|
+
getMusicObject(): ObjStaffBeamGroup;
|
|
1858
|
+
/**
|
|
1859
|
+
* Get staff this beam group is in.
|
|
1860
|
+
* @returns - Staff object.
|
|
1861
|
+
*/
|
|
1862
|
+
getStaff(): MStaff;
|
|
1863
|
+
}
|
|
1864
|
+
/** Document object. */
|
|
1865
|
+
declare class MDocument extends MusicInterface {
|
|
1866
|
+
private readonly obj;
|
|
1867
|
+
/** Object name. */
|
|
1868
|
+
static readonly Name = "Document";
|
|
1869
|
+
/** @internal */
|
|
1870
|
+
constructor(obj: ObjDocument);
|
|
1871
|
+
/** @internal */
|
|
1872
|
+
getMusicObject(): ObjDocument;
|
|
1873
|
+
/**
|
|
1874
|
+
* Get title.
|
|
1875
|
+
* @returns - Title string or undefined.
|
|
1876
|
+
*/
|
|
1877
|
+
getTitle(): string | undefined;
|
|
1878
|
+
/**
|
|
1879
|
+
* Get composer.
|
|
1880
|
+
* @returns - Composer string or undefined.
|
|
1881
|
+
*/
|
|
1882
|
+
getComposer(): string | undefined;
|
|
1883
|
+
/**
|
|
1884
|
+
* Get arranger.
|
|
1885
|
+
* @returns - Arranger string or undefined.
|
|
1886
|
+
*/
|
|
1887
|
+
getArranger(): string | undefined;
|
|
1888
|
+
/**
|
|
1889
|
+
* Get score rows.
|
|
1890
|
+
* @returns - Array or score rows.
|
|
1891
|
+
*/
|
|
1892
|
+
getRows(): ReadonlyArray<MScoreRow>;
|
|
1893
|
+
/**
|
|
1894
|
+
* Get measures.
|
|
1895
|
+
* @returns - Array of measures.
|
|
1896
|
+
*/
|
|
1897
|
+
getMeasures(): ReadonlyArray<MMeasure>;
|
|
1898
|
+
/**
|
|
1899
|
+
* Play this document.
|
|
1900
|
+
* @param playStateChangeListener - Play state change listener function or undefined.
|
|
1901
|
+
* @returns - Player instance.
|
|
1902
|
+
*/
|
|
1903
|
+
play(playStateChangeListener?: PlayStateChangeListener): MPlayer;
|
|
1904
|
+
}
|
|
1905
|
+
/** Ending object. */
|
|
1906
|
+
declare class MEnding extends MusicInterface {
|
|
1907
|
+
private readonly obj;
|
|
1908
|
+
/** Object name. */
|
|
1909
|
+
static readonly Name = "Ending";
|
|
1910
|
+
/** @internal */
|
|
1911
|
+
constructor(obj: ObjEnding);
|
|
1912
|
+
/** @internal */
|
|
1913
|
+
getMusicObject(): ObjEnding;
|
|
1914
|
+
/**
|
|
1915
|
+
* Get passages.
|
|
1916
|
+
* @returns - Array of passage numbers, e.g. passage number 1 means that this ending is played on first pass.
|
|
1917
|
+
*/
|
|
1918
|
+
getPassages(): ReadonlyArray<number>;
|
|
1919
|
+
/**
|
|
1920
|
+
* Has passage number?
|
|
1921
|
+
* @param passage - Passage number to find out.
|
|
1922
|
+
* @returns - Boolean whether this ending has asked passage number.
|
|
1923
|
+
*/
|
|
1924
|
+
hasPassage(passage: number): boolean;
|
|
1925
|
+
}
|
|
1926
|
+
/** Fermata object. */
|
|
1927
|
+
declare class MFermata extends MusicInterface {
|
|
1928
|
+
private readonly obj;
|
|
1929
|
+
/** OBject name. */
|
|
1930
|
+
static readonly Name = "Fermata";
|
|
1931
|
+
/** @internal */
|
|
1932
|
+
constructor(obj: ObjFermata);
|
|
1933
|
+
/** @internal */
|
|
1934
|
+
getMusicObject(): ObjFermata;
|
|
1935
|
+
}
|
|
1936
|
+
/** Header object. */
|
|
1937
|
+
declare class MHeader extends MusicInterface {
|
|
1938
|
+
private readonly obj;
|
|
1939
|
+
/** OBject name. */
|
|
1940
|
+
static readonly Name = "Header";
|
|
1941
|
+
/** @internal */
|
|
1942
|
+
constructor(obj: ObjHeader);
|
|
1943
|
+
/** @internal */
|
|
1944
|
+
getMusicObject(): ObjHeader;
|
|
1945
|
+
/**
|
|
1946
|
+
* Get title.
|
|
1947
|
+
* @returns - Title string or undefined.
|
|
1948
|
+
*/
|
|
1949
|
+
getTitle(): string | undefined;
|
|
1950
|
+
/**
|
|
1951
|
+
* Get composer.
|
|
1952
|
+
* @returns - Composer string or undefined.
|
|
1953
|
+
*/
|
|
1954
|
+
getComposer(): string | undefined;
|
|
1955
|
+
/**
|
|
1956
|
+
* Get arranger.
|
|
1957
|
+
* @returns - Arranger string or undefined.
|
|
1958
|
+
*/
|
|
1959
|
+
getArranger(): string | undefined;
|
|
1960
|
+
}
|
|
1961
|
+
/** Image object. */
|
|
1962
|
+
declare class MImage extends MusicInterface {
|
|
1963
|
+
private readonly obj;
|
|
1964
|
+
/** Object name. */
|
|
1965
|
+
static readonly Name = "Image";
|
|
1966
|
+
/** @internal */
|
|
1967
|
+
constructor(obj: ObjImage);
|
|
1968
|
+
/** @internal */
|
|
1969
|
+
getMusicObject(): ObjImage;
|
|
1970
|
+
}
|
|
1971
|
+
/** Measure object. */
|
|
1972
|
+
declare class MMeasure extends MusicInterface {
|
|
1973
|
+
private readonly obj;
|
|
1974
|
+
/** OBject name. */
|
|
1975
|
+
static readonly Name = "Measure";
|
|
1976
|
+
/** @internal */
|
|
1977
|
+
constructor(obj: ObjMeasure);
|
|
1978
|
+
/** @internal */
|
|
1979
|
+
getMusicObject(): ObjMeasure;
|
|
1980
|
+
/**
|
|
1981
|
+
* Get measure number.
|
|
1982
|
+
* @returns - Measure number starting from 1, or 0 if upbeat.
|
|
1983
|
+
*/
|
|
1984
|
+
getMeasureNumber(): number;
|
|
1985
|
+
/**
|
|
1986
|
+
* Get rhythm columns.
|
|
1987
|
+
* @returns - Array of rhythm columns.
|
|
1988
|
+
*/
|
|
1989
|
+
getRhythmColumns(): ReadonlyArray<MRhythmColumn>;
|
|
1990
|
+
/**
|
|
1991
|
+
* Get score row that this measure is in.
|
|
1992
|
+
* @returns - Score row.
|
|
1993
|
+
*/
|
|
1994
|
+
getRow(): MScoreRow;
|
|
1995
|
+
}
|
|
1996
|
+
/** Right bar line object. */
|
|
1997
|
+
declare class MBarLineRight extends MusicInterface {
|
|
1998
|
+
private readonly obj;
|
|
1999
|
+
/** OBject name. */
|
|
2000
|
+
static readonly Name = "BarLineRight";
|
|
2001
|
+
/** @internal */
|
|
2002
|
+
constructor(obj: ObjBarLineRight);
|
|
2003
|
+
/** @internal */
|
|
2004
|
+
getMusicObject(): ObjBarLineRight;
|
|
2005
|
+
}
|
|
2006
|
+
/** Left bar line object. */
|
|
2007
|
+
declare class MBarLineLeft extends MusicInterface {
|
|
2008
|
+
private readonly obj;
|
|
2009
|
+
/** Object name. */
|
|
2010
|
+
static readonly Name = "BarLineLeft";
|
|
2011
|
+
/** @internal */
|
|
2012
|
+
constructor(obj: ObjBarLineLeft);
|
|
2013
|
+
/** @internal */
|
|
2014
|
+
getMusicObject(): ObjBarLineLeft;
|
|
2015
|
+
}
|
|
2016
|
+
/** Bar line object for certain staff or tab. */
|
|
2017
|
+
declare class MStaffBarLine extends MusicInterface {
|
|
2018
|
+
private readonly obj;
|
|
2019
|
+
/** Object name. */
|
|
2020
|
+
static readonly Name = "StaffBarLine";
|
|
2021
|
+
/** @internal */
|
|
2022
|
+
constructor(obj: ObjStaffBarLine);
|
|
2023
|
+
/** @internal */
|
|
2024
|
+
getMusicObject(): ObjStaffBarLine;
|
|
2025
|
+
/**
|
|
2026
|
+
* Get parent bar line object.
|
|
2027
|
+
* @returns - Parent bar line object.
|
|
2028
|
+
*/
|
|
2029
|
+
getBarLine(): MBarLineLeft | MBarLineRight;
|
|
2030
|
+
/**
|
|
2031
|
+
* Get staff or tab this bar lien object is in.
|
|
2032
|
+
* @returns - Staff or tab.
|
|
2033
|
+
*/
|
|
2034
|
+
getNotationLine(): MStaff | MTab;
|
|
2035
|
+
}
|
|
2036
|
+
/** Note group object. */
|
|
2037
|
+
declare class MNoteGroup extends MusicInterface {
|
|
2038
|
+
private readonly obj;
|
|
2039
|
+
/** Object name. */
|
|
2040
|
+
static readonly Name = "NoteGroup";
|
|
2041
|
+
/** @internal */
|
|
2042
|
+
constructor(obj: ObjNoteGroup);
|
|
2043
|
+
/** @internal */
|
|
2044
|
+
getMusicObject(): ObjNoteGroup;
|
|
2045
|
+
/**
|
|
2046
|
+
* Get notes of this note group.
|
|
2047
|
+
* @returns - Array of Note instances.
|
|
2048
|
+
*/
|
|
2049
|
+
getNotes(): ReadonlyArray<Note>;
|
|
2050
|
+
/**
|
|
2051
|
+
* Get rhythm props of this note group.
|
|
2052
|
+
* @returns - Rhythm props.
|
|
2053
|
+
*/
|
|
2054
|
+
getRhythmProps(): RhythmProps;
|
|
2055
|
+
/**
|
|
2056
|
+
* Get rhythm column this note group is in.
|
|
2057
|
+
* @returns - Rhythm column.
|
|
2058
|
+
*/
|
|
2059
|
+
getRhythmColumn(): MRhythmColumn;
|
|
2060
|
+
/**
|
|
2061
|
+
* Get the measure this note group is in.
|
|
2062
|
+
* @returns - Measure.
|
|
2063
|
+
*/
|
|
2064
|
+
getMeasure(): MMeasure;
|
|
2065
|
+
}
|
|
2066
|
+
/** Note group object of certain staff. */
|
|
2067
|
+
declare class MStaffNoteGroup extends MusicInterface {
|
|
2068
|
+
private readonly obj;
|
|
2069
|
+
/** Object name. */
|
|
2070
|
+
static readonly Name = "StaffNoteGroup";
|
|
2071
|
+
/** @internal */
|
|
2072
|
+
constructor(obj: ObjStaffNoteGroup);
|
|
2073
|
+
/** @internal */
|
|
2074
|
+
getMusicObject(): ObjStaffNoteGroup;
|
|
2075
|
+
/**
|
|
2076
|
+
* Get parent note group.
|
|
2077
|
+
* @returns - Parent note group.
|
|
2078
|
+
*/
|
|
2079
|
+
getNoteGroup(): MNoteGroup;
|
|
2080
|
+
/**
|
|
2081
|
+
* Get rhythm column this note group is in.
|
|
2082
|
+
* @returns - Rhythm column.
|
|
2083
|
+
*/
|
|
2084
|
+
getRhythmColumn(): MRhythmColumn;
|
|
2085
|
+
/**
|
|
2086
|
+
* Get the measure this note group is in.
|
|
2087
|
+
* @returns - Measure.
|
|
2088
|
+
*/
|
|
2089
|
+
getMeasure(): MMeasure;
|
|
2090
|
+
/**
|
|
2091
|
+
* Get staff notation line this note group is in.
|
|
2092
|
+
* @returns - Staff object.
|
|
2093
|
+
*/
|
|
2094
|
+
getStaff(): MStaff;
|
|
2095
|
+
}
|
|
2096
|
+
/** Note group object of certain tab. Contains fret numbers for tab. */
|
|
2097
|
+
declare class MTabNoteGroup extends MusicInterface {
|
|
2098
|
+
private readonly obj;
|
|
2099
|
+
/** OBject name. */
|
|
2100
|
+
static readonly Name = "TabNoteGroup";
|
|
2101
|
+
/** @internal */
|
|
2102
|
+
constructor(obj: ObjTabNoteGroup);
|
|
2103
|
+
/** @internal */
|
|
2104
|
+
getMusicObject(): ObjTabNoteGroup;
|
|
2105
|
+
/**
|
|
2106
|
+
* Get parent note group.
|
|
2107
|
+
* @returns - Parent note group.
|
|
2108
|
+
*/
|
|
2109
|
+
getNoteGroup(): MNoteGroup;
|
|
2110
|
+
/**
|
|
2111
|
+
* Get rhythm column this note group is in.
|
|
2112
|
+
* @returns - Rhythm column.
|
|
2113
|
+
*/
|
|
2114
|
+
getRhythmColumn(): MRhythmColumn;
|
|
2115
|
+
/**
|
|
2116
|
+
* Get the measure this note group is in.
|
|
2117
|
+
* @returns - Measure.
|
|
2118
|
+
*/
|
|
2119
|
+
getMeasure(): MMeasure;
|
|
2120
|
+
/**
|
|
2121
|
+
* Get guitar tab this note group is in.
|
|
2122
|
+
* @returns - Tab object.
|
|
2123
|
+
*/
|
|
2124
|
+
getTab(): MTab;
|
|
2125
|
+
}
|
|
2126
|
+
/** Rest object. */
|
|
2127
|
+
declare class MRest extends MusicInterface {
|
|
2128
|
+
private readonly obj;
|
|
2129
|
+
/** OBject name. */
|
|
2130
|
+
static readonly Name = "Rest";
|
|
2131
|
+
/** @internal */
|
|
2132
|
+
constructor(obj: ObjRest);
|
|
2133
|
+
/** @internal */
|
|
2134
|
+
getMusicObject(): ObjRest;
|
|
2135
|
+
/**
|
|
2136
|
+
* Get rhythm props of this rest.
|
|
2137
|
+
* @returns - Rhythm props.
|
|
2138
|
+
*/
|
|
2139
|
+
getRhythmProps(): RhythmProps;
|
|
2140
|
+
/**
|
|
2141
|
+
* Get rhythm column this rest is in.
|
|
2142
|
+
* @returns - Rhythm column.
|
|
2143
|
+
*/
|
|
2144
|
+
getRhythmColumn(): MRhythmColumn;
|
|
2145
|
+
/**
|
|
2146
|
+
* Get the measure this rest is in.
|
|
2147
|
+
* @returns - Measure.
|
|
2148
|
+
*/
|
|
2149
|
+
getMeasure(): MMeasure;
|
|
2150
|
+
}
|
|
2151
|
+
/** Rest object for certain tab. */
|
|
2152
|
+
declare class MStaffRest extends MusicInterface {
|
|
2153
|
+
private readonly obj;
|
|
2154
|
+
/** Object name. */
|
|
2155
|
+
static readonly Name = "StaffRest";
|
|
2156
|
+
/** @internal */
|
|
2157
|
+
constructor(obj: ObjStaffRest);
|
|
2158
|
+
/** @internal */
|
|
2159
|
+
getMusicObject(): ObjStaffRest;
|
|
2160
|
+
/**
|
|
2161
|
+
* Get parent rest object.
|
|
2162
|
+
* @returns - Parent rest object.
|
|
2163
|
+
*/
|
|
2164
|
+
getRest(): MRest;
|
|
2165
|
+
/**
|
|
2166
|
+
* Get rhythm column this rest is in.
|
|
2167
|
+
* @returns - Rhythm column.
|
|
2168
|
+
*/
|
|
2169
|
+
getRhythmColumn(): MRhythmColumn;
|
|
2170
|
+
/**
|
|
2171
|
+
* Get the measure this rest is in.
|
|
2172
|
+
* @returns - Measure.
|
|
2173
|
+
*/
|
|
2174
|
+
getMeasure(): MMeasure;
|
|
2175
|
+
/**
|
|
2176
|
+
* Get staff notation line this rest is in.
|
|
2177
|
+
* @returns - Staff object.
|
|
2178
|
+
*/
|
|
2179
|
+
getStaff(): MStaff;
|
|
2180
|
+
}
|
|
2181
|
+
/** Rhythm column object. */
|
|
2182
|
+
declare class MRhythmColumn extends MusicInterface {
|
|
2183
|
+
private readonly obj;
|
|
2184
|
+
/** OBject name. */
|
|
2185
|
+
static readonly Name = "RhythmColumn";
|
|
2186
|
+
/** @internal */
|
|
2187
|
+
constructor(obj: ObjRhythmColumn);
|
|
2188
|
+
/** @internal */
|
|
2189
|
+
getMusicObject(): ObjRhythmColumn;
|
|
2190
|
+
/**
|
|
2191
|
+
* Get symbol (note group or rest) of this column for given voice id.
|
|
2192
|
+
* @param voiceId - Voice id.
|
|
2193
|
+
* @returns - Note group, rest or undefined.
|
|
2194
|
+
*/
|
|
2195
|
+
getRhythmSymbol(voiceId: VoiceId): MNoteGroup | MRest | undefined;
|
|
2196
|
+
/**
|
|
2197
|
+
* Get the measure this rhythm column is in.
|
|
2198
|
+
* @returns - Measure.
|
|
2199
|
+
*/
|
|
2200
|
+
getMeasure(): MMeasure;
|
|
2201
|
+
}
|
|
2202
|
+
/** Score row object. */
|
|
2203
|
+
declare class MScoreRow extends MusicInterface {
|
|
2204
|
+
private readonly obj;
|
|
2205
|
+
/** Object name. */
|
|
2206
|
+
static readonly Name = "ScoreRow";
|
|
2207
|
+
/** @internal */
|
|
2208
|
+
constructor(obj: ObjScoreRow);
|
|
2209
|
+
/** @internal */
|
|
2210
|
+
getMusicObject(): ObjScoreRow;
|
|
2211
|
+
/**
|
|
2212
|
+
* Parent music document.
|
|
2213
|
+
* @returns - Parent music document.
|
|
2214
|
+
*/
|
|
2215
|
+
getDocument(): MDocument;
|
|
2216
|
+
/**
|
|
2217
|
+
* Get measures of this score row.
|
|
2218
|
+
* @returns - Array of measures.
|
|
2219
|
+
*/
|
|
2220
|
+
getMeasures(): ReadonlyArray<MMeasure>;
|
|
2221
|
+
/**
|
|
2222
|
+
* Get notation lines (staves and tabs) of this score row.
|
|
2223
|
+
* @returns - Array of staves and tabs.
|
|
2224
|
+
*/
|
|
2225
|
+
getNotationLines(): ReadonlyArray<MStaff | MTab>;
|
|
2226
|
+
}
|
|
2227
|
+
/** Score row group object. */
|
|
2228
|
+
declare class MScoreRowGroup extends MusicInterface {
|
|
2229
|
+
private readonly obj;
|
|
2230
|
+
/** Object name. */
|
|
2231
|
+
static readonly Name = "ScoreRowGroup";
|
|
2232
|
+
/** @internal */
|
|
2233
|
+
constructor(obj: ObjScoreRowGroup);
|
|
2234
|
+
/** @internal */
|
|
2235
|
+
getMusicObject(): ObjScoreRowGroup;
|
|
2236
|
+
/**
|
|
2237
|
+
* Get instrument name.
|
|
2238
|
+
* @returns - instrument name.
|
|
2239
|
+
*/
|
|
2240
|
+
getInstrument(): string;
|
|
2241
|
+
}
|
|
2242
|
+
/** Staff notatio line object. */
|
|
2243
|
+
declare class MStaff extends MusicInterface {
|
|
2244
|
+
private readonly obj;
|
|
2245
|
+
/** Object name. */
|
|
2246
|
+
static readonly Name = "Staff";
|
|
2247
|
+
/** @internal */
|
|
2248
|
+
constructor(obj: ObjStaff);
|
|
2249
|
+
/** @internal */
|
|
2250
|
+
getMusicObject(): ObjStaff;
|
|
2251
|
+
/**
|
|
2252
|
+
* Get index of this staff in score row.
|
|
2253
|
+
* @returns - Index (0=top notation line).
|
|
2254
|
+
*/
|
|
2255
|
+
getId(): number;
|
|
2256
|
+
/**
|
|
2257
|
+
* Get name of this staff.
|
|
2258
|
+
* @returns - Staff name.
|
|
2259
|
+
*/
|
|
2260
|
+
getName(): string | undefined;
|
|
2261
|
+
/**
|
|
2262
|
+
* Get the score row this staff is in.
|
|
2263
|
+
* @returns - Score row.
|
|
2264
|
+
*/
|
|
2265
|
+
getRow(): MScoreRow;
|
|
2266
|
+
}
|
|
2267
|
+
/** Guitar tab notation line object. */
|
|
2268
|
+
declare class MTab extends MusicInterface {
|
|
2269
|
+
private readonly obj;
|
|
2270
|
+
/** Object name. */
|
|
2271
|
+
static readonly Name = "Tab";
|
|
2272
|
+
/** @internal */
|
|
2273
|
+
constructor(obj: ObjTab);
|
|
2274
|
+
/** @internal */
|
|
2275
|
+
getMusicObject(): ObjTab;
|
|
2276
|
+
/**
|
|
2277
|
+
* Get index of this guitar tab in score row.
|
|
2278
|
+
* @returns - Index (0=top notation line).
|
|
2279
|
+
*/
|
|
2280
|
+
getId(): number;
|
|
2281
|
+
/**
|
|
2282
|
+
* Get name of this guitar tab.
|
|
2283
|
+
* @returns - Staff name.
|
|
2284
|
+
*/
|
|
2285
|
+
getName(): string | undefined;
|
|
2286
|
+
/**
|
|
2287
|
+
* Get the score row this guitar tab is in.
|
|
2288
|
+
* @returns - Score row.
|
|
2289
|
+
*/
|
|
2290
|
+
getRow(): MScoreRow;
|
|
2291
|
+
}
|
|
2292
|
+
/** Staff signature object contains clef, key signature, time signature, tempo and measure number, all optional depending on measure. */
|
|
2293
|
+
declare class MStaffSignature extends MusicInterface {
|
|
2294
|
+
private readonly obj;
|
|
2295
|
+
/** Object name. */
|
|
2296
|
+
static readonly Name = "StaffSignature";
|
|
2297
|
+
/** @internal */
|
|
2298
|
+
constructor(obj: ObjStaffSignature);
|
|
2299
|
+
/** @internal */
|
|
2300
|
+
getMusicObject(): ObjStaffSignature;
|
|
2301
|
+
/**
|
|
2302
|
+
* Get staff notation line this signature is in.
|
|
2303
|
+
* @returns - Staff object.
|
|
2304
|
+
*/
|
|
2305
|
+
getStaff(): MStaff;
|
|
2306
|
+
}
|
|
2307
|
+
/** Tab signature object contains time signature, tempo and measure number, all optional depending on measure. */
|
|
2308
|
+
declare class MTabSignature extends MusicInterface {
|
|
2309
|
+
private readonly obj;
|
|
2310
|
+
/** Object name. */
|
|
2311
|
+
static readonly Name = "TabSignature";
|
|
2312
|
+
/** @internal */
|
|
2313
|
+
constructor(obj: ObjTabSignature);
|
|
2314
|
+
/** @internal */
|
|
2315
|
+
getMusicObject(): ObjTabSignature;
|
|
2316
|
+
/**
|
|
2317
|
+
* Get tab notation line this signature is in.
|
|
2318
|
+
* @returns - Tab object.
|
|
2319
|
+
*/
|
|
2320
|
+
getTab(): MTab;
|
|
2321
|
+
}
|
|
2322
|
+
/** Tab rhythm object. */
|
|
2323
|
+
declare class MTabRhythm extends MusicInterface {
|
|
2324
|
+
private readonly obj;
|
|
2325
|
+
/** Object name. */
|
|
2326
|
+
static readonly Name = "TabRhythm";
|
|
2327
|
+
/** @internal */
|
|
2328
|
+
constructor(obj: ObjTabRhythm);
|
|
2329
|
+
/** @internal */
|
|
2330
|
+
getMusicObject(): ObjTabRhythm;
|
|
2331
|
+
/**
|
|
2332
|
+
* Get measure.
|
|
2333
|
+
* @returns - Measure.
|
|
2334
|
+
*/
|
|
2335
|
+
getMeasure(): MMeasure;
|
|
2336
|
+
/**
|
|
2337
|
+
* Get tab.
|
|
2338
|
+
* @returns - Tab.
|
|
2339
|
+
*/
|
|
2340
|
+
getTab(): MTab;
|
|
2341
|
+
}
|
|
2342
|
+
/** Spacial text object contains text and possibly special symbols (e.g. Segno or Coda). */
|
|
2343
|
+
declare class MSpecialText extends MusicInterface {
|
|
2344
|
+
private readonly obj;
|
|
2345
|
+
/** Object name. */
|
|
2346
|
+
static readonly Name = "SpecialText";
|
|
2347
|
+
/** @internal */
|
|
2348
|
+
constructor(obj: ObjSpecialText);
|
|
2349
|
+
/** @internal */
|
|
2350
|
+
getMusicObject(): ObjSpecialText;
|
|
2351
|
+
/**
|
|
2352
|
+
* Get text content.
|
|
2353
|
+
* @returns - Text content.
|
|
2354
|
+
*/
|
|
2355
|
+
getText(): string;
|
|
2356
|
+
}
|
|
2357
|
+
/** Text object. */
|
|
2358
|
+
declare class MText extends MusicInterface {
|
|
2359
|
+
private readonly obj;
|
|
2360
|
+
/** Object name. */
|
|
2361
|
+
static readonly Name = "Text";
|
|
2362
|
+
/** @internal */
|
|
2363
|
+
constructor(obj: ObjText);
|
|
2364
|
+
/** @internal */
|
|
2365
|
+
getMusicObject(): ObjText;
|
|
2366
|
+
/**
|
|
2367
|
+
* Get text content.
|
|
2368
|
+
* @returns - Text content.
|
|
2369
|
+
*/
|
|
2370
|
+
getText(): string;
|
|
2371
|
+
}
|
|
2372
|
+
/** Lyrics object. */
|
|
2373
|
+
declare class MLyrics extends MusicInterface {
|
|
2374
|
+
private readonly obj;
|
|
2375
|
+
/** Object name. */
|
|
2376
|
+
static readonly Name = "Lyrics";
|
|
2377
|
+
/** @internal */
|
|
2378
|
+
constructor(obj: ObjLyrics);
|
|
2379
|
+
/** @internal */
|
|
2380
|
+
getMusicObject(): ObjLyrics;
|
|
2381
|
+
/**
|
|
2382
|
+
* Get lyrics text.
|
|
2383
|
+
* @returns - Lyrics text.
|
|
2384
|
+
*/
|
|
2385
|
+
getText(): string;
|
|
2386
|
+
}
|
|
2387
|
+
/** Extension line object. */
|
|
2388
|
+
declare class MExtensionLine extends MusicInterface {
|
|
2389
|
+
private readonly obj;
|
|
2390
|
+
/** OBject name. */
|
|
2391
|
+
static readonly Name = "ExtensionLine";
|
|
2392
|
+
/** @internal */
|
|
2393
|
+
constructor(obj: ObjExtensionLine);
|
|
2394
|
+
/** @internal */
|
|
2395
|
+
getMusicObject(): ObjExtensionLine;
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
export { MTabSignature as $, type AnnotationText as A, MHeader as B, Connective as C, MImage as D, MMeasure as E, Fermata as F, MBarLineRight as G, MBarLineLeft as H, MStaffBarLine as I, MNoteGroup as J, MStaffNoteGroup as K, type LyricsOptions as L, MDocument as M, type NoteOptions as N, MTabNoteGroup as O, MRest as P, MStaffRest as Q, type RestOptions as R, StaffPreset as S, type TupletOptions as T, MRhythmColumn as U, type VoiceId as V, MScoreRow as W, MScoreRowGroup 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, MPlaybackButtons as r, MusicInterface as s, MAccidental as t, MConnective as u, MArpeggio as v, MBeamGroup as w, MStaffBeamGroup as x, MEnding as y, MFermata as z };
|