@hymnbook/abc 0.0.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/README.md +3 -0
- package/dist/index.d.mts +256 -0
- package/dist/index.d.ts +256 -0
- package/dist/index.js +310 -0
- package/dist/index.mjs +262 -0
- package/package.json +37 -0
- package/src/abc.ts +271 -0
- package/src/abcTypes.ts +314 -0
- package/src/based.ts +19 -0
- package/src/basedTypes.ts +14 -0
- package/src/index.ts +5 -0
- package/src/validation.ts +9 -0
package/README.md
ADDED
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { SynthOptions } from 'abcjs';
|
|
2
|
+
|
|
3
|
+
type AccidentalName = "flat" | "natural" | "sharp" | "dblsharp" | "dblflat" | "quarterflat" | "quartersharp";
|
|
4
|
+
type ChordPlacement = "above" | "below" | "left" | "right" | "default";
|
|
5
|
+
type StemDirection = "up" | "down" | "auto" | "none";
|
|
6
|
+
type AbcType = "bar_thin" | "bar_thin_thick" | "bar_thin_thin" | "bar_thick_thin" | "bar_right_repeat" | "bar_left_repeat" | "bar_double_repeat";
|
|
7
|
+
type AbcElementType = "note" | "bar";
|
|
8
|
+
type Clef = "treble" | "tenor" | "bass" | "alto" | "treble+8" | "tenor+8" | "bass+8" | "alto+8" | "treble-8" | "tenor-8" | "bass-8" | "alto-8" | "none" | "perc";
|
|
9
|
+
type NoteHeadType = "normal" | "harmonic" | "rhythm" | "x" | "triangle";
|
|
10
|
+
type NoteLetter = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "a" | "b" | "c" | "d" | "e" | "f" | "g";
|
|
11
|
+
type KeyRoot = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "HP" | "Hp" | "none";
|
|
12
|
+
type KeyAccidentalName = "" | "#" | "b";
|
|
13
|
+
type Mode = "" | "m" | "Dor" | "Mix" | "Loc" | "Phr" | "Lyd";
|
|
14
|
+
type ChordType = "" | "m" | "7" | "m7" | "maj7" | "M7" | "6" | "m6" | "aug" | "+" | "aug7" | "dim" | "dim7" | "9" | "m9" | "maj9" | "M9" | "11" | "dim9" | "sus" | "sus9" | "7sus4" | "7sus9" | "5";
|
|
15
|
+
type BracePosition = "start" | "continue" | "end";
|
|
16
|
+
type NumberFunction = () => number;
|
|
17
|
+
interface AbcChord {
|
|
18
|
+
name: string;
|
|
19
|
+
position: ChordPlacement;
|
|
20
|
+
}
|
|
21
|
+
interface AbcPitchStartSlur {
|
|
22
|
+
label: number;
|
|
23
|
+
}
|
|
24
|
+
interface AbcPitch {
|
|
25
|
+
pitch: number;
|
|
26
|
+
verticalPos: number;
|
|
27
|
+
name?: string;
|
|
28
|
+
accidental?: AccidentalName;
|
|
29
|
+
startTie?: {};
|
|
30
|
+
endTie?: boolean;
|
|
31
|
+
startSlur?: AbcPitchStartSlur[];
|
|
32
|
+
endSlur?: number[];
|
|
33
|
+
}
|
|
34
|
+
interface AbcRest {
|
|
35
|
+
type: "rest" | "whole" | "multimeasure" | "spacer";
|
|
36
|
+
text?: number;
|
|
37
|
+
}
|
|
38
|
+
interface AbcLyric {
|
|
39
|
+
syllable: string;
|
|
40
|
+
divider: " " | "-" | "_";
|
|
41
|
+
}
|
|
42
|
+
interface VoiceItemBar {
|
|
43
|
+
el_type: "bar";
|
|
44
|
+
type: AbcType;
|
|
45
|
+
startChar: number;
|
|
46
|
+
endChar: number;
|
|
47
|
+
}
|
|
48
|
+
interface NoteProperties {
|
|
49
|
+
duration: number;
|
|
50
|
+
pitches?: AbcPitch[];
|
|
51
|
+
lyric?: AbcLyric[];
|
|
52
|
+
chord?: AbcChord[];
|
|
53
|
+
rest?: AbcRest;
|
|
54
|
+
}
|
|
55
|
+
interface VoiceItemNote extends NoteProperties {
|
|
56
|
+
el_type: "note";
|
|
57
|
+
startChar: number;
|
|
58
|
+
endChar: number;
|
|
59
|
+
}
|
|
60
|
+
interface VoiceItemStem {
|
|
61
|
+
el_type: "stem";
|
|
62
|
+
direction: StemDirection;
|
|
63
|
+
}
|
|
64
|
+
interface VoiceItemClef {
|
|
65
|
+
el_type: "clef";
|
|
66
|
+
stafflines?: number;
|
|
67
|
+
staffscale?: number;
|
|
68
|
+
transpose?: number;
|
|
69
|
+
type: Clef;
|
|
70
|
+
verticalPos: number;
|
|
71
|
+
clefPos?: number;
|
|
72
|
+
startChar: number;
|
|
73
|
+
endChar: number;
|
|
74
|
+
}
|
|
75
|
+
interface VoiceItemGap {
|
|
76
|
+
el_type: "gap";
|
|
77
|
+
gap: number;
|
|
78
|
+
}
|
|
79
|
+
interface VoiceItemKey extends KeySignature {
|
|
80
|
+
el_type: "key";
|
|
81
|
+
startChar: number;
|
|
82
|
+
endChar: number;
|
|
83
|
+
}
|
|
84
|
+
type VoiceItem = VoiceItemClef | VoiceItemBar | VoiceItemGap | VoiceItemKey | VoiceItemStem | VoiceItemNote;
|
|
85
|
+
interface Accidental {
|
|
86
|
+
acc: AccidentalName;
|
|
87
|
+
note: NoteLetter;
|
|
88
|
+
verticalPos: number;
|
|
89
|
+
}
|
|
90
|
+
interface AbcClef {
|
|
91
|
+
clefPos: number;
|
|
92
|
+
type: Clef;
|
|
93
|
+
verticalPos: number;
|
|
94
|
+
}
|
|
95
|
+
interface KeySignature {
|
|
96
|
+
accidentals?: Array<Accidental>;
|
|
97
|
+
root: KeyRoot;
|
|
98
|
+
acc: KeyAccidentalName;
|
|
99
|
+
mode: Mode;
|
|
100
|
+
}
|
|
101
|
+
interface AbcStaff {
|
|
102
|
+
barNumber?: number;
|
|
103
|
+
brace: BracePosition;
|
|
104
|
+
bracket: BracePosition;
|
|
105
|
+
connectBarLines: BracePosition;
|
|
106
|
+
stafflines?: number;
|
|
107
|
+
clef?: AbcClef;
|
|
108
|
+
key?: KeySignature;
|
|
109
|
+
voices?: Array<Array<VoiceItem>>;
|
|
110
|
+
}
|
|
111
|
+
interface AbcLine {
|
|
112
|
+
staff?: AbcStaff[];
|
|
113
|
+
}
|
|
114
|
+
interface MetaText {
|
|
115
|
+
"abc-copyright"?: string;
|
|
116
|
+
"abc-creator"?: string;
|
|
117
|
+
"abc-version"?: string;
|
|
118
|
+
"abc-charset"?: string;
|
|
119
|
+
"abc-edited-by"?: string;
|
|
120
|
+
author?: string;
|
|
121
|
+
book?: string;
|
|
122
|
+
composer?: string;
|
|
123
|
+
discography?: string;
|
|
124
|
+
footer?: {
|
|
125
|
+
left: string;
|
|
126
|
+
center: string;
|
|
127
|
+
right: string;
|
|
128
|
+
};
|
|
129
|
+
group?: string;
|
|
130
|
+
header?: {
|
|
131
|
+
left: string;
|
|
132
|
+
center: string;
|
|
133
|
+
right: string;
|
|
134
|
+
};
|
|
135
|
+
history?: string;
|
|
136
|
+
instruction?: string;
|
|
137
|
+
measurebox?: boolean;
|
|
138
|
+
notes?: string;
|
|
139
|
+
origin?: string;
|
|
140
|
+
partOrder?: string;
|
|
141
|
+
rhythm?: string;
|
|
142
|
+
source?: string;
|
|
143
|
+
textBlock?: string;
|
|
144
|
+
title?: string;
|
|
145
|
+
transcription?: string;
|
|
146
|
+
url?: string;
|
|
147
|
+
}
|
|
148
|
+
interface TuneObject {
|
|
149
|
+
formatting: object;
|
|
150
|
+
media: string;
|
|
151
|
+
version: string;
|
|
152
|
+
metaText: MetaText;
|
|
153
|
+
lines: AbcLine[];
|
|
154
|
+
getTotalTime: NumberFunction;
|
|
155
|
+
getTotalBeats: NumberFunction;
|
|
156
|
+
getBarLength: NumberFunction;
|
|
157
|
+
getBeatLength: NumberFunction;
|
|
158
|
+
getBeatsPerMeasure: NumberFunction;
|
|
159
|
+
getBpm: NumberFunction;
|
|
160
|
+
getPickupLength: NumberFunction;
|
|
161
|
+
getKeySignature: () => KeySignature;
|
|
162
|
+
getElementFromChar: (charPos: number) => VoiceItem | null;
|
|
163
|
+
millisecondsPerMeasure: NumberFunction;
|
|
164
|
+
lineBreaks?: Array<number>;
|
|
165
|
+
visualTranspose?: number;
|
|
166
|
+
setUpAudio: (options?: SynthOptions) => AudioTracks;
|
|
167
|
+
}
|
|
168
|
+
interface AudioTracks {
|
|
169
|
+
tempo: number;
|
|
170
|
+
instrument: number;
|
|
171
|
+
tracks: AudioTrack[][];
|
|
172
|
+
totalDuration: number;
|
|
173
|
+
}
|
|
174
|
+
type AudioTrack = AudioTrackProgram | AudioTrackText | AudioTrackNote;
|
|
175
|
+
interface AudioTrackProgram {
|
|
176
|
+
cmd: "program";
|
|
177
|
+
channel: number;
|
|
178
|
+
}
|
|
179
|
+
interface AudioTrackText {
|
|
180
|
+
cmd: "text";
|
|
181
|
+
}
|
|
182
|
+
interface AudioTrackNote {
|
|
183
|
+
cmd: "note";
|
|
184
|
+
duration: number;
|
|
185
|
+
volume: number;
|
|
186
|
+
pitch: number;
|
|
187
|
+
gap: number;
|
|
188
|
+
instrument: number;
|
|
189
|
+
start: number;
|
|
190
|
+
startChar: number;
|
|
191
|
+
endChar: number;
|
|
192
|
+
}
|
|
193
|
+
declare class AbcSong {
|
|
194
|
+
area?: string;
|
|
195
|
+
book?: string;
|
|
196
|
+
composer?: string;
|
|
197
|
+
discography?: string;
|
|
198
|
+
fileUrl?: string;
|
|
199
|
+
group?: string;
|
|
200
|
+
history?: string;
|
|
201
|
+
instruction?: string;
|
|
202
|
+
key?: string;
|
|
203
|
+
unitNoteLength?: string;
|
|
204
|
+
meter?: string;
|
|
205
|
+
macro?: string;
|
|
206
|
+
notes?: string;
|
|
207
|
+
origin?: string;
|
|
208
|
+
parts?: string;
|
|
209
|
+
tempo?: string;
|
|
210
|
+
rhythm?: string;
|
|
211
|
+
remark?: string;
|
|
212
|
+
source?: string;
|
|
213
|
+
symbolLine?: string;
|
|
214
|
+
title?: string;
|
|
215
|
+
userDefined?: string;
|
|
216
|
+
voice?: string;
|
|
217
|
+
referenceNumber?: string;
|
|
218
|
+
transcription?: string;
|
|
219
|
+
melody: VoiceItem[][];
|
|
220
|
+
clef: AbcClef;
|
|
221
|
+
keySignature: KeySignature;
|
|
222
|
+
}
|
|
223
|
+
interface NoteGroupInterface {
|
|
224
|
+
notes: string;
|
|
225
|
+
lyrics: string;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
declare const parse: (abc: string) => AbcSong | undefined;
|
|
229
|
+
declare const getField: (abc: string, field: string, _default?: string) => (string | undefined);
|
|
230
|
+
declare const extractInfoFields: (abc: string, song: AbcSong) => string;
|
|
231
|
+
declare const extractNotesAndLyrics: (abc: string) => NoteGroupInterface;
|
|
232
|
+
declare const addInfoFieldsToMelody: (song: AbcSong, abc: string) => string;
|
|
233
|
+
declare const convertStringToAbcTune: (abc: string) => TuneObject;
|
|
234
|
+
declare const combineMelodyAndLyrics: (melody: string, lyrics: string) => string;
|
|
235
|
+
|
|
236
|
+
type Verse = {
|
|
237
|
+
uuid: string;
|
|
238
|
+
abcLyrics?: string;
|
|
239
|
+
};
|
|
240
|
+
type AbcSubMelody = {
|
|
241
|
+
melody: string;
|
|
242
|
+
verseUuids: string[];
|
|
243
|
+
};
|
|
244
|
+
type AbcMelody = {
|
|
245
|
+
melody: string;
|
|
246
|
+
subMelodies: AbcSubMelody[];
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
declare const getForVerse: (melody: AbcMelody, verse: Verse) => AbcSubMelody | undefined;
|
|
250
|
+
declare const generateAbcForVerse: (verse: Verse, activeMelody?: AbcMelody) => string;
|
|
251
|
+
|
|
252
|
+
declare class ValidationError extends Error {
|
|
253
|
+
}
|
|
254
|
+
declare function validate(result: boolean, message?: string): void;
|
|
255
|
+
|
|
256
|
+
export { type AbcChord, type AbcClef, type AbcElementType, type AbcLine, type AbcLyric, type AbcMelody, type AbcPitch, type AbcPitchStartSlur, type AbcRest, AbcSong, type AbcStaff, type AbcSubMelody, type AbcType, type Accidental, type AccidentalName, type AudioTrack, type AudioTrackNote, type AudioTrackProgram, type AudioTrackText, type AudioTracks, type BracePosition, type ChordPlacement, type ChordType, type Clef, type KeyAccidentalName, type KeyRoot, type KeySignature, type MetaText, type Mode, type NoteGroupInterface, type NoteHeadType, type NoteLetter, type NoteProperties, type StemDirection, type TuneObject, ValidationError, type Verse, type VoiceItem, type VoiceItemBar, type VoiceItemClef, type VoiceItemGap, type VoiceItemKey, type VoiceItemNote, type VoiceItemStem, addInfoFieldsToMelody, combineMelodyAndLyrics, convertStringToAbcTune, extractInfoFields, extractNotesAndLyrics, generateAbcForVerse, getField, getForVerse, parse, validate };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { SynthOptions } from 'abcjs';
|
|
2
|
+
|
|
3
|
+
type AccidentalName = "flat" | "natural" | "sharp" | "dblsharp" | "dblflat" | "quarterflat" | "quartersharp";
|
|
4
|
+
type ChordPlacement = "above" | "below" | "left" | "right" | "default";
|
|
5
|
+
type StemDirection = "up" | "down" | "auto" | "none";
|
|
6
|
+
type AbcType = "bar_thin" | "bar_thin_thick" | "bar_thin_thin" | "bar_thick_thin" | "bar_right_repeat" | "bar_left_repeat" | "bar_double_repeat";
|
|
7
|
+
type AbcElementType = "note" | "bar";
|
|
8
|
+
type Clef = "treble" | "tenor" | "bass" | "alto" | "treble+8" | "tenor+8" | "bass+8" | "alto+8" | "treble-8" | "tenor-8" | "bass-8" | "alto-8" | "none" | "perc";
|
|
9
|
+
type NoteHeadType = "normal" | "harmonic" | "rhythm" | "x" | "triangle";
|
|
10
|
+
type NoteLetter = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "a" | "b" | "c" | "d" | "e" | "f" | "g";
|
|
11
|
+
type KeyRoot = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "HP" | "Hp" | "none";
|
|
12
|
+
type KeyAccidentalName = "" | "#" | "b";
|
|
13
|
+
type Mode = "" | "m" | "Dor" | "Mix" | "Loc" | "Phr" | "Lyd";
|
|
14
|
+
type ChordType = "" | "m" | "7" | "m7" | "maj7" | "M7" | "6" | "m6" | "aug" | "+" | "aug7" | "dim" | "dim7" | "9" | "m9" | "maj9" | "M9" | "11" | "dim9" | "sus" | "sus9" | "7sus4" | "7sus9" | "5";
|
|
15
|
+
type BracePosition = "start" | "continue" | "end";
|
|
16
|
+
type NumberFunction = () => number;
|
|
17
|
+
interface AbcChord {
|
|
18
|
+
name: string;
|
|
19
|
+
position: ChordPlacement;
|
|
20
|
+
}
|
|
21
|
+
interface AbcPitchStartSlur {
|
|
22
|
+
label: number;
|
|
23
|
+
}
|
|
24
|
+
interface AbcPitch {
|
|
25
|
+
pitch: number;
|
|
26
|
+
verticalPos: number;
|
|
27
|
+
name?: string;
|
|
28
|
+
accidental?: AccidentalName;
|
|
29
|
+
startTie?: {};
|
|
30
|
+
endTie?: boolean;
|
|
31
|
+
startSlur?: AbcPitchStartSlur[];
|
|
32
|
+
endSlur?: number[];
|
|
33
|
+
}
|
|
34
|
+
interface AbcRest {
|
|
35
|
+
type: "rest" | "whole" | "multimeasure" | "spacer";
|
|
36
|
+
text?: number;
|
|
37
|
+
}
|
|
38
|
+
interface AbcLyric {
|
|
39
|
+
syllable: string;
|
|
40
|
+
divider: " " | "-" | "_";
|
|
41
|
+
}
|
|
42
|
+
interface VoiceItemBar {
|
|
43
|
+
el_type: "bar";
|
|
44
|
+
type: AbcType;
|
|
45
|
+
startChar: number;
|
|
46
|
+
endChar: number;
|
|
47
|
+
}
|
|
48
|
+
interface NoteProperties {
|
|
49
|
+
duration: number;
|
|
50
|
+
pitches?: AbcPitch[];
|
|
51
|
+
lyric?: AbcLyric[];
|
|
52
|
+
chord?: AbcChord[];
|
|
53
|
+
rest?: AbcRest;
|
|
54
|
+
}
|
|
55
|
+
interface VoiceItemNote extends NoteProperties {
|
|
56
|
+
el_type: "note";
|
|
57
|
+
startChar: number;
|
|
58
|
+
endChar: number;
|
|
59
|
+
}
|
|
60
|
+
interface VoiceItemStem {
|
|
61
|
+
el_type: "stem";
|
|
62
|
+
direction: StemDirection;
|
|
63
|
+
}
|
|
64
|
+
interface VoiceItemClef {
|
|
65
|
+
el_type: "clef";
|
|
66
|
+
stafflines?: number;
|
|
67
|
+
staffscale?: number;
|
|
68
|
+
transpose?: number;
|
|
69
|
+
type: Clef;
|
|
70
|
+
verticalPos: number;
|
|
71
|
+
clefPos?: number;
|
|
72
|
+
startChar: number;
|
|
73
|
+
endChar: number;
|
|
74
|
+
}
|
|
75
|
+
interface VoiceItemGap {
|
|
76
|
+
el_type: "gap";
|
|
77
|
+
gap: number;
|
|
78
|
+
}
|
|
79
|
+
interface VoiceItemKey extends KeySignature {
|
|
80
|
+
el_type: "key";
|
|
81
|
+
startChar: number;
|
|
82
|
+
endChar: number;
|
|
83
|
+
}
|
|
84
|
+
type VoiceItem = VoiceItemClef | VoiceItemBar | VoiceItemGap | VoiceItemKey | VoiceItemStem | VoiceItemNote;
|
|
85
|
+
interface Accidental {
|
|
86
|
+
acc: AccidentalName;
|
|
87
|
+
note: NoteLetter;
|
|
88
|
+
verticalPos: number;
|
|
89
|
+
}
|
|
90
|
+
interface AbcClef {
|
|
91
|
+
clefPos: number;
|
|
92
|
+
type: Clef;
|
|
93
|
+
verticalPos: number;
|
|
94
|
+
}
|
|
95
|
+
interface KeySignature {
|
|
96
|
+
accidentals?: Array<Accidental>;
|
|
97
|
+
root: KeyRoot;
|
|
98
|
+
acc: KeyAccidentalName;
|
|
99
|
+
mode: Mode;
|
|
100
|
+
}
|
|
101
|
+
interface AbcStaff {
|
|
102
|
+
barNumber?: number;
|
|
103
|
+
brace: BracePosition;
|
|
104
|
+
bracket: BracePosition;
|
|
105
|
+
connectBarLines: BracePosition;
|
|
106
|
+
stafflines?: number;
|
|
107
|
+
clef?: AbcClef;
|
|
108
|
+
key?: KeySignature;
|
|
109
|
+
voices?: Array<Array<VoiceItem>>;
|
|
110
|
+
}
|
|
111
|
+
interface AbcLine {
|
|
112
|
+
staff?: AbcStaff[];
|
|
113
|
+
}
|
|
114
|
+
interface MetaText {
|
|
115
|
+
"abc-copyright"?: string;
|
|
116
|
+
"abc-creator"?: string;
|
|
117
|
+
"abc-version"?: string;
|
|
118
|
+
"abc-charset"?: string;
|
|
119
|
+
"abc-edited-by"?: string;
|
|
120
|
+
author?: string;
|
|
121
|
+
book?: string;
|
|
122
|
+
composer?: string;
|
|
123
|
+
discography?: string;
|
|
124
|
+
footer?: {
|
|
125
|
+
left: string;
|
|
126
|
+
center: string;
|
|
127
|
+
right: string;
|
|
128
|
+
};
|
|
129
|
+
group?: string;
|
|
130
|
+
header?: {
|
|
131
|
+
left: string;
|
|
132
|
+
center: string;
|
|
133
|
+
right: string;
|
|
134
|
+
};
|
|
135
|
+
history?: string;
|
|
136
|
+
instruction?: string;
|
|
137
|
+
measurebox?: boolean;
|
|
138
|
+
notes?: string;
|
|
139
|
+
origin?: string;
|
|
140
|
+
partOrder?: string;
|
|
141
|
+
rhythm?: string;
|
|
142
|
+
source?: string;
|
|
143
|
+
textBlock?: string;
|
|
144
|
+
title?: string;
|
|
145
|
+
transcription?: string;
|
|
146
|
+
url?: string;
|
|
147
|
+
}
|
|
148
|
+
interface TuneObject {
|
|
149
|
+
formatting: object;
|
|
150
|
+
media: string;
|
|
151
|
+
version: string;
|
|
152
|
+
metaText: MetaText;
|
|
153
|
+
lines: AbcLine[];
|
|
154
|
+
getTotalTime: NumberFunction;
|
|
155
|
+
getTotalBeats: NumberFunction;
|
|
156
|
+
getBarLength: NumberFunction;
|
|
157
|
+
getBeatLength: NumberFunction;
|
|
158
|
+
getBeatsPerMeasure: NumberFunction;
|
|
159
|
+
getBpm: NumberFunction;
|
|
160
|
+
getPickupLength: NumberFunction;
|
|
161
|
+
getKeySignature: () => KeySignature;
|
|
162
|
+
getElementFromChar: (charPos: number) => VoiceItem | null;
|
|
163
|
+
millisecondsPerMeasure: NumberFunction;
|
|
164
|
+
lineBreaks?: Array<number>;
|
|
165
|
+
visualTranspose?: number;
|
|
166
|
+
setUpAudio: (options?: SynthOptions) => AudioTracks;
|
|
167
|
+
}
|
|
168
|
+
interface AudioTracks {
|
|
169
|
+
tempo: number;
|
|
170
|
+
instrument: number;
|
|
171
|
+
tracks: AudioTrack[][];
|
|
172
|
+
totalDuration: number;
|
|
173
|
+
}
|
|
174
|
+
type AudioTrack = AudioTrackProgram | AudioTrackText | AudioTrackNote;
|
|
175
|
+
interface AudioTrackProgram {
|
|
176
|
+
cmd: "program";
|
|
177
|
+
channel: number;
|
|
178
|
+
}
|
|
179
|
+
interface AudioTrackText {
|
|
180
|
+
cmd: "text";
|
|
181
|
+
}
|
|
182
|
+
interface AudioTrackNote {
|
|
183
|
+
cmd: "note";
|
|
184
|
+
duration: number;
|
|
185
|
+
volume: number;
|
|
186
|
+
pitch: number;
|
|
187
|
+
gap: number;
|
|
188
|
+
instrument: number;
|
|
189
|
+
start: number;
|
|
190
|
+
startChar: number;
|
|
191
|
+
endChar: number;
|
|
192
|
+
}
|
|
193
|
+
declare class AbcSong {
|
|
194
|
+
area?: string;
|
|
195
|
+
book?: string;
|
|
196
|
+
composer?: string;
|
|
197
|
+
discography?: string;
|
|
198
|
+
fileUrl?: string;
|
|
199
|
+
group?: string;
|
|
200
|
+
history?: string;
|
|
201
|
+
instruction?: string;
|
|
202
|
+
key?: string;
|
|
203
|
+
unitNoteLength?: string;
|
|
204
|
+
meter?: string;
|
|
205
|
+
macro?: string;
|
|
206
|
+
notes?: string;
|
|
207
|
+
origin?: string;
|
|
208
|
+
parts?: string;
|
|
209
|
+
tempo?: string;
|
|
210
|
+
rhythm?: string;
|
|
211
|
+
remark?: string;
|
|
212
|
+
source?: string;
|
|
213
|
+
symbolLine?: string;
|
|
214
|
+
title?: string;
|
|
215
|
+
userDefined?: string;
|
|
216
|
+
voice?: string;
|
|
217
|
+
referenceNumber?: string;
|
|
218
|
+
transcription?: string;
|
|
219
|
+
melody: VoiceItem[][];
|
|
220
|
+
clef: AbcClef;
|
|
221
|
+
keySignature: KeySignature;
|
|
222
|
+
}
|
|
223
|
+
interface NoteGroupInterface {
|
|
224
|
+
notes: string;
|
|
225
|
+
lyrics: string;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
declare const parse: (abc: string) => AbcSong | undefined;
|
|
229
|
+
declare const getField: (abc: string, field: string, _default?: string) => (string | undefined);
|
|
230
|
+
declare const extractInfoFields: (abc: string, song: AbcSong) => string;
|
|
231
|
+
declare const extractNotesAndLyrics: (abc: string) => NoteGroupInterface;
|
|
232
|
+
declare const addInfoFieldsToMelody: (song: AbcSong, abc: string) => string;
|
|
233
|
+
declare const convertStringToAbcTune: (abc: string) => TuneObject;
|
|
234
|
+
declare const combineMelodyAndLyrics: (melody: string, lyrics: string) => string;
|
|
235
|
+
|
|
236
|
+
type Verse = {
|
|
237
|
+
uuid: string;
|
|
238
|
+
abcLyrics?: string;
|
|
239
|
+
};
|
|
240
|
+
type AbcSubMelody = {
|
|
241
|
+
melody: string;
|
|
242
|
+
verseUuids: string[];
|
|
243
|
+
};
|
|
244
|
+
type AbcMelody = {
|
|
245
|
+
melody: string;
|
|
246
|
+
subMelodies: AbcSubMelody[];
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
declare const getForVerse: (melody: AbcMelody, verse: Verse) => AbcSubMelody | undefined;
|
|
250
|
+
declare const generateAbcForVerse: (verse: Verse, activeMelody?: AbcMelody) => string;
|
|
251
|
+
|
|
252
|
+
declare class ValidationError extends Error {
|
|
253
|
+
}
|
|
254
|
+
declare function validate(result: boolean, message?: string): void;
|
|
255
|
+
|
|
256
|
+
export { type AbcChord, type AbcClef, type AbcElementType, type AbcLine, type AbcLyric, type AbcMelody, type AbcPitch, type AbcPitchStartSlur, type AbcRest, AbcSong, type AbcStaff, type AbcSubMelody, type AbcType, type Accidental, type AccidentalName, type AudioTrack, type AudioTrackNote, type AudioTrackProgram, type AudioTrackText, type AudioTracks, type BracePosition, type ChordPlacement, type ChordType, type Clef, type KeyAccidentalName, type KeyRoot, type KeySignature, type MetaText, type Mode, type NoteGroupInterface, type NoteHeadType, type NoteLetter, type NoteProperties, type StemDirection, type TuneObject, ValidationError, type Verse, type VoiceItem, type VoiceItemBar, type VoiceItemClef, type VoiceItemGap, type VoiceItemKey, type VoiceItemNote, type VoiceItemStem, addInfoFieldsToMelody, combineMelodyAndLyrics, convertStringToAbcTune, extractInfoFields, extractNotesAndLyrics, generateAbcForVerse, getField, getForVerse, parse, validate };
|