web-music-score 0.0.1 → 6.0.0-pre.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 +197 -0
- package/LICENSE +62 -1
- package/README.md +46 -2
- package/dist/audio/index.d.ts +50 -0
- package/dist/audio/index.js +1832 -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-2NTPGV6U.mjs +101 -0
- package/dist/chunk-FCR7WBDV.mjs +37 -0
- package/dist/chunk-OKY6DMTT.mjs +18381 -0
- package/dist/chunk-OZZ3NSJS.mjs +267 -0
- package/dist/chunk-SNZ77AGL.mjs +11 -0
- package/dist/chunk-URLQD334.mjs +3841 -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 +13927 -0
- package/dist/score/index.mjs +10081 -0
- package/dist/tempo-D-JF-8b_.d.ts +409 -0
- package/dist/theory/index.d.ts +78 -0
- package/dist/theory/index.js +4816 -0
- package/dist/theory/index.mjs +1986 -0
- package/package.json +131 -3
- package/workspace.code-workspace +0 -9
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, b as MeasureOptions, V as VoiceId, T as TupletOptions, c as VerseNumber, L as LyricsOptions, d as StaffTabOrGroups, F as Fermata, e as Navigation, A as AnnotationText, f as Annotation, g as Label, C as Connective, h as TieType, i as NoteAnchor, j as VerticalPosition } from '../music-objects-DLmp5uL6.js';
|
|
2
|
+
export { ak as Arpeggio, a6 as BaseConfig, a5 as Clef, ao as DynamicsAnnotation, am as LyricsAlign, an as LyricsHyphen, t as MAccidental, v as MArpeggio, H as MBarLineLeft, G as MBarLineRight, w as MBeamGroup, u as MConnective, y as MEnding, a4 as MExtensionLine, z as MFermata, B as MHeader, D as MImage, a3 as MLyrics, E as MMeasure, J as MNoteGroup, r as MPlaybackButtons, p as MPlayer, q as MRenderContext, P as MRest, U as MRhythmColumn, W as MScoreRow, X as MScoreRowGroup, a1 as MSpecialText, Y as MStaff, I as MStaffBarLine, x as MStaffBeamGroup, K as MStaffNoteGroup, Q as MStaffRest, _ as MStaffSignature, Z as MTab, O as MTabNoteGroup, a0 as MTabRhythm, $ as MTabSignature, a2 as MText, s as MusicInterface, aq as PlayState, ar as PlayStateChangeListener, l as ScoreEvent, o as ScoreEventListener, k as ScoreEventType, n as ScoreObjectEvent, m as ScoreStaffPosEvent, a7 as StaffConfig, al as StaffTabOrGroup, aj as Stem, ac as StringNumber, a8 as TabConfig, ap as TempoAnnotation, ad as getStringNumbers, ag as getVerseNumbers, a9 as getVoiceIds, ae as isStringNumber, ah as isVerseNumber, aa as isVoiceId, af as validateStringNumber, ai as validateVerseNumber, ab as validateVoiceId } from '../music-objects-DLmp5uL6.js';
|
|
3
|
+
import { N as Note } from '../note-RVXvpfyV.js';
|
|
4
|
+
import { S as ScaleType, c as Scale } from '../scale-B1M10_fu.js';
|
|
5
|
+
import { N as NoteLength, h as NoteLengthStr, K as KeySignature, a as TimeSignature, T as TimeSignatures, B as BeamGrouping, k as TupletRatio } from '../tempo-D-JF-8b_.js';
|
|
6
|
+
import '@tspro/ts-utils-lib';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Color attributes.
|
|
10
|
+
* ```
|
|
11
|
+
* Attribute hierarchy is:
|
|
12
|
+
* + background
|
|
13
|
+
* + header
|
|
14
|
+
* + title
|
|
15
|
+
* + composer
|
|
16
|
+
* + arranger
|
|
17
|
+
* + rowgroup
|
|
18
|
+
* + instrument
|
|
19
|
+
* + frame
|
|
20
|
+
* + staff|tab
|
|
21
|
+
* + frame
|
|
22
|
+
* + note
|
|
23
|
+
* + rest
|
|
24
|
+
* + connective
|
|
25
|
+
* + signature
|
|
26
|
+
* + clef (staff only)
|
|
27
|
+
* + key (staff only)
|
|
28
|
+
* + time
|
|
29
|
+
* + tempo
|
|
30
|
+
* + measurenum
|
|
31
|
+
* + tuning (tab only)
|
|
32
|
+
* + element
|
|
33
|
+
* + fermata
|
|
34
|
+
* + annotation
|
|
35
|
+
* + navigation
|
|
36
|
+
* + label
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
type ColorAttr = "background" | "header" | "title" | "composer" | "arranger" | "rowgroup" | "instrument" | "frame" | "staff" | "tab" | "frame" | "note" | "rest" | "connective" | "signature" | "clef" | "key" | "time" | "tempo" | "measurenum" | "tuning" | "element" | "fermata" | "annotation" | "navigation" | "label";
|
|
40
|
+
/**
|
|
41
|
+
* Set color of any score document element. Use combination of color attributes to set color of specific elements.
|
|
42
|
+
* ```ts
|
|
43
|
+
* setColor("red", "staff"); // Set color of all staff elements to red.
|
|
44
|
+
* setColor("red", "staff", "signature"); // Set color of all signature elements of staff to red.
|
|
45
|
+
* setColor("red", "staff", "key", "signature"); // Set color of key signature of staff to red.
|
|
46
|
+
* setColor("green", "staff", "time", "signature"); // Set color of time signature of staff to green.
|
|
47
|
+
* // etc.
|
|
48
|
+
* ```
|
|
49
|
+
* See {@link ColorAttr} for attribute hierarchy tree.
|
|
50
|
+
*
|
|
51
|
+
* @param color - Color (HTML color code e.g. "green", "#AA6644", etc.)
|
|
52
|
+
* @param colorAttrs - Any number of color attributes.
|
|
53
|
+
*/
|
|
54
|
+
declare function setColor(color: string, ...colorAttrs: ColorAttr[]): void;
|
|
55
|
+
|
|
56
|
+
/** Tuplet builder type. */
|
|
57
|
+
type TupletBuilder = {
|
|
58
|
+
/**
|
|
59
|
+
* Add note to a tuplet.
|
|
60
|
+
* @param note - Instance of Note or string, single value (e.g. "C4") or array (e.g. ["C4", "E4", "G4"]).
|
|
61
|
+
* @param noteLength - Note length (e.g. "4n").
|
|
62
|
+
* @param noteOptions - Note options.
|
|
63
|
+
* @returns - This tuplet builder object.
|
|
64
|
+
*/
|
|
65
|
+
addNote: (note: Note | string | (Note | string)[], noteLength: NoteLength | NoteLengthStr, noteOptions?: NoteOptions) => TupletBuilder;
|
|
66
|
+
/**
|
|
67
|
+
* Add chord to a tuplet.
|
|
68
|
+
* @param notes - Array of notes, each instance of Note or string (e.g. "D4").
|
|
69
|
+
* @param noteLength - Note length (e.g. "4n").
|
|
70
|
+
* @param noteOptions - Note options.
|
|
71
|
+
* @returns - This tuplet builder object.
|
|
72
|
+
*/
|
|
73
|
+
addChord: (notes: (Note | string)[], noteLength: NoteLength | NoteLengthStr, noteOptions?: NoteOptions) => TupletBuilder;
|
|
74
|
+
/**
|
|
75
|
+
* Add rest to a tuplet.
|
|
76
|
+
* @param restLength - Rest length (e.g. "4n").
|
|
77
|
+
* @param restOptions - Rest options.
|
|
78
|
+
* @returns - This tuplet builder object.
|
|
79
|
+
*/
|
|
80
|
+
addRest: (restLength: NoteLength | NoteLengthStr, restOptions?: RestOptions) => TupletBuilder;
|
|
81
|
+
};
|
|
82
|
+
/** Etension builder type. */
|
|
83
|
+
type ExtensionBuilder = {
|
|
84
|
+
/**
|
|
85
|
+
* Increase extension length by note length multiplied by number of notes.
|
|
86
|
+
* @param noteLength - Length of note (e.g. "2n").
|
|
87
|
+
* @param noteCount - Number of note lengths (default = 1).
|
|
88
|
+
* @returns - this extension builder object.
|
|
89
|
+
*/
|
|
90
|
+
notes: (noteLength: NoteLength | NoteLengthStr, noteCount?: number) => ExtensionBuilder;
|
|
91
|
+
/**
|
|
92
|
+
* Increase length of extension length by given number of measures.
|
|
93
|
+
* @param measureCount - Number of measures.
|
|
94
|
+
* @returns - this extension builder object.
|
|
95
|
+
*/
|
|
96
|
+
measures: (measureCount: number) => ExtensionBuilder;
|
|
97
|
+
/**
|
|
98
|
+
* Create as long extension line as possible.
|
|
99
|
+
* @returns - this extension builder object.
|
|
100
|
+
*/
|
|
101
|
+
infinity: () => ExtensionBuilder;
|
|
102
|
+
/**
|
|
103
|
+
* Create an invisible extension.
|
|
104
|
+
* @returns - this extension builder object.
|
|
105
|
+
*/
|
|
106
|
+
hide: () => ExtensionBuilder;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Document builder class.
|
|
110
|
+
* ```ts
|
|
111
|
+
* // Example
|
|
112
|
+
* let doc = new Score.DocumentBuilder()
|
|
113
|
+
* .addScoreConfiguration({ type: "staff", clef: "G", isOctavewDown: true })
|
|
114
|
+
* .setMeasuresPerRow(4)
|
|
115
|
+
* .addMeasure()
|
|
116
|
+
* .addNote(1, "C3", "4n")
|
|
117
|
+
* .addChord(1, ["C3", "E3", "G3"], "4n").addLabel("chord", "C")
|
|
118
|
+
* .addRest(1, "4n")
|
|
119
|
+
* // etc.
|
|
120
|
+
* .getDEocument();
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
declare class DocumentBuilder {
|
|
124
|
+
private readonly doc;
|
|
125
|
+
/**
|
|
126
|
+
* Create new document builder instance.
|
|
127
|
+
*/
|
|
128
|
+
constructor();
|
|
129
|
+
/**
|
|
130
|
+
* Use staff preset values to set score confguration. This call will request new score row.
|
|
131
|
+
* @param staffPreset - Staff preset (e.g. "treble").
|
|
132
|
+
*/
|
|
133
|
+
setScoreConfiguration(staffPreset: StaffPreset | `${StaffPreset}`): DocumentBuilder;
|
|
134
|
+
/**
|
|
135
|
+
* Use staff preset values to set score confguration. This call will request new score row.
|
|
136
|
+
* @param config - Score configuration (e.g. { type: "staff", clef: "G", isOctavewDown: true }).
|
|
137
|
+
*/
|
|
138
|
+
setScoreConfiguration(config: ScoreConfiguration): DocumentBuilder;
|
|
139
|
+
private static DefaultMeasureOptions;
|
|
140
|
+
private getMeasure;
|
|
141
|
+
/**
|
|
142
|
+
* Get music document after finished building.
|
|
143
|
+
* @returns - Music document.
|
|
144
|
+
*/
|
|
145
|
+
getDocument(): MDocument;
|
|
146
|
+
/**
|
|
147
|
+
* Set header texts.
|
|
148
|
+
* @param title - Title of this docmument/musical piece.
|
|
149
|
+
* @param composer - Composer of this document/musical piece.
|
|
150
|
+
* @param arranger - Arranger of this document/musical piece.
|
|
151
|
+
* @returns - This document builder instance.
|
|
152
|
+
*/
|
|
153
|
+
setHeader(title?: string, composer?: string, arranger?: string): DocumentBuilder;
|
|
154
|
+
/**
|
|
155
|
+
* Automatically limit number of measures per score row.
|
|
156
|
+
* @param measuresPerRow - Number of measures per row. Must be integer >=1 or Infinity.
|
|
157
|
+
* @returns - This document builder instance.
|
|
158
|
+
*/
|
|
159
|
+
setMeasuresPerRow(measuresPerRow: number): DocumentBuilder;
|
|
160
|
+
/**
|
|
161
|
+
* Add new measure.
|
|
162
|
+
* @param measureOptions - Measure options.
|
|
163
|
+
* @returns - This document builder instance.
|
|
164
|
+
*/
|
|
165
|
+
addMeasure(measureOptions?: MeasureOptions): DocumentBuilder;
|
|
166
|
+
/**
|
|
167
|
+
* Set key signature for current measure and forward.
|
|
168
|
+
* @param tonic - Tonic note (e.g. "C").
|
|
169
|
+
* @param scaleType - Scale type (e.g. string "Major" or ScaleType.Major).
|
|
170
|
+
* @returns - This document builder instance.
|
|
171
|
+
*/
|
|
172
|
+
setKeySignature(tonic: string, scaleType: ScaleType | `${ScaleType}`): DocumentBuilder;
|
|
173
|
+
/**
|
|
174
|
+
* Set key signature for current measure and forward.
|
|
175
|
+
* @param keySignature - KeySignature object instance.
|
|
176
|
+
* @returns - This document builder instance.
|
|
177
|
+
*/
|
|
178
|
+
setKeySignature(keySignature: KeySignature): DocumentBuilder;
|
|
179
|
+
/**
|
|
180
|
+
* Set key signature for current measure and forward.
|
|
181
|
+
* @param keySignature - Key signature string (e.g. "C Major").
|
|
182
|
+
* @returns - This document builder instance.
|
|
183
|
+
*/
|
|
184
|
+
setKeySignature(keySignature: string): DocumentBuilder;
|
|
185
|
+
/**
|
|
186
|
+
* Set key signature for current measure and forward.
|
|
187
|
+
* @param scale - Scale object instance.
|
|
188
|
+
* @returns - This document builder instance.
|
|
189
|
+
*/
|
|
190
|
+
setKeySignature(scale: Scale): DocumentBuilder;
|
|
191
|
+
/**
|
|
192
|
+
* Set time signature for current measure and forward.
|
|
193
|
+
* @param timeSignature - TimeSignature object instance.
|
|
194
|
+
* @returns - This document builder instance.
|
|
195
|
+
*/
|
|
196
|
+
setTimeSignature(timeSignature: TimeSignature): DocumentBuilder;
|
|
197
|
+
/**
|
|
198
|
+
* Set time signature for current measure and forward.
|
|
199
|
+
* @param timeSignature - TimeSignatures enum value or string (e.g. "3/4").
|
|
200
|
+
* @param beamGrouping - Beam grouping (e.g. "3-2" for time signature "5/8").
|
|
201
|
+
* @returns - This document builder instance.
|
|
202
|
+
*/
|
|
203
|
+
setTimeSignature(timeSignature: TimeSignatures | `${TimeSignatures}`, beamGrouping?: BeamGrouping | `${BeamGrouping}`): DocumentBuilder;
|
|
204
|
+
/**
|
|
205
|
+
* Set time signature for current measure and forward.
|
|
206
|
+
* @param beatCount - Beat count of time signature (e.g. 3 in "3/4").
|
|
207
|
+
* @param beatSize - Beat size of time signature (e.g. 4 in "3/4").
|
|
208
|
+
* @param beamGrouping - Beam grouping (e.g. "3-2" for time signature "5/8").
|
|
209
|
+
* @returns - This document builder instance.
|
|
210
|
+
*/
|
|
211
|
+
setTimeSignature(beatCount: number, beatSize: number, beamGrouping?: BeamGrouping | `${BeamGrouping}`): DocumentBuilder;
|
|
212
|
+
/**
|
|
213
|
+
* Set tempo.
|
|
214
|
+
* @param beatsPerMinute - Tempo beats per minute.
|
|
215
|
+
* @returns - This document builder instance.
|
|
216
|
+
*/
|
|
217
|
+
setTempo(beatsPerMinute: number): DocumentBuilder;
|
|
218
|
+
/**
|
|
219
|
+
* Set tempo.
|
|
220
|
+
* @param beatsPerMinute - Tempo beats per minute.
|
|
221
|
+
* @param beatLength - Length of one beat.
|
|
222
|
+
* @returns - This document builder instance.
|
|
223
|
+
*/
|
|
224
|
+
setTempo(beatsPerMinute: number, beatLength: NoteLength | NoteLengthStr): DocumentBuilder;
|
|
225
|
+
/**
|
|
226
|
+
* Add note to current measure.
|
|
227
|
+
* @param voiceId - Voice id to add note to.
|
|
228
|
+
* @param note - Instance of Note or string, single value (e.g. "C4") or array (e.g. ["C4", "E4", "G4"]).
|
|
229
|
+
* @param noteLength - Note length (e.g. "4n").
|
|
230
|
+
* @param noteOptions - Note options.
|
|
231
|
+
* @returns - This document builder instance.
|
|
232
|
+
*/
|
|
233
|
+
addNote(voiceId: VoiceId, note: Note | string | (Note | string)[], noteLength: NoteLength | NoteLengthStr, noteOptions?: NoteOptions): DocumentBuilder;
|
|
234
|
+
/**
|
|
235
|
+
* Add chord to current measure.
|
|
236
|
+
* @param voiceId - Voice id to add chord to.
|
|
237
|
+
* @param notes - Array of notes, each instance of Note or string (e.g. "D4").
|
|
238
|
+
* @param noteLength - Note length (e.g. "4n").
|
|
239
|
+
* @param noteOptions - Note options.
|
|
240
|
+
* @returns - This document builder instance.
|
|
241
|
+
*/
|
|
242
|
+
addChord(voiceId: VoiceId, notes: (Note | string)[], noteLength: NoteLength | NoteLengthStr, noteOptions?: NoteOptions): DocumentBuilder;
|
|
243
|
+
/**
|
|
244
|
+
* Add rest to current measure.
|
|
245
|
+
* @param voiceId - Voice id to add rest to.
|
|
246
|
+
* @param restLength - Rest length (e.g. "4n").
|
|
247
|
+
* @param restOptions - Rest options.
|
|
248
|
+
* @returns - This document builder instance.
|
|
249
|
+
*/
|
|
250
|
+
addRest(voiceId: VoiceId, restLength: NoteLength | NoteLengthStr, restOptions?: RestOptions): DocumentBuilder;
|
|
251
|
+
/**
|
|
252
|
+
* Usage:
|
|
253
|
+
* ```ts
|
|
254
|
+
* addTuplet(0, Theory.Tuplet.Triplet, notes => {
|
|
255
|
+
* notes.addNote("G3", Theory.NoteLength.Eighth);
|
|
256
|
+
* notes.addNote("B3", Theory.NoteLength.Eighth);
|
|
257
|
+
* notes.addNote("D4", Theory.NoteLength.Eighth);
|
|
258
|
+
* });
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* @param voiceId - Voice id to add tuplet to.
|
|
262
|
+
* @param tupletRatio - You can also use Theory.Tuplet presets (e.g. Theory.Tuplet.Triplet).
|
|
263
|
+
* @param tupletBuilder - Tuplet builder function to build tuplet.
|
|
264
|
+
* @returns - This document builder instance.
|
|
265
|
+
*/
|
|
266
|
+
addTuplet(voiceId: VoiceId, tupletRatio: TupletRatio & TupletOptions, tupletBuilder: (notes: TupletBuilder) => void): DocumentBuilder;
|
|
267
|
+
private currentLyricsAlign;
|
|
268
|
+
private addLyricsInternal;
|
|
269
|
+
/**
|
|
270
|
+
* Add lyrics to current measure.
|
|
271
|
+
* @param verse - Verse number (e.g. 1).
|
|
272
|
+
* @param lyricsLength - Lyrics text length (e.g. "2n").
|
|
273
|
+
* @param lyricsText - Lyrics text (empty space if omitted), single value or array.
|
|
274
|
+
* @param lyricsOptions - Lyrics options.
|
|
275
|
+
* @returns - This document builder instance.
|
|
276
|
+
*/
|
|
277
|
+
addLyrics(verse: VerseNumber, lyricsLength: NoteLength | NoteLengthStr, lyricsText?: string | string[], lyricsOptions?: LyricsOptions): DocumentBuilder;
|
|
278
|
+
/**
|
|
279
|
+
* Add lyrics to current measure to given staff/tab/group.
|
|
280
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
281
|
+
* @param verse - Verse number (e.g. 1).
|
|
282
|
+
* @param lyricsLength - Lyrics text length (e.g. "2n").
|
|
283
|
+
* @param lyricsText - Lyrics text (empty space if omitted), single value or array.
|
|
284
|
+
* @param lyricsOptions - Lyrics options.
|
|
285
|
+
* @returns - This document builder instance.
|
|
286
|
+
*/
|
|
287
|
+
addLyricsTo(staffTabOrGroups: StaffTabOrGroups, verse: VerseNumber, lyricsLength: NoteLength | NoteLengthStr, lyricsText?: string | string[], lyricsOptions?: LyricsOptions): DocumentBuilder;
|
|
288
|
+
private addFermataInternal;
|
|
289
|
+
/**
|
|
290
|
+
* Add fermata to current measure.
|
|
291
|
+
* @param fermata - Fermata type (e.g. "atNote" or Fermata.AtrNote).
|
|
292
|
+
* @returns - This document builder instance.
|
|
293
|
+
*/
|
|
294
|
+
addFermata(fermata?: Fermata | `${Fermata}`): DocumentBuilder;
|
|
295
|
+
/**
|
|
296
|
+
* Add Fermata to current measure to given staff/tab/group.
|
|
297
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
298
|
+
* @param fermata - Fermata type (e.g. "atNote" or Fermata.AtrNote).
|
|
299
|
+
* @returns - This document builder instance.
|
|
300
|
+
*/
|
|
301
|
+
addFermataTo(staffTabOrGroups: StaffTabOrGroups, fermata?: Fermata | `${Fermata}`): DocumentBuilder;
|
|
302
|
+
private addNavigationInternal;
|
|
303
|
+
/**
|
|
304
|
+
* Add navigation element to current measure.
|
|
305
|
+
* @param navigation - Navigation element (e.g. "D.S. al Fine" or Navigation.DS_al_Fine).
|
|
306
|
+
* @returns - This document builder instance.
|
|
307
|
+
*/
|
|
308
|
+
addNavigation(navigation: Navigation | `${Navigation}`): DocumentBuilder;
|
|
309
|
+
/**
|
|
310
|
+
* Add end repeat navigation element to current measure.
|
|
311
|
+
* @param navigation - End repeat navigation element ("endRepeat" or Navigation.EndRepeat).
|
|
312
|
+
* @param playCount - Number of times to play the ended repeat section.
|
|
313
|
+
* @returns - This document builder instance.
|
|
314
|
+
*/
|
|
315
|
+
addNavigation(navigation: Navigation.EndRepeat | `${Navigation.EndRepeat}`, playCount: number): DocumentBuilder;
|
|
316
|
+
/**
|
|
317
|
+
* Add ending navigation element to current measure.
|
|
318
|
+
* @param navigation - Ending navigation element ("ending" or Navigation.Ending).
|
|
319
|
+
* @param passages - Passage numbers for measure marked by this ending is played.
|
|
320
|
+
* @returns - This document builder instance.
|
|
321
|
+
*/
|
|
322
|
+
addNavigation(navigation: Navigation.Ending | `${Navigation.Ending}`, ...passages: number[]): DocumentBuilder;
|
|
323
|
+
/**
|
|
324
|
+
* Add navigation element to current measure to given staff/tab/group.
|
|
325
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
326
|
+
* @param navigation
|
|
327
|
+
* @returns - This document builder instance.
|
|
328
|
+
*/
|
|
329
|
+
addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation | `${Navigation}`): DocumentBuilder;
|
|
330
|
+
/**
|
|
331
|
+
* Add end repeat navigation element to current measure to given staff/tab/group.
|
|
332
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
333
|
+
* @param navigation
|
|
334
|
+
* @param playCount
|
|
335
|
+
* @returns - This document builder instance.
|
|
336
|
+
*/
|
|
337
|
+
addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation.EndRepeat | `${Navigation.EndRepeat}`, playCount: number): DocumentBuilder;
|
|
338
|
+
/**
|
|
339
|
+
* Add ending navigation element to current measure to given staff/tab/group.
|
|
340
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
341
|
+
* @param navigation
|
|
342
|
+
* @param passages
|
|
343
|
+
* @returns - This document builder instance.
|
|
344
|
+
*/
|
|
345
|
+
addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation.Ending | `${Navigation.Ending}`, ...passages: number[]): DocumentBuilder;
|
|
346
|
+
private addAnnotationInternal;
|
|
347
|
+
/**
|
|
348
|
+
* Add annotation text to column of last added note/chord/rest in current measure.
|
|
349
|
+
* @param text - Known annotation text (e.g. "pp").
|
|
350
|
+
* @returns - This document builder instance.
|
|
351
|
+
*/
|
|
352
|
+
addAnnotation(text: AnnotationText): DocumentBuilder;
|
|
353
|
+
/**
|
|
354
|
+
* Add annotation text to column of last added note/chord/rest in current measure.
|
|
355
|
+
* @param annotation - Annotation type (e.g. "tempo" or Annotation.Tempo).
|
|
356
|
+
* @param text - Annotation text (unrestricted).
|
|
357
|
+
* @returns - This document builder instance.
|
|
358
|
+
*/
|
|
359
|
+
addAnnotation(annotation: Annotation | `${Annotation}`, text: string): DocumentBuilder;
|
|
360
|
+
/**
|
|
361
|
+
* Add annotation text to column of last added note/chord/rest in current measure to given staff/tab/group.
|
|
362
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
363
|
+
* @param text - Known annotation text (e.g. "pp").
|
|
364
|
+
* @returns - This document builder instance.
|
|
365
|
+
*/
|
|
366
|
+
addAnnotationTo(staffTabOrGroups: StaffTabOrGroups, text: AnnotationText): DocumentBuilder;
|
|
367
|
+
/**
|
|
368
|
+
* Add annotation text to column of last added note/chord/rest in current measure to given staff/tab/group.
|
|
369
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
370
|
+
* @param annotation - Annotation type (e.g. "tempo" or Annotation.Tempo).
|
|
371
|
+
* @param text - Annotation text (unrestricted).
|
|
372
|
+
* @returns - This document builder instance.
|
|
373
|
+
*/
|
|
374
|
+
addAnnotationTo(staffTabOrGroups: StaffTabOrGroups, annotation: Annotation | `${Annotation}`, text: string): DocumentBuilder;
|
|
375
|
+
private addLabelInternal;
|
|
376
|
+
/**
|
|
377
|
+
* Add label text to column of last added note/chord/rest in current measure.
|
|
378
|
+
* @param label - Label type (e.g. "chord" or Label.Chord).
|
|
379
|
+
* @param text - label text (e.g. "Am").
|
|
380
|
+
* @returns - This document builder instance.
|
|
381
|
+
*/
|
|
382
|
+
addLabel(label: Label | `${Label}`, text: string): DocumentBuilder;
|
|
383
|
+
/**
|
|
384
|
+
* Add label text to column of last added note/chord/rest in current measure to given staff/tab/group.
|
|
385
|
+
* @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
|
|
386
|
+
* @param label - Label type (e.g. "chord" or Label.Chord).
|
|
387
|
+
* @param text - label text (e.g. "Am").
|
|
388
|
+
* @returns - This document builder instance.
|
|
389
|
+
*/
|
|
390
|
+
addLabelTo(staffTabOrGroups: StaffTabOrGroups, label: Label | `${Label}`, text: string): DocumentBuilder;
|
|
391
|
+
/**
|
|
392
|
+
* Add tie starting from last added note/chord.
|
|
393
|
+
* @param connective - Connective type ("tie" or Connective.Tie).
|
|
394
|
+
* @param tieSpan - How many notes across this tie spans.
|
|
395
|
+
* @param notAnchor - Anchor point for note and this tie.
|
|
396
|
+
* @returns - This document builder instance.
|
|
397
|
+
*/
|
|
398
|
+
addConnective(connective: Connective.Tie | `${Connective.Tie}`, tieSpan?: number | TieType | `${TieType}`, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
|
|
399
|
+
/**
|
|
400
|
+
* Add slur starting from last added note/chord.
|
|
401
|
+
* @param connective - Connective type ("slur" or Connective.Slur).
|
|
402
|
+
* @param slurSpan - How many notes across this slur spans.
|
|
403
|
+
* @param notAnchor - Anchor point for note and this slur.
|
|
404
|
+
* @returns - This document builder instance.
|
|
405
|
+
*/
|
|
406
|
+
addConnective(connective: Connective.Slur | `${Connective.Slur}`, slurSpan?: number, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
|
|
407
|
+
/**
|
|
408
|
+
* Add slide starting from last added note/chord.
|
|
409
|
+
* @param connective - Connective type ("slide" or Connective.Slide).
|
|
410
|
+
* @param notAnchor - Anchor point for note and this slide.
|
|
411
|
+
* @returns - This document builder instance.
|
|
412
|
+
*/
|
|
413
|
+
addConnective(connective: Connective.Slide | `${Connective.Slide}`, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
|
|
414
|
+
/**
|
|
415
|
+
* Add extension line to previously added annotation or label element.
|
|
416
|
+
* ```ts
|
|
417
|
+
* // Example
|
|
418
|
+
* addExtension(ext => ext.notes("1n", 2)) // length is 2 whole notes
|
|
419
|
+
* addExtension(ext => ext.measures(3).hide()) // length is 3 measures, hidden
|
|
420
|
+
* addExtension(ext => ext.measures(1).notes("8n")) // length is 1 measure + 1 eigth note
|
|
421
|
+
* addExtension(ext => ext.infinity()) // length is as long as possible
|
|
422
|
+
* ```
|
|
423
|
+
* @param extensionBuilder - Extension builder function used to build exstension.
|
|
424
|
+
* @returns - This document builder instance.
|
|
425
|
+
*/
|
|
426
|
+
addExtension(extensionBuilder?: (ext: ExtensionBuilder) => void): DocumentBuilder;
|
|
427
|
+
/**
|
|
428
|
+
* Add staff group.
|
|
429
|
+
* @param groupName - Name of staff group.
|
|
430
|
+
* @param staffsTabsAndGroups - staff/tab index (0=top), staff/tab name, or staff group name. Single value or array.
|
|
431
|
+
* @param verticalPosition - Vertical position, are elements added above, below or both.
|
|
432
|
+
* @returns - This document builder instance.
|
|
433
|
+
*/
|
|
434
|
+
addStaffGroup(groupName: string, staffsTabsAndGroups: number | string | (number | string)[], verticalPosition?: VerticalPosition | `${VerticalPosition}`): DocumentBuilder;
|
|
435
|
+
/**
|
|
436
|
+
* Add song end. Adds certain bar line at the end of measure.
|
|
437
|
+
* @returns - This document builder instance.
|
|
438
|
+
*/
|
|
439
|
+
endSong(): DocumentBuilder;
|
|
440
|
+
/**
|
|
441
|
+
* Add section end. Adds certain bar line at the end of measure.
|
|
442
|
+
* @returns - This document builder instance.
|
|
443
|
+
*/
|
|
444
|
+
endSection(): DocumentBuilder;
|
|
445
|
+
/**
|
|
446
|
+
* End current score row. Next measure will start new row.
|
|
447
|
+
* @returns - This document builder instance.
|
|
448
|
+
*/
|
|
449
|
+
endRow(): DocumentBuilder;
|
|
450
|
+
/**
|
|
451
|
+
* Add rests to fill current measure.
|
|
452
|
+
* @param voiceId - Voice id to add rests to. Single value, array or all if omitted.
|
|
453
|
+
* @returns - This document builder instance.
|
|
454
|
+
*/
|
|
455
|
+
completeRests(voiceId?: VoiceId | VoiceId[]): DocumentBuilder;
|
|
456
|
+
/**
|
|
457
|
+
* Add notes of given scale in ascending order.
|
|
458
|
+
* @param scale - Scale.
|
|
459
|
+
* @param bottomNote - Scale starts from note >= bottom note.
|
|
460
|
+
* @param numOctaves - Number of octaves to add.
|
|
461
|
+
* @returns - This document builder instance.
|
|
462
|
+
*/
|
|
463
|
+
addScaleArpeggio(scale: Scale, bottomNote: string, numOctaves: number): DocumentBuilder;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export { Annotation, AnnotationText, type ColorAttr, Connective, DocumentBuilder, type ExtensionBuilder, Fermata, Label, LyricsOptions, MDocument, MeasureOptions, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, StaffTabOrGroups, TieType, type TupletBuilder, TupletOptions, VerseNumber, VerticalPosition, VoiceId, setColor };
|