@tspro/web-music-score 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +18 -9
- package/dist/audio/index.d.mts +40 -1
- package/dist/audio/index.d.ts +40 -1
- package/dist/audio/index.js +1 -1
- package/dist/audio/index.mjs +2 -2
- package/dist/audio-cg/index.d.mts +3 -0
- package/dist/audio-cg/index.d.ts +3 -0
- package/dist/audio-cg/index.js +1 -1
- package/dist/audio-cg/index.mjs +2 -2
- package/dist/{chunk-D643HZHM.mjs → chunk-MHNTJ6FU.mjs} +2 -2
- package/dist/core/index.d.mts +12 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +3 -2
- package/dist/core/index.mjs +4 -3
- package/dist/guitar-CaZJDA05.d.ts +35 -0
- package/dist/guitar-DdexKdN6.d.mts +35 -0
- package/dist/iife/index.global.js +11 -11
- package/dist/{interface-XoKiryoV.d.mts → music-objects-DIaqNPjs.d.mts} +616 -114
- package/dist/{interface-7k8qGG44.d.ts → music-objects-xJJNlFwK.d.ts} +616 -114
- package/dist/note-eA2xPPiG.d.mts +294 -0
- package/dist/note-eA2xPPiG.d.ts +294 -0
- package/dist/pieces/index.d.mts +22 -3
- package/dist/pieces/index.d.ts +22 -3
- package/dist/pieces/index.js +5 -2
- package/dist/pieces/index.mjs +6 -3
- package/dist/react-ui/index.d.mts +166 -17
- package/dist/react-ui/index.d.ts +166 -17
- package/dist/react-ui/index.js +78 -1
- package/dist/react-ui/index.mjs +79 -2
- package/dist/scale-DQNA-YLD.d.ts +230 -0
- package/dist/scale-bnD0WnMV.d.mts +230 -0
- package/dist/score/index.d.mts +315 -47
- package/dist/score/index.d.ts +315 -47
- package/dist/score/index.js +684 -173
- package/dist/score/index.mjs +683 -174
- package/dist/tempo-Bp1UzsrZ.d.ts +399 -0
- package/dist/tempo-S85Q7uJA.d.mts +399 -0
- package/dist/theory/index.d.mts +29 -13
- package/dist/theory/index.d.ts +29 -13
- package/dist/theory/index.js +433 -42
- package/dist/theory/index.mjs +432 -43
- package/package.json +3 -2
- package/dist/guitar-DggbM2UL.d.mts +0 -17
- package/dist/guitar-cNmE-EvH.d.ts +0 -17
- package/dist/note-BFa43I86.d.mts +0 -85
- package/dist/note-CcVdUFqS.d.ts +0 -85
- package/dist/scale-C2pCNxdE.d.mts +0 -75
- package/dist/scale-CvPbJvfN.d.ts +0 -75
- package/dist/tempo-BAYoZ_Li.d.mts +0 -187
- package/dist/tempo-r2sb6Ku2.d.ts +0 -187
package/dist/score/index.d.ts
CHANGED
|
@@ -1,63 +1,209 @@
|
|
|
1
|
-
import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, V as VoiceId, T as TupletOptions, F as Fermata, b as StaffTabOrGroups, c as Navigation, A as Annotation, L as Label, C as Connective,
|
|
2
|
-
export {
|
|
3
|
-
import { N as Note } from '../note-
|
|
4
|
-
import { S as ScaleType, c as Scale } from '../scale-
|
|
5
|
-
import { N as NoteLength,
|
|
1
|
+
import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, V as VoiceId, T as TupletOptions, F as Fermata, b as StaffTabOrGroups, c as Navigation, A as AnnotationText, d as Annotation, L as Label, C as Connective, e as TieType, f as NoteAnchor, g as VerticalPosition } from '../music-objects-xJJNlFwK.js';
|
|
2
|
+
export { a6 as Arpeggio, $ as Clef, D as DivRect, a8 as DynamicsAnnotation, q as MAccidental, s as MArpeggio, E as MBarLineLeft, B as MBarLineRight, t as MBeamGroup, r as MConnective, v as MEnding, _ as MExtensionLine, w as MFermata, x as MHeader, y as MImage, z as MMeasure, H as MNoteGroup, o as MPlaybackButtons, m as MPlayer, n as MRenderer, K as MRest, P as MRhythmColumn, Q as MScoreRow, X as MSignature, Y as MSpecialText, U as MStaff, u as MStaffBeamGroup, I as MStaffNoteGroup, O as MStaffRest, G as MStaffTabBarLine, W as MTab, J as MTabNoteGroup, Z as MText, p as MusicInterface, aa as PlayState, ab as PlayStateChangeListener, i as ScoreEvent, l as ScoreEventListener, h as ScoreEventType, k as ScoreObjectEvent, j as ScoreStaffPosEvent, a0 as StaffConfig, a7 as StaffTabOrGroup, a5 as Stem, a3 as StringNumber, a1 as TabConfig, a9 as TempoAnnotation, a4 as getStringNumbers, a2 as getVoiceIds } from '../music-objects-xJJNlFwK.js';
|
|
3
|
+
import { N as Note } from '../note-eA2xPPiG.js';
|
|
4
|
+
import { S as ScaleType, c as Scale } from '../scale-DQNA-YLD.js';
|
|
5
|
+
import { N as NoteLength, i as NoteLengthStr, K as KeySignature, b as TimeSignature, T as TimeSignatures, B as BeamGrouping, k as TupletRatio } from '../tempo-Bp1UzsrZ.js';
|
|
6
6
|
import '@tspro/ts-utils-lib';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
cresc = "cresc.",
|
|
10
|
-
decresc = "decresc.",
|
|
11
|
-
dim = "dim.",
|
|
12
|
-
ppp = "ppp",
|
|
13
|
-
pp = "pp",
|
|
14
|
-
p = "p",
|
|
15
|
-
mp = "mp",
|
|
16
|
-
m = "m",
|
|
17
|
-
mf = "mf",
|
|
18
|
-
f = "f",
|
|
19
|
-
ff = "ff",
|
|
20
|
-
fff = "fff"
|
|
21
|
-
}
|
|
22
|
-
declare enum TempoAnnotations {
|
|
23
|
-
accel = "accel.",
|
|
24
|
-
rit = "rit.",
|
|
25
|
-
a_tempo = "a tempo"
|
|
26
|
-
}
|
|
27
|
-
type AnnotationsType = `${DynamicsAnnotations}` | `${TempoAnnotations}`;
|
|
28
|
-
|
|
8
|
+
/** Tuplet builder type. */
|
|
29
9
|
type TupletBuilder = {
|
|
10
|
+
/**
|
|
11
|
+
* Add note to a tuplet.
|
|
12
|
+
* @param note - Note instance of Note or string (e.g. "D4").
|
|
13
|
+
* @param noteLength - Note length (e.g. "4n").
|
|
14
|
+
* @param options - Note options.
|
|
15
|
+
* @returns - This tuplet builder object.
|
|
16
|
+
*/
|
|
30
17
|
addNote: (note: Note | string, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions) => TupletBuilder;
|
|
18
|
+
/**
|
|
19
|
+
* Add chord to a tuplet.
|
|
20
|
+
* @param notes - Array of notes, each instance of Note or string (e.g. "D4").
|
|
21
|
+
* @param noteLength - Note length (e.g. "4n").
|
|
22
|
+
* @param options - Note options.
|
|
23
|
+
* @returns - This tuplet builder object.
|
|
24
|
+
*/
|
|
31
25
|
addChord: (notes: (Note | string)[], noteLength: NoteLength | NoteLengthStr, options?: NoteOptions) => TupletBuilder;
|
|
26
|
+
/**
|
|
27
|
+
* Add rest to a tuplet.
|
|
28
|
+
* @param restLength - Rest length (e.g. "4n").
|
|
29
|
+
* @param options - Rest options.
|
|
30
|
+
* @returns - This tuplet builder object.
|
|
31
|
+
*/
|
|
32
32
|
addRest: (restLength: NoteLength | NoteLengthStr, options?: RestOptions) => TupletBuilder;
|
|
33
33
|
};
|
|
34
|
+
/** Etension builder type. */
|
|
34
35
|
type ExtensionBuilder = {
|
|
36
|
+
/**
|
|
37
|
+
* Increase extension length by note length multiplied by number of notes.
|
|
38
|
+
* @param noteLength - Length of note (e.g. "2n").
|
|
39
|
+
* @param noteCount - Number of note lengths (default = 1).
|
|
40
|
+
* @returns - this extension builder object.
|
|
41
|
+
*/
|
|
35
42
|
notes: (noteLength: NoteLength | NoteLengthStr, noteCount?: number) => ExtensionBuilder;
|
|
43
|
+
/**
|
|
44
|
+
* Increase length of extension length by given number of measures.
|
|
45
|
+
* @param measureCount - Number of measures.
|
|
46
|
+
* @returns - this extension builder object.
|
|
47
|
+
*/
|
|
36
48
|
measures: (measureCount: number) => ExtensionBuilder;
|
|
49
|
+
/**
|
|
50
|
+
* Create as long extension line as possible.
|
|
51
|
+
* @returns - this extension builder object.
|
|
52
|
+
*/
|
|
37
53
|
infinity: () => ExtensionBuilder;
|
|
54
|
+
/**
|
|
55
|
+
* Create an invisible extension.
|
|
56
|
+
* @returns - this extension builder object.
|
|
57
|
+
*/
|
|
38
58
|
hide: () => ExtensionBuilder;
|
|
39
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Document builder class.
|
|
62
|
+
* <pre>
|
|
63
|
+
* // Example
|
|
64
|
+
* let doc = new Score.DocumentBuilder()
|
|
65
|
+
* .addScoreConfiguration({ type: "staff", clef: "G", isOctavewDown: true })
|
|
66
|
+
* .setMeasuresPerRow(4)
|
|
67
|
+
* .addMeasure()
|
|
68
|
+
* .addNote(1, "C3", "4n")
|
|
69
|
+
* .addChord(1, ["C3", "E3", "G3"], "4n").addLabel("chord", "C")
|
|
70
|
+
* .addRest(1, "4n")
|
|
71
|
+
* // etc.
|
|
72
|
+
* .getDEocument();
|
|
73
|
+
* </pre>
|
|
74
|
+
*/
|
|
40
75
|
declare class DocumentBuilder {
|
|
41
76
|
private readonly doc;
|
|
77
|
+
/**
|
|
78
|
+
* Create new document builder instance.
|
|
79
|
+
*/
|
|
42
80
|
constructor();
|
|
81
|
+
/**
|
|
82
|
+
* Use staff preset values to set score confguration. This call will request new score row.
|
|
83
|
+
* @param staffPreset - Staff preset (e.g. "treble").
|
|
84
|
+
*/
|
|
43
85
|
setScoreConfiguration(staffPreset: StaffPreset | `${StaffPreset}`): DocumentBuilder;
|
|
86
|
+
/**
|
|
87
|
+
* Use staff preset values to set score confguration. This call will request new score row.
|
|
88
|
+
* @param config - Score configuration (e.g. { type: "staff", clef: "G", isOctavewDown: true }).
|
|
89
|
+
*/
|
|
44
90
|
setScoreConfiguration(config: ScoreConfiguration): DocumentBuilder;
|
|
45
91
|
private getMeasure;
|
|
92
|
+
/**
|
|
93
|
+
* Get music document after finished building.
|
|
94
|
+
* @returns - Music document.
|
|
95
|
+
*/
|
|
46
96
|
getDocument(): MDocument;
|
|
97
|
+
/**
|
|
98
|
+
* Set header texts.
|
|
99
|
+
* @param title - Title of this docmument/musical piece.
|
|
100
|
+
* @param composer - Composer of this document/musical piece.
|
|
101
|
+
* @param arranger - Arranger of this document/musical piece.
|
|
102
|
+
* @returns - This document builder instance.
|
|
103
|
+
*/
|
|
47
104
|
setHeader(title?: string, composer?: string, arranger?: string): DocumentBuilder;
|
|
105
|
+
/**
|
|
106
|
+
* Automatically limit number of measures per score row.
|
|
107
|
+
* @param measuresPerRow - Number of measures per row. Must be integer >=1 or Infinity.
|
|
108
|
+
* @returns - This document builder instance.
|
|
109
|
+
*/
|
|
48
110
|
setMeasuresPerRow(measuresPerRow: number): DocumentBuilder;
|
|
111
|
+
/**
|
|
112
|
+
* Add new measure.
|
|
113
|
+
* @returns - This document builder instance.
|
|
114
|
+
*/
|
|
49
115
|
addMeasure(): DocumentBuilder;
|
|
116
|
+
/**
|
|
117
|
+
* Set key signature for current measure and forward.
|
|
118
|
+
* @param tonic - Tonic note (e.g. "C").
|
|
119
|
+
* @param scaleType - Scale type (e.g. string "Major" or ScaleType.Major).
|
|
120
|
+
* @returns - This document builder instance.
|
|
121
|
+
*/
|
|
50
122
|
setKeySignature(tonic: string, scaleType: ScaleType | `${ScaleType}`): DocumentBuilder;
|
|
123
|
+
/**
|
|
124
|
+
* Set key signature for current measure and forward.
|
|
125
|
+
* @param keySignature - KeySignature object instance.
|
|
126
|
+
* @returns - This document builder instance.
|
|
127
|
+
*/
|
|
51
128
|
setKeySignature(keySignature: KeySignature): DocumentBuilder;
|
|
129
|
+
/**
|
|
130
|
+
* Set key signature for current measure and forward.
|
|
131
|
+
* @param keySignature - Key signature string (e.g. "C Major").
|
|
132
|
+
* @returns - This document builder instance.
|
|
133
|
+
*/
|
|
52
134
|
setKeySignature(keySignature: string): DocumentBuilder;
|
|
135
|
+
/**
|
|
136
|
+
* Set key signature for current measure and forward.
|
|
137
|
+
* @param scale - Scale object instance.
|
|
138
|
+
* @returns - This document builder instance.
|
|
139
|
+
*/
|
|
53
140
|
setKeySignature(scale: Scale): DocumentBuilder;
|
|
54
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Set time signature for current measure and forward.
|
|
143
|
+
* @param timeSignature - TimeSignature object instance.
|
|
144
|
+
* @returns - This document builder instance.
|
|
145
|
+
*/
|
|
146
|
+
setTimeSignature(timeSignature: TimeSignature): DocumentBuilder;
|
|
147
|
+
/**
|
|
148
|
+
* Set time signature for current measure and forward.
|
|
149
|
+
* @param timeSignature - TimeSignatures enum value or string (e.g. "3/4").
|
|
150
|
+
* @param beamGrouping - Beam grouping (e.g. "3-2" for time signature "5/8").
|
|
151
|
+
* @returns - This document builder instance.
|
|
152
|
+
*/
|
|
153
|
+
setTimeSignature(timeSignature: TimeSignatures | `${TimeSignatures}`, beamGrouping?: BeamGrouping | `${BeamGrouping}`): DocumentBuilder;
|
|
154
|
+
/**
|
|
155
|
+
* Set time signature for current measure and forward.
|
|
156
|
+
* @param beatCount - Beat count of time signature (e.g. 3 in "3/4").
|
|
157
|
+
* @param beatSize - Beat size of time signature (e.g. 4 in "3/4").
|
|
158
|
+
* @param beamGrouping - Beam grouping (e.g. "3-2" for time signature "5/8").
|
|
159
|
+
* @returns - This document builder instance.
|
|
160
|
+
*/
|
|
161
|
+
setTimeSignature(beatCount: number, beatSize: number, beamGrouping?: BeamGrouping | `${BeamGrouping}`): DocumentBuilder;
|
|
162
|
+
/**
|
|
163
|
+
* Set tempo.
|
|
164
|
+
* @param beatsPerMinute - Tempo beats per minute.
|
|
165
|
+
* @returns - This document builder instance.
|
|
166
|
+
*/
|
|
55
167
|
setTempo(beatsPerMinute: number): DocumentBuilder;
|
|
168
|
+
/**
|
|
169
|
+
* Set tempo.
|
|
170
|
+
* @param beatsPerMinute - Tempo beats per minute.
|
|
171
|
+
* @param beatLength - Length of one beat.
|
|
172
|
+
* @returns - This document builder instance.
|
|
173
|
+
*/
|
|
56
174
|
setTempo(beatsPerMinute: number, beatLength: NoteLength | NoteLengthStr): DocumentBuilder;
|
|
57
|
-
/**
|
|
175
|
+
/**
|
|
176
|
+
* @deprecated - Use dotted beatLength instead (e.g. "4..").
|
|
177
|
+
* @param beatsPerMinute - Tempo beats per minute.
|
|
178
|
+
* @param beatLength - Length of one beat.
|
|
179
|
+
* @param dotted - Dot count of length of one beat.
|
|
180
|
+
* @returns - This document builder instance.
|
|
181
|
+
*/
|
|
58
182
|
setTempo(beatsPerMinute: number, beatLength: NoteLength | NoteLengthStr, dotted: boolean | number): DocumentBuilder;
|
|
183
|
+
/**
|
|
184
|
+
* Add note o current measure.
|
|
185
|
+
* @param voiceId - Voice id to add note to.
|
|
186
|
+
* @param note - Note instance of Note or string (e.g. "D4").
|
|
187
|
+
* @param noteLength - Note length (e.g. "4n").
|
|
188
|
+
* @param options - Note options.
|
|
189
|
+
* @returns - This document builder instance.
|
|
190
|
+
*/
|
|
59
191
|
addNote(voiceId: number, note: Note | string, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions): DocumentBuilder;
|
|
192
|
+
/**
|
|
193
|
+
* @param voiceId - Voice id to add chord to.
|
|
194
|
+
* @param notes - Array of notes, each instance of Note or string (e.g. "D4").
|
|
195
|
+
* @param noteLength - Note length (e.g. "4n").
|
|
196
|
+
* @param options - Note options.
|
|
197
|
+
* @returns - This document builder instance.
|
|
198
|
+
*/
|
|
60
199
|
addChord(voiceId: number, notes: (Note | string)[], noteLength: NoteLength | NoteLengthStr, options?: NoteOptions): DocumentBuilder;
|
|
200
|
+
/**
|
|
201
|
+
*
|
|
202
|
+
* @param voiceId - Voice id to add rest to.
|
|
203
|
+
* @param restLength - Rest length (e.g. "4n").
|
|
204
|
+
* @param options - Rest options.
|
|
205
|
+
* @returns - This document builder instance.
|
|
206
|
+
*/
|
|
61
207
|
addRest(voiceId: number, restLength: NoteLength | NoteLengthStr, options?: RestOptions): DocumentBuilder;
|
|
62
208
|
/**
|
|
63
209
|
* Usage:
|
|
@@ -69,66 +215,188 @@ declare class DocumentBuilder {
|
|
|
69
215
|
* });
|
|
70
216
|
* </pre>
|
|
71
217
|
*
|
|
72
|
-
* @param voiceId
|
|
218
|
+
* @param voiceId - Voice id to add tuplet to.
|
|
73
219
|
* @param tupletRatio - You can also use Theory.Tuplet presets (e.g. Theory.Tuplet.Triplet).
|
|
74
|
-
* @param tupletBuilder
|
|
75
|
-
* @returns
|
|
220
|
+
* @param tupletBuilder - Tuplet builder function to build tuplet.
|
|
221
|
+
* @returns - This document builder instance.
|
|
76
222
|
*/
|
|
77
223
|
addTuplet(voiceId: VoiceId, tupletRatio: TupletRatio & TupletOptions, tupletBuilder: (notes: TupletBuilder) => void): DocumentBuilder;
|
|
78
224
|
private addFermataInternal;
|
|
225
|
+
/**
|
|
226
|
+
* Add fermata to current measure.
|
|
227
|
+
* @param fermata - Fermata type (e.g. "atNote" or Fermata.AtrNote).
|
|
228
|
+
* @returns - This document builder instance.
|
|
229
|
+
*/
|
|
79
230
|
addFermata(fermata?: Fermata | `${Fermata}`): DocumentBuilder;
|
|
80
|
-
/**
|
|
231
|
+
/**
|
|
232
|
+
* Add Fermata to current measure to given staff/tab/group.
|
|
233
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
234
|
+
* @param fermata - Fermata type (e.g. "atNote" or Fermata.AtrNote).
|
|
235
|
+
* @returns - This document builder instance.
|
|
236
|
+
*/
|
|
81
237
|
addFermataTo(staffTabOrGroups: StaffTabOrGroups, fermata?: Fermata | `${Fermata}`): DocumentBuilder;
|
|
82
238
|
private addNavigationInternal;
|
|
239
|
+
/**
|
|
240
|
+
* Add navigation element to current measure.
|
|
241
|
+
* @param navigation - Navigation element (e.g. "D.S. al Fine" or Navigation.DS_al_Fine).
|
|
242
|
+
* @returns - This document builder instance.
|
|
243
|
+
*/
|
|
83
244
|
addNavigation(navigation: Navigation | `${Navigation}`): DocumentBuilder;
|
|
245
|
+
/**
|
|
246
|
+
* Add end repeat navigation element to current measure.
|
|
247
|
+
* @param navigation - End repeat navigation element ("endRepeat" or Navigation.EndRepeat).
|
|
248
|
+
* @param playCount - Number of times to play the ended repeat section.
|
|
249
|
+
* @returns - This document builder instance.
|
|
250
|
+
*/
|
|
84
251
|
addNavigation(navigation: Navigation.EndRepeat | `${Navigation.EndRepeat}`, playCount: number): DocumentBuilder;
|
|
252
|
+
/**
|
|
253
|
+
* Add ending navigation element to current measure.
|
|
254
|
+
* @param navigation - Ending navigation element ("ending" or Navigation.Ending).
|
|
255
|
+
* @param passages - Passage numbers for measure marked by this ending is played.
|
|
256
|
+
* @returns - This document builder instance.
|
|
257
|
+
*/
|
|
85
258
|
addNavigation(navigation: Navigation.Ending | `${Navigation.Ending}`, ...passages: number[]): DocumentBuilder;
|
|
86
|
-
/**
|
|
259
|
+
/**
|
|
260
|
+
* Add navigation element to current measure to given staff/tab/group.
|
|
261
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
262
|
+
* @param navigation
|
|
263
|
+
* @returns - This document builder instance.
|
|
264
|
+
*/
|
|
87
265
|
addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation | `${Navigation}`): DocumentBuilder;
|
|
88
|
-
/**
|
|
266
|
+
/**
|
|
267
|
+
* Add end repeat navigation element to current measure to given staff/tab/group.
|
|
268
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
269
|
+
* @param navigation
|
|
270
|
+
* @param playCount
|
|
271
|
+
* @returns - This document builder instance.
|
|
272
|
+
*/
|
|
89
273
|
addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation.EndRepeat | `${Navigation.EndRepeat}`, playCount: number): DocumentBuilder;
|
|
90
|
-
/**
|
|
274
|
+
/**
|
|
275
|
+
* Add ending navigation element to current measure to given staff/tab/group.
|
|
276
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
277
|
+
* @param navigation
|
|
278
|
+
* @param passages
|
|
279
|
+
* @returns - This document builder instance.
|
|
280
|
+
*/
|
|
91
281
|
addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation.Ending | `${Navigation.Ending}`, ...passages: number[]): DocumentBuilder;
|
|
92
282
|
private addAnnotationInternal;
|
|
93
|
-
|
|
283
|
+
/**
|
|
284
|
+
* Add annotation text to column of last added note/chord/rest in current measure.
|
|
285
|
+
* @param text - Known annotation text (e.g. "pp").
|
|
286
|
+
* @returns - This document builder instance.
|
|
287
|
+
*/
|
|
288
|
+
addAnnotation(text: AnnotationText): DocumentBuilder;
|
|
289
|
+
/**
|
|
290
|
+
* Add annotation text to column of last added note/chord/rest in current measure.
|
|
291
|
+
* @param annotation - Annotation type (e.g. "tempo" or Annotation.Tempo).
|
|
292
|
+
* @param text - Annotation text (unrestricted).
|
|
293
|
+
* @returns - This document builder instance.
|
|
294
|
+
*/
|
|
94
295
|
addAnnotation(annotation: Annotation | `${Annotation}`, text: string): DocumentBuilder;
|
|
95
|
-
/**
|
|
96
|
-
|
|
97
|
-
|
|
296
|
+
/**
|
|
297
|
+
* Add annotation text to column of last added note/chord/rest in current measure to given staff/tab/group.
|
|
298
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
299
|
+
* @param text - Known annotation text (e.g. "pp").
|
|
300
|
+
* @returns - This document builder instance.
|
|
301
|
+
*/
|
|
302
|
+
addAnnotationTo(staffTabOrGroups: StaffTabOrGroups, text: AnnotationText): DocumentBuilder;
|
|
303
|
+
/**
|
|
304
|
+
* Add annotation text to column of last added note/chord/rest in current measure to given staff/tab/group.
|
|
305
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
306
|
+
* @param annotation - Annotation type (e.g. "tempo" or Annotation.Tempo).
|
|
307
|
+
* @param text - Annotation text (unrestricted).
|
|
308
|
+
* @returns - This document builder instance.
|
|
309
|
+
*/
|
|
98
310
|
addAnnotationTo(staffTabOrGroups: StaffTabOrGroups, annotation: Annotation | `${Annotation}`, text: string): DocumentBuilder;
|
|
99
311
|
private addLabelInternal;
|
|
312
|
+
/**
|
|
313
|
+
* Add label text to column of last added note/chord/rest in current measure.
|
|
314
|
+
* @param label - Label type (e.g. "chord" or Label.Chord).
|
|
315
|
+
* @param text - label text (e.g. "Am").
|
|
316
|
+
* @returns - This document builder instance.
|
|
317
|
+
*/
|
|
100
318
|
addLabel(label: Label | `${Label}`, text: string): DocumentBuilder;
|
|
101
|
-
/**
|
|
319
|
+
/**
|
|
320
|
+
* Add label text to column of last added note/chord/rest in current measure to given staff/tab/group.
|
|
321
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
322
|
+
* @param label - Label type (e.g. "chord" or Label.Chord).
|
|
323
|
+
* @param text - label text (e.g. "Am").
|
|
324
|
+
* @returns - This document builder instance.
|
|
325
|
+
*/
|
|
102
326
|
addLabelTo(staffTabOrGroups: StaffTabOrGroups, label: Label | `${Label}`, text: string): DocumentBuilder;
|
|
327
|
+
/**
|
|
328
|
+
* Add tie starting from last added note/chord.
|
|
329
|
+
* @param connective - Connective type ("tie" or Connective.Tie).
|
|
330
|
+
* @param tieSpan - How many notes across this tie spans.
|
|
331
|
+
* @param notAnchor - Anchor point for note and this tie.
|
|
332
|
+
* @returns - This document builder instance.
|
|
333
|
+
*/
|
|
103
334
|
addConnective(connective: Connective.Tie | `${Connective.Tie}`, tieSpan?: number | TieType | `${TieType}`, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
|
|
335
|
+
/**
|
|
336
|
+
* Add slur starting from last added note/chord.
|
|
337
|
+
* @param connective - Connective type ("slur" or Connective.Slur).
|
|
338
|
+
* @param slurSpan - How many notes across this slur spans.
|
|
339
|
+
* @param notAnchor - Anchor point for note and this slur.
|
|
340
|
+
* @returns - This document builder instance.
|
|
341
|
+
*/
|
|
104
342
|
addConnective(connective: Connective.Slur | `${Connective.Slur}`, slurSpan?: number, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
|
|
343
|
+
/**
|
|
344
|
+
* Add slide starting from last added note/chord.
|
|
345
|
+
* @param connective - Connective type ("slide" or Connective.Slide).
|
|
346
|
+
* @param notAnchor - Anchor point for note and this slide.
|
|
347
|
+
* @returns - This document builder instance.
|
|
348
|
+
*/
|
|
105
349
|
addConnective(connective: Connective.Slide | `${Connective.Slide}`, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
|
|
106
350
|
/**
|
|
107
|
-
*
|
|
351
|
+
* Add extension line to previously added annotation or label element.
|
|
108
352
|
* <pre>
|
|
353
|
+
* // Example
|
|
109
354
|
* addExtension(ext => ext.notes("1n", 2)) // length is 2 whole notes
|
|
110
355
|
* addExtension(ext => ext.measures(3).hide()) // length is 3 measures, hidden
|
|
111
356
|
* addExtension(ext => ext.measures(1).notes("8n")) // length is 1 measure + 1 eigth note
|
|
112
357
|
* addExtension(ext => ext.infinity()) // length is as long as possible
|
|
113
358
|
* </pre>
|
|
114
|
-
* @param
|
|
115
|
-
* @
|
|
116
|
-
* @returns
|
|
359
|
+
* @param extensionBuilder - Extension builder function used to build exstension.
|
|
360
|
+
* @returns - This document builder instance.
|
|
117
361
|
*/
|
|
118
362
|
addExtension(extensionBuilder?: (ext: ExtensionBuilder) => void): DocumentBuilder;
|
|
119
363
|
/**
|
|
120
|
-
*
|
|
364
|
+
* Add staff group.
|
|
121
365
|
* @param groupName - Name of staff group.
|
|
122
366
|
* @param staffsTabsAndGroups - staff/tab index (0=top), staff/tab name, or staff group name. Single value or array.
|
|
123
367
|
* @param verticalPosition - Vertical position, are elements added above, below or both.
|
|
124
|
-
* @returns
|
|
368
|
+
* @returns - This document builder instance.
|
|
125
369
|
*/
|
|
126
370
|
addStaffGroup(groupName: string, staffsTabsAndGroups: number | string | (number | string)[], verticalPosition?: VerticalPosition | `${VerticalPosition}`): DocumentBuilder;
|
|
371
|
+
/**
|
|
372
|
+
* Add song end. Adds certain bar line at the end of measure.
|
|
373
|
+
* @returns - This document builder instance.
|
|
374
|
+
*/
|
|
127
375
|
endSong(): DocumentBuilder;
|
|
376
|
+
/**
|
|
377
|
+
* Add section end. Adds certain bar line at the end of measure.
|
|
378
|
+
* @returns - This document builder instance.
|
|
379
|
+
*/
|
|
128
380
|
endSection(): DocumentBuilder;
|
|
381
|
+
/**
|
|
382
|
+
* End current score row. Next measure will start new row.
|
|
383
|
+
* @returns - This document builder instance.
|
|
384
|
+
*/
|
|
129
385
|
endRow(): DocumentBuilder;
|
|
386
|
+
/**
|
|
387
|
+
* Add rests to fill current measure.
|
|
388
|
+
* @param voiceId - Voice id to add rests to. Single value, array or all if omitted.
|
|
389
|
+
* @returns - This document builder instance.
|
|
390
|
+
*/
|
|
130
391
|
completeRests(voiceId?: VoiceId | VoiceId[]): DocumentBuilder;
|
|
392
|
+
/**
|
|
393
|
+
* Add notes of given scale in ascending order.
|
|
394
|
+
* @param scale - Scale.
|
|
395
|
+
* @param bottomNote - Scale starts from note >= bottom note.
|
|
396
|
+
* @param numOctaves - Number of octaves to add.
|
|
397
|
+
* @returns - This document builder instance.
|
|
398
|
+
*/
|
|
131
399
|
addScaleArpeggio(scale: Scale, bottomNote: string, numOctaves: number): DocumentBuilder;
|
|
132
400
|
}
|
|
133
401
|
|
|
134
|
-
export { Annotation, Connective, DocumentBuilder, type ExtensionBuilder, Fermata, Label, MDocument, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, StaffTabOrGroups, TieType, type TupletBuilder, TupletOptions, VerticalPosition, VoiceId };
|
|
402
|
+
export { Annotation, AnnotationText, Connective, DocumentBuilder, type ExtensionBuilder, Fermata, Label, MDocument, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, StaffTabOrGroups, TieType, type TupletBuilder, TupletOptions, VerticalPosition, VoiceId };
|