@tspro/web-music-score 4.0.0 → 4.0.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/audio/index.d.mts +40 -1
  4. package/dist/audio/index.d.ts +40 -1
  5. package/dist/audio/index.js +1 -1
  6. package/dist/audio/index.mjs +2 -2
  7. package/dist/audio-cg/index.d.mts +3 -0
  8. package/dist/audio-cg/index.d.ts +3 -0
  9. package/dist/audio-cg/index.js +1 -1
  10. package/dist/audio-cg/index.mjs +2 -2
  11. package/dist/{chunk-D643HZHM.mjs → chunk-YFPLOHP2.mjs} +2 -2
  12. package/dist/core/index.d.mts +12 -0
  13. package/dist/core/index.d.ts +12 -0
  14. package/dist/core/index.js +3 -2
  15. package/dist/core/index.mjs +4 -3
  16. package/dist/guitar-CaZJDA05.d.ts +35 -0
  17. package/dist/guitar-DdexKdN6.d.mts +35 -0
  18. package/dist/iife/index.global.js +11 -11
  19. package/dist/{interface-XoKiryoV.d.mts → music-objects-DJQ4d2OA.d.mts} +549 -53
  20. package/dist/{interface-7k8qGG44.d.ts → music-objects-Dc3kR-XF.d.ts} +549 -53
  21. package/dist/note-eA2xPPiG.d.mts +294 -0
  22. package/dist/note-eA2xPPiG.d.ts +294 -0
  23. package/dist/pieces/index.d.mts +22 -3
  24. package/dist/pieces/index.d.ts +22 -3
  25. package/dist/pieces/index.js +5 -2
  26. package/dist/pieces/index.mjs +6 -3
  27. package/dist/react-ui/index.d.mts +166 -17
  28. package/dist/react-ui/index.d.ts +166 -17
  29. package/dist/react-ui/index.js +78 -1
  30. package/dist/react-ui/index.mjs +79 -2
  31. package/dist/scale-B2Icbetz.d.ts +230 -0
  32. package/dist/scale-BbDJTbrG.d.mts +230 -0
  33. package/dist/score/index.d.mts +299 -46
  34. package/dist/score/index.d.ts +299 -46
  35. package/dist/score/index.js +553 -76
  36. package/dist/score/index.mjs +550 -75
  37. package/dist/{tempo-BAYoZ_Li.d.mts → tempo-CtUhvJbr.d.mts} +187 -5
  38. package/dist/{tempo-r2sb6Ku2.d.ts → tempo-Dt8aHpol.d.ts} +187 -5
  39. package/dist/theory/index.d.mts +29 -13
  40. package/dist/theory/index.d.ts +29 -13
  41. package/dist/theory/index.js +369 -25
  42. package/dist/theory/index.mjs +370 -26
  43. package/package.json +1 -1
  44. package/dist/guitar-DggbM2UL.d.mts +0 -17
  45. package/dist/guitar-cNmE-EvH.d.ts +0 -17
  46. package/dist/note-BFa43I86.d.mts +0 -85
  47. package/dist/note-CcVdUFqS.d.ts +0 -85
  48. package/dist/scale-C2pCNxdE.d.mts +0 -75
  49. package/dist/scale-CvPbJvfN.d.ts +0 -75
@@ -0,0 +1,230 @@
1
+ import { N as Note, S as SymbolSet } from './note-eA2xPPiG.mjs';
2
+ import { K as KeySignature } from './tempo-CtUhvJbr.mjs';
3
+
4
+ /** Interval direction type. */
5
+ type IntervalDirection = "Unison" | "Ascending" | "Descending";
6
+ /** Interval quality type. */
7
+ type IntervalQuality = "Perfect" | "Major" | "minor" | "Augmented" | "Doubly Augmented" | "diminished" | "doubly diminished";
8
+ /**
9
+ * Validate interval quality of unkown value.
10
+ * @param q - Interval quality to validate.
11
+ * @returns - Interval quality if valid, else throws.
12
+ */
13
+ declare function validateIntervalQuality(q: unknown): IntervalQuality;
14
+ /** Interval class. */
15
+ declare class Interval {
16
+ readonly note1: Note;
17
+ readonly note2: Note;
18
+ /** Interval direction. */
19
+ readonly direction: IntervalDirection;
20
+ /** Number of semitones. */
21
+ readonly semitones: number;
22
+ /** Interval quantity. */
23
+ readonly quantity: number;
24
+ /** Interval quality. */
25
+ readonly quality: IntervalQuality;
26
+ private constructor();
27
+ /**
28
+ * Get interval between given two notes.
29
+ * @param note1 - First note.
30
+ * @param note2 - Second note.
31
+ * @returns - Interval if valid, or undefined.
32
+ */
33
+ static get(note1: Note, note2: Note): Interval | undefined;
34
+ /**
35
+ * Get string presentation of interval (e.g. "Descending Major 2").
36
+ * @returns - Interval string.
37
+ */
38
+ toString(): string;
39
+ /**
40
+ * Get abbrevated string presentation of interval (e.g. "↓M2").
41
+ * @returns - Interval abbrevated string.
42
+ */
43
+ toAbbrString(): string;
44
+ }
45
+
46
+ /** Degree type. */
47
+ type Degree = 1 | 2 | "b3" | 3 | 4 | "b5" | 5 | "#5" | 6 | "bb7" | "b7" | 7 | "#7" | "b9" | 9 | "#9" | 11 | 13;
48
+ /** Scale type enum. */
49
+ declare enum ScaleType {
50
+ /** Major scale. */
51
+ Major = "Major",
52
+ /** Natural minor scale. */
53
+ NaturalMinor = "Natural Minor",
54
+ /** Harmonic minor scale. */
55
+ HarmonicMinor = "Harmonic Minor",
56
+ /** Mode: Ionian. */
57
+ Ionian = "Ionian",
58
+ /** Mode: Dorian. */
59
+ Dorian = "Dorian",
60
+ /** Mode: Phrygian. */
61
+ Phrygian = "Phrygian",
62
+ /** Mode: Lydian. */
63
+ Lydian = "Lydian",
64
+ /** Mode: Mixolydian. */
65
+ Mixolydian = "Mixolydian",
66
+ /** Mode: Aeolian (minor). */
67
+ Aeolian = "Aeolian",
68
+ /** Mode: Locrian (rare). */
69
+ Locrian = "Locrian",
70
+ /** Major pentatonic scale. */
71
+ MajorPentatonic = "Major Pentatonic",
72
+ /** Minor pentatoni scale. */
73
+ MinorPentatonic = "Minor Pentatonic",
74
+ /** Major hexatonic blues scale. */
75
+ MajorHexatonicBlues = "Major Hexatonic Blues",
76
+ /** Minor hexatonic blues scale. */
77
+ MinorHexatonicBlues = "Minor Hexatonic Blues",
78
+ /** Heptatonic blues scale. */
79
+ HeptatonicBlues = "Heptatonic Blues"
80
+ }
81
+ /** Scale class. */
82
+ declare class Scale extends KeySignature {
83
+ readonly tonic: string;
84
+ readonly scaleType: ScaleType;
85
+ /** Degrees of scale notes. */
86
+ private readonly scaleDegrees;
87
+ /** Scale notes. */
88
+ private readonly scaleNotes;
89
+ /** Degrees (or undefined) of chromatic classes. */
90
+ private readonly chromaticClassDegree;
91
+ /**
92
+ * Create nev scale object instance.
93
+ * @param tonic - Tonic (e.g. "C" in "C Major").
94
+ * @param scaleType - Scale typo ("e.g. "Major" in "C Major").
95
+ */
96
+ constructor(tonic: string, scaleType: ScaleType);
97
+ /**
98
+ * Compare if two scales equals.
99
+ * @param a - Scale a.
100
+ * @param b - Scale b.
101
+ * @returns - Boolean equality of given scales.
102
+ */
103
+ static equals(a: Scale | null | undefined, b: Scale | null | undefined): boolean;
104
+ /**
105
+ * Get scale name.
106
+ * @param symbolSet - Symbol set to format scale name in ascii or unicode.
107
+ * @returns - Scale name string.
108
+ */
109
+ getScaleName(symbolSet?: SymbolSet): string;
110
+ /**
111
+ * Get scale notes.
112
+ * @param bottomNote - Computed scale notes begin no lower than this note.
113
+ * @param numOctaves - How many octaves?
114
+ * @returns - Array of scale notes.
115
+ */
116
+ getScaleNotes(bottomNote: string, numOctaves: number): ReadonlyArray<Note>;
117
+ /**
118
+ * Get scale overview (e.g. "C - D - E - F - G - A - B" for "C Major" scale).
119
+ * @returns - Scale overview string.
120
+ */
121
+ getScaleOverview(): string;
122
+ /**
123
+ * Get scale steps, array of 1 (half step) and 2 (whole step), (e.g. [2, 2, 1, 2, 2, 2, 1] for Major scale).
124
+ * @returns - Array of scale steps.
125
+ */
126
+ getScaleSteps(): number[];
127
+ /**
128
+ * Get scale steps string presentation, array of "H" (half step) and "W" (whole step), (e.g. ["W", "W", "H", "W", "W", "W", "H"] for Major scale).
129
+ * @returns - Array of scale steps string presentation.
130
+ */
131
+ getScaleStringSteps(): string[];
132
+ /**
133
+ * Test if given note is scale note.
134
+ * @param note - Note to test.
135
+ * @returns - True/false.
136
+ */
137
+ isScaleNote(note: Note): boolean;
138
+ /**
139
+ * Test if given note is scale root note.
140
+ * @param note - Note to test.
141
+ * @returns - True/false.
142
+ */
143
+ isScaleRootNote(note: Note): boolean;
144
+ /**
145
+ * Get interval value between scale root note and given note.
146
+ * @param note - Note.
147
+ * @returns - Interval.
148
+ */
149
+ getIntervalFromRootNote(note: Note): Interval;
150
+ private preferredChromaticNoteCache;
151
+ /**
152
+ * Get preferred chromatic note from given chromatic id.
153
+ * @param chromaticId - Chromatic id.
154
+ * @returns - Note.
155
+ */
156
+ getPreferredChromaticNote(chromaticId: number): Note;
157
+ }
158
+ /** Scale factory class. */
159
+ declare class ScaleFactory {
160
+ readonly type: ScaleType;
161
+ private tonicList;
162
+ private scaleMap;
163
+ /**
164
+ * Create new scale factory object instance.
165
+ * @param type - Scale type.
166
+ */
167
+ constructor(type: ScaleType);
168
+ /**
169
+ * Get list of tonics (e.g. "C", "C#", ... for Major scale type).
170
+ * @returns - Array of tonics.
171
+ */
172
+ getTonicList(): ReadonlyArray<string>;
173
+ /**
174
+ * Get default tonic.
175
+ * @returns - Default tonic.
176
+ */
177
+ getDefaultTonic(): string;
178
+ /**
179
+ * Get scale type.
180
+ * @returns - SCale type.
181
+ */
182
+ getType(): ScaleType;
183
+ /**
184
+ * Get scale by given tonic.
185
+ * @param tonic - Tonic (e.g. "C").
186
+ * @returns - Scale.
187
+ */
188
+ getScale(tonic: string): Scale;
189
+ /**
190
+ * Test if this scale factory has scale for given tonic value.
191
+ * @param tonic - Tonic.
192
+ * @returns - True/false.
193
+ */
194
+ hasScale(tonic: string): boolean;
195
+ }
196
+ /**
197
+ * Get array of scale factories, has some title string between to category.
198
+ * @returns - Array of scale factories.
199
+ */
200
+ declare function getScaleFactoryList(): ReadonlyArray<ScaleFactory | string>;
201
+ /**
202
+ * Get scale factory for given scale type.
203
+ * @param scaleType - Scale type.
204
+ * @returns - Scale factory.
205
+ */
206
+ declare function getScaleFactory(scaleType: ScaleType | `${ScaleType}`): ScaleFactory;
207
+ /**
208
+ * Validate scale type.
209
+ * @param scaleType - Scale type of unknown value.
210
+ * @returns - Scale type if given argument was valid scale type, or throws.
211
+ */
212
+ declare function validateScaleType(scaleType: unknown): ScaleType;
213
+ /**
214
+ * Get scale.
215
+ * @param tonic - Tonic (e.g. "C").
216
+ * @param scaleType - Scale type (e.g. "Major").
217
+ */
218
+ declare function getScale(tonic: string, scaleType: ScaleType | `${ScaleType}`): Scale;
219
+ /**
220
+ * Get scale.
221
+ * @param scale - Scale name (e.g. "C Major").
222
+ */
223
+ declare function getScale(scale: string): Scale;
224
+ /**
225
+ * Get default scale ("C Major").
226
+ * @returns - Default scale.
227
+ */
228
+ declare function getDefaultScale(): Scale;
229
+
230
+ export { type Degree as D, type IntervalDirection as I, ScaleType as S, type IntervalQuality as a, Interval as b, Scale as c, ScaleFactory as d, getScaleFactory as e, validateScaleType as f, getScaleFactoryList as g, getScale as h, getDefaultScale as i, validateIntervalQuality as v };
@@ -1,63 +1,194 @@
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, d as TieType, e as NoteAnchor, f as VerticalPosition } from '../interface-XoKiryoV.mjs';
2
- export { a5 as Arpeggio, _ as Clef, D as DivRect, m as MAccidental, o as MArpeggio, x as MBarLineLeft, w as MBarLineRight, p as MBeamGroup, n as MConnective, r as MEnding, W as MExtensionLine, s as MFermata, t as MHeader, u as MImage, v as MMeasure, z as MNoteGroup, Z as MPlaybackButtons, X as MPlayer, Y as MRenderer, G as MRest, I as MRhythmColumn, J as MScoreRow, P as MSignature, Q as MSpecialText, K as MStaff, q as MStaffBeamGroup, B as MStaffNoteGroup, H as MStaffRest, y as MStaffTabBarLine, O as MTab, E as MTabNoteGroup, U as MText, l as MusicInterface, a7 as PlayState, a8 as PlayStateChangeListener, h as ScoreEvent, k as ScoreEventListener, g as ScoreEventType, j as ScoreObjectEvent, i as ScoreStaffPosEvent, $ as StaffConfig, a6 as StaffTabOrGroup, a4 as Stem, a2 as StringNumber, a0 as TabConfig, a3 as getStringNumbers, a1 as getVoiceIds } from '../interface-XoKiryoV.mjs';
3
- import { N as Note } from '../note-BFa43I86.mjs';
4
- import { S as ScaleType, c as Scale } from '../scale-C2pCNxdE.mjs';
5
- import { N as NoteLength, h as NoteLengthStr, K as KeySignature, a as TimeSignature, T as TimeSignatureString, j as TupletRatio } from '../tempo-BAYoZ_Li.mjs';
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-DJQ4d2OA.mjs';
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-DJQ4d2OA.mjs';
3
+ import { N as Note } from '../note-eA2xPPiG.mjs';
4
+ import { S as ScaleType, c as Scale } from '../scale-BbDJTbrG.mjs';
5
+ import { N as NoteLength, h as NoteLengthStr, K as KeySignature, a as TimeSignature, T as TimeSignatureString, j as TupletRatio } from '../tempo-CtUhvJbr.mjs';
6
6
  import '@tspro/ts-utils-lib';
7
7
 
8
- declare enum DynamicsAnnotations {
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;
141
+ /**
142
+ * Set time signature for current measure and forward.
143
+ * @param timeSignature - TimeSignature object instance or string (e.g. "3/4").
144
+ * @returns - This document builder instance.
145
+ */
54
146
  setTimeSignature(timeSignature: TimeSignature | TimeSignatureString): DocumentBuilder;
147
+ /**
148
+ * Set tempo.
149
+ * @param beatsPerMinute - Tempo beats per minute.
150
+ * @returns - This document builder instance.
151
+ */
55
152
  setTempo(beatsPerMinute: number): DocumentBuilder;
153
+ /**
154
+ * Set tempo.
155
+ * @param beatsPerMinute - Tempo beats per minute.
156
+ * @param beatLength - Length of one beat.
157
+ * @returns - This document builder instance.
158
+ */
56
159
  setTempo(beatsPerMinute: number, beatLength: NoteLength | NoteLengthStr): DocumentBuilder;
57
- /** @deprecated - Use dotted beatLength instead (e.g. "4..") */
160
+ /**
161
+ * @deprecated - Use dotted beatLength instead (e.g. "4..").
162
+ * @param beatsPerMinute - Tempo beats per minute.
163
+ * @param beatLength - Length of one beat.
164
+ * @param dotted - Dot count of length of one beat.
165
+ * @returns - This document builder instance.
166
+ */
58
167
  setTempo(beatsPerMinute: number, beatLength: NoteLength | NoteLengthStr, dotted: boolean | number): DocumentBuilder;
168
+ /**
169
+ * Add note o current measure.
170
+ * @param voiceId - Voice id to add note to.
171
+ * @param note - Note instance of Note or string (e.g. "D4").
172
+ * @param noteLength - Note length (e.g. "4n").
173
+ * @param options - Note options.
174
+ * @returns - This document builder instance.
175
+ */
59
176
  addNote(voiceId: number, note: Note | string, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions): DocumentBuilder;
177
+ /**
178
+ * @param voiceId - Voice id to add chord to.
179
+ * @param notes - Array of notes, each instance of Note or string (e.g. "D4").
180
+ * @param noteLength - Note length (e.g. "4n").
181
+ * @param options - Note options.
182
+ * @returns - This document builder instance.
183
+ */
60
184
  addChord(voiceId: number, notes: (Note | string)[], noteLength: NoteLength | NoteLengthStr, options?: NoteOptions): DocumentBuilder;
185
+ /**
186
+ *
187
+ * @param voiceId - Voice id to add rest to.
188
+ * @param restLength - Rest length (e.g. "4n").
189
+ * @param options - Rest options.
190
+ * @returns - This document builder instance.
191
+ */
61
192
  addRest(voiceId: number, restLength: NoteLength | NoteLengthStr, options?: RestOptions): DocumentBuilder;
62
193
  /**
63
194
  * Usage:
@@ -69,66 +200,188 @@ declare class DocumentBuilder {
69
200
  * });
70
201
  * </pre>
71
202
  *
72
- * @param voiceId
203
+ * @param voiceId - Voice id to add tuplet to.
73
204
  * @param tupletRatio - You can also use Theory.Tuplet presets (e.g. Theory.Tuplet.Triplet).
74
- * @param tupletBuilder
75
- * @returns
205
+ * @param tupletBuilder - Tuplet builder function to build tuplet.
206
+ * @returns - This document builder instance.
76
207
  */
77
208
  addTuplet(voiceId: VoiceId, tupletRatio: TupletRatio & TupletOptions, tupletBuilder: (notes: TupletBuilder) => void): DocumentBuilder;
78
209
  private addFermataInternal;
210
+ /**
211
+ * Add fermata to current measure.
212
+ * @param fermata - Fermata type (e.g. "atNote" or Fermata.AtrNote).
213
+ * @returns - This document builder instance.
214
+ */
79
215
  addFermata(fermata?: Fermata | `${Fermata}`): DocumentBuilder;
80
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
216
+ /**
217
+ * Add Fermata to current measure to given staff/tab/group.
218
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
219
+ * @param fermata - Fermata type (e.g. "atNote" or Fermata.AtrNote).
220
+ * @returns - This document builder instance.
221
+ */
81
222
  addFermataTo(staffTabOrGroups: StaffTabOrGroups, fermata?: Fermata | `${Fermata}`): DocumentBuilder;
82
223
  private addNavigationInternal;
224
+ /**
225
+ * Add navigation element to current measure.
226
+ * @param navigation - Navigation element (e.g. "D.S. al Fine" or Navigation.DS_al_Fine).
227
+ * @returns - This document builder instance.
228
+ */
83
229
  addNavigation(navigation: Navigation | `${Navigation}`): DocumentBuilder;
230
+ /**
231
+ * Add end repeat navigation element to current measure.
232
+ * @param navigation - End repeat navigation element ("endRepeat" or Navigation.EndRepeat).
233
+ * @param playCount - Number of times to play the ended repeat section.
234
+ * @returns - This document builder instance.
235
+ */
84
236
  addNavigation(navigation: Navigation.EndRepeat | `${Navigation.EndRepeat}`, playCount: number): DocumentBuilder;
237
+ /**
238
+ * Add ending navigation element to current measure.
239
+ * @param navigation - Ending navigation element ("ending" or Navigation.Ending).
240
+ * @param passages - Passage numbers for measure marked by this ending is played.
241
+ * @returns - This document builder instance.
242
+ */
85
243
  addNavigation(navigation: Navigation.Ending | `${Navigation.Ending}`, ...passages: number[]): DocumentBuilder;
86
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
244
+ /**
245
+ * Add navigation element to current measure to given staff/tab/group.
246
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
247
+ * @param navigation
248
+ * @returns - This document builder instance.
249
+ */
87
250
  addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation | `${Navigation}`): DocumentBuilder;
88
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
251
+ /**
252
+ * Add end repeat navigation element to current measure to given staff/tab/group.
253
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
254
+ * @param navigation
255
+ * @param playCount
256
+ * @returns - This document builder instance.
257
+ */
89
258
  addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation.EndRepeat | `${Navigation.EndRepeat}`, playCount: number): DocumentBuilder;
90
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
259
+ /**
260
+ * Add ending 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
+ * @param passages
264
+ * @returns - This document builder instance.
265
+ */
91
266
  addNavigationTo(staffTabOrGroups: StaffTabOrGroups, navigation: Navigation.Ending | `${Navigation.Ending}`, ...passages: number[]): DocumentBuilder;
92
267
  private addAnnotationInternal;
93
- addAnnotation(text: AnnotationsType): DocumentBuilder;
268
+ /**
269
+ * Add annotation text to column of last added note/chord/rest in current measure.
270
+ * @param text - Known annotation text (e.g. "pp").
271
+ * @returns - This document builder instance.
272
+ */
273
+ addAnnotation(text: AnnotationText): DocumentBuilder;
274
+ /**
275
+ * Add annotation text to column of last added note/chord/rest in current measure.
276
+ * @param annotation - Annotation type (e.g. "tempo" or Annotation.Tempo).
277
+ * @param text - Annotation text (unrestricted).
278
+ * @returns - This document builder instance.
279
+ */
94
280
  addAnnotation(annotation: Annotation | `${Annotation}`, text: string): DocumentBuilder;
95
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
96
- addAnnotationTo(staffTabOrGroups: StaffTabOrGroups, text: AnnotationsType): DocumentBuilder;
97
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
281
+ /**
282
+ * Add annotation text to column of last added note/chord/rest in current measure to given staff/tab/group.
283
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
284
+ * @param text - Known annotation text (e.g. "pp").
285
+ * @returns - This document builder instance.
286
+ */
287
+ addAnnotationTo(staffTabOrGroups: StaffTabOrGroups, text: AnnotationText): DocumentBuilder;
288
+ /**
289
+ * Add annotation text to column of last added note/chord/rest in current measure to given staff/tab/group.
290
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
291
+ * @param annotation - Annotation type (e.g. "tempo" or Annotation.Tempo).
292
+ * @param text - Annotation text (unrestricted).
293
+ * @returns - This document builder instance.
294
+ */
98
295
  addAnnotationTo(staffTabOrGroups: StaffTabOrGroups, annotation: Annotation | `${Annotation}`, text: string): DocumentBuilder;
99
296
  private addLabelInternal;
297
+ /**
298
+ * Add label text to column of last added note/chord/rest in current measure.
299
+ * @param label - Label type (e.g. "chord" or Label.Chord).
300
+ * @param text - label text (e.g. "Am").
301
+ * @returns - This document builder instance.
302
+ */
100
303
  addLabel(label: Label | `${Label}`, text: string): DocumentBuilder;
101
- /** @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name. */
304
+ /**
305
+ * Add label text to column of last added note/chord/rest in current measure to given staff/tab/group.
306
+ * @param staffTabOrGroups - staff/tab index (0=top), staff/tab name, or staff group name.
307
+ * @param label - Label type (e.g. "chord" or Label.Chord).
308
+ * @param text - label text (e.g. "Am").
309
+ * @returns - This document builder instance.
310
+ */
102
311
  addLabelTo(staffTabOrGroups: StaffTabOrGroups, label: Label | `${Label}`, text: string): DocumentBuilder;
312
+ /**
313
+ * Add tie starting from last added note/chord.
314
+ * @param connective - Connective type ("tie" or Connective.Tie).
315
+ * @param tieSpan - How many notes across this tie spans.
316
+ * @param notAnchor - Anchor point for note and this tie.
317
+ * @returns - This document builder instance.
318
+ */
103
319
  addConnective(connective: Connective.Tie | `${Connective.Tie}`, tieSpan?: number | TieType | `${TieType}`, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
320
+ /**
321
+ * Add slur starting from last added note/chord.
322
+ * @param connective - Connective type ("slur" or Connective.Slur).
323
+ * @param slurSpan - How many notes across this slur spans.
324
+ * @param notAnchor - Anchor point for note and this slur.
325
+ * @returns - This document builder instance.
326
+ */
104
327
  addConnective(connective: Connective.Slur | `${Connective.Slur}`, slurSpan?: number, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
328
+ /**
329
+ * Add slide starting from last added note/chord.
330
+ * @param connective - Connective type ("slide" or Connective.Slide).
331
+ * @param notAnchor - Anchor point for note and this slide.
332
+ * @returns - This document builder instance.
333
+ */
105
334
  addConnective(connective: Connective.Slide | `${Connective.Slide}`, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
106
335
  /**
107
- * Extension length example:
336
+ * Add extension line to previously added annotation or label element.
108
337
  * <pre>
338
+ * // Example
109
339
  * addExtension(ext => ext.notes("1n", 2)) // length is 2 whole notes
110
340
  * addExtension(ext => ext.measures(3).hide()) // length is 3 measures, hidden
111
341
  * addExtension(ext => ext.measures(1).notes("8n")) // length is 1 measure + 1 eigth note
112
342
  * addExtension(ext => ext.infinity()) // length is as long as possible
113
343
  * </pre>
114
- * @param extensionLength
115
- * @param extensionVisible
116
- * @returns
344
+ * @param extensionBuilder - Extension builder function used to build exstension.
345
+ * @returns - This document builder instance.
117
346
  */
118
347
  addExtension(extensionBuilder?: (ext: ExtensionBuilder) => void): DocumentBuilder;
119
348
  /**
120
- *
349
+ * Add staff group.
121
350
  * @param groupName - Name of staff group.
122
351
  * @param staffsTabsAndGroups - staff/tab index (0=top), staff/tab name, or staff group name. Single value or array.
123
352
  * @param verticalPosition - Vertical position, are elements added above, below or both.
124
- * @returns
353
+ * @returns - This document builder instance.
125
354
  */
126
355
  addStaffGroup(groupName: string, staffsTabsAndGroups: number | string | (number | string)[], verticalPosition?: VerticalPosition | `${VerticalPosition}`): DocumentBuilder;
356
+ /**
357
+ * Add song end. Adds certain bar line at the end of measure.
358
+ * @returns - This document builder instance.
359
+ */
127
360
  endSong(): DocumentBuilder;
361
+ /**
362
+ * Add section end. Adds certain bar line at the end of measure.
363
+ * @returns - This document builder instance.
364
+ */
128
365
  endSection(): DocumentBuilder;
366
+ /**
367
+ * End current score row. Next measure will start new row.
368
+ * @returns - This document builder instance.
369
+ */
129
370
  endRow(): DocumentBuilder;
371
+ /**
372
+ * Add rests to fill current measure.
373
+ * @param voiceId - Voice id to add rests to. Single value, array or all if omitted.
374
+ * @returns - This document builder instance.
375
+ */
130
376
  completeRests(voiceId?: VoiceId | VoiceId[]): DocumentBuilder;
377
+ /**
378
+ * Add notes of given scale in ascending order.
379
+ * @param scale - Scale.
380
+ * @param bottomNote - Scale starts from note >= bottom note.
381
+ * @param numOctaves - Number of octaves to add.
382
+ * @returns - This document builder instance.
383
+ */
131
384
  addScaleArpeggio(scale: Scale, bottomNote: string, numOctaves: number): DocumentBuilder;
132
385
  }
133
386
 
134
- export { Annotation, Connective, DocumentBuilder, type ExtensionBuilder, Fermata, Label, MDocument, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, StaffTabOrGroups, TieType, type TupletBuilder, TupletOptions, VerticalPosition, VoiceId };
387
+ export { Annotation, AnnotationText, Connective, DocumentBuilder, type ExtensionBuilder, Fermata, Label, MDocument, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, StaffTabOrGroups, TieType, type TupletBuilder, TupletOptions, VerticalPosition, VoiceId };