spessasynth_lib 3.24.3 → 3.24.4

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 (93) hide show
  1. package/package.json +1 -2
  2. package/sequencer/worklet_sequencer/worklet_sequencer.js +6 -0
  3. package/synthetizer/worklet_processor.min.js +6 -6
  4. package/@types/external_midi/midi_handler.d.ts +0 -39
  5. package/@types/external_midi/web_midi_link.d.ts +0 -12
  6. package/@types/externals/stbvorbis_sync/stbvorbis_sync.min.d.ts +0 -1
  7. package/@types/index.d.ts +0 -44
  8. package/@types/midi_parser/basic_midi.d.ts +0 -36
  9. package/@types/midi_parser/midi_builder.d.ts +0 -68
  10. package/@types/midi_parser/midi_data.d.ts +0 -46
  11. package/@types/midi_parser/midi_editor.d.ts +0 -89
  12. package/@types/midi_parser/midi_loader.d.ts +0 -30
  13. package/@types/midi_parser/midi_message.d.ts +0 -155
  14. package/@types/midi_parser/midi_sequence.d.ts +0 -135
  15. package/@types/midi_parser/midi_writer.d.ts +0 -6
  16. package/@types/midi_parser/rmidi_writer.d.ts +0 -85
  17. package/@types/midi_parser/used_keys_loaded.d.ts +0 -10
  18. package/@types/sequencer/sequencer.d.ts +0 -277
  19. package/@types/sequencer/worklet_sequencer/sequencer_message.d.ts +0 -31
  20. package/@types/soundfont/basic_soundfont/basic_instrument.d.ts +0 -29
  21. package/@types/soundfont/basic_soundfont/basic_preset.d.ts +0 -86
  22. package/@types/soundfont/basic_soundfont/basic_sample.d.ts +0 -88
  23. package/@types/soundfont/basic_soundfont/basic_soundfont.d.ts +0 -102
  24. package/@types/soundfont/basic_soundfont/basic_zone.d.ts +0 -58
  25. package/@types/soundfont/basic_soundfont/basic_zones.d.ts +0 -22
  26. package/@types/soundfont/basic_soundfont/generator.d.ts +0 -102
  27. package/@types/soundfont/basic_soundfont/modulator.d.ts +0 -92
  28. package/@types/soundfont/basic_soundfont/riff_chunk.d.ts +0 -45
  29. package/@types/soundfont/basic_soundfont/write_dls/art2.d.ts +0 -6
  30. package/@types/soundfont/basic_soundfont/write_dls/articulator.d.ts +0 -28
  31. package/@types/soundfont/basic_soundfont/write_dls/combine_zones.d.ts +0 -8
  32. package/@types/soundfont/basic_soundfont/write_dls/ins.d.ts +0 -7
  33. package/@types/soundfont/basic_soundfont/write_dls/lins.d.ts +0 -5
  34. package/@types/soundfont/basic_soundfont/write_dls/modulator_converter.d.ts +0 -11
  35. package/@types/soundfont/basic_soundfont/write_dls/rgn2.d.ts +0 -8
  36. package/@types/soundfont/basic_soundfont/write_dls/wave.d.ts +0 -6
  37. package/@types/soundfont/basic_soundfont/write_dls/write_dls.d.ts +0 -6
  38. package/@types/soundfont/basic_soundfont/write_dls/wsmp.d.ts +0 -12
  39. package/@types/soundfont/basic_soundfont/write_dls/wvpl.d.ts +0 -8
  40. package/@types/soundfont/basic_soundfont/write_sf2/ibag.d.ts +0 -6
  41. package/@types/soundfont/basic_soundfont/write_sf2/igen.d.ts +0 -6
  42. package/@types/soundfont/basic_soundfont/write_sf2/imod.d.ts +0 -6
  43. package/@types/soundfont/basic_soundfont/write_sf2/inst.d.ts +0 -6
  44. package/@types/soundfont/basic_soundfont/write_sf2/pbag.d.ts +0 -6
  45. package/@types/soundfont/basic_soundfont/write_sf2/pgen.d.ts +0 -6
  46. package/@types/soundfont/basic_soundfont/write_sf2/phdr.d.ts +0 -6
  47. package/@types/soundfont/basic_soundfont/write_sf2/pmod.d.ts +0 -6
  48. package/@types/soundfont/basic_soundfont/write_sf2/sdta.d.ts +0 -11
  49. package/@types/soundfont/basic_soundfont/write_sf2/shdr.d.ts +0 -8
  50. package/@types/soundfont/basic_soundfont/write_sf2/soundfont_trimmer.d.ts +0 -6
  51. package/@types/soundfont/basic_soundfont/write_sf2/write.d.ts +0 -21
  52. package/@types/soundfont/dls/articulator_converter.d.ts +0 -19
  53. package/@types/soundfont/dls/dls_destinations.d.ts +0 -29
  54. package/@types/soundfont/dls/dls_preset.d.ts +0 -13
  55. package/@types/soundfont/dls/dls_sample.d.ts +0 -19
  56. package/@types/soundfont/dls/dls_soundfont.d.ts +0 -31
  57. package/@types/soundfont/dls/dls_sources.d.ts +0 -27
  58. package/@types/soundfont/dls/dls_zone.d.ts +0 -23
  59. package/@types/soundfont/dls/read_articulation.d.ts +0 -12
  60. package/@types/soundfont/dls/read_instrument.d.ts +0 -5
  61. package/@types/soundfont/dls/read_instrument_list.d.ts +0 -5
  62. package/@types/soundfont/dls/read_lart.d.ts +0 -7
  63. package/@types/soundfont/dls/read_region.d.ts +0 -7
  64. package/@types/soundfont/dls/read_samples.d.ts +0 -5
  65. package/@types/soundfont/load_soundfont.d.ts +0 -6
  66. package/@types/soundfont/read_sf2/generators.d.ts +0 -16
  67. package/@types/soundfont/read_sf2/instruments.d.ts +0 -29
  68. package/@types/soundfont/read_sf2/modulators.d.ts +0 -15
  69. package/@types/soundfont/read_sf2/presets.d.ts +0 -30
  70. package/@types/soundfont/read_sf2/samples.d.ts +0 -55
  71. package/@types/soundfont/read_sf2/soundfont.d.ts +0 -28
  72. package/@types/soundfont/read_sf2/zones.d.ts +0 -99
  73. package/@types/synthetizer/audio_effects/effects_config.d.ts +0 -41
  74. package/@types/synthetizer/audio_effects/fancy_chorus.d.ts +0 -97
  75. package/@types/synthetizer/audio_effects/reverb.d.ts +0 -7
  76. package/@types/synthetizer/key_modifier_manager.d.ts +0 -56
  77. package/@types/synthetizer/synth_event_handler.d.ts +0 -263
  78. package/@types/synthetizer/synth_soundfont_manager.d.ts +0 -52
  79. package/@types/synthetizer/synthetizer.d.ts +0 -358
  80. package/@types/synthetizer/worklet_system/message_protocol/worklet_message.d.ts +0 -98
  81. package/@types/synthetizer/worklet_system/worklet_methods/worklet_key_modifier.d.ts +0 -77
  82. package/@types/synthetizer/worklet_system/worklet_methods/worklet_soundfont_manager/sfman_message.d.ts +0 -7
  83. package/@types/synthetizer/worklet_system/worklet_utilities/controller_tables.d.ts +0 -23
  84. package/@types/synthetizer/worklet_system/worklet_utilities/worklet_processor_channel.d.ts +0 -155
  85. package/@types/synthetizer/worklet_url.d.ts +0 -5
  86. package/@types/utils/buffer_to_wav.d.ts +0 -31
  87. package/@types/utils/byte_functions/big_endian.d.ts +0 -13
  88. package/@types/utils/byte_functions/little_endian.d.ts +0 -35
  89. package/@types/utils/byte_functions/string.d.ts +0 -27
  90. package/@types/utils/byte_functions/variable_length_quantity.d.ts +0 -12
  91. package/@types/utils/indexed_array.d.ts +0 -21
  92. package/@types/utils/loggin.d.ts +0 -26
  93. package/@types/utils/other.d.ts +0 -37
@@ -1,85 +0,0 @@
1
- /**
2
- * @typedef {Object} RMIDMetadata
3
- * @property {string|undefined} name - the name of the file
4
- * @property {string|undefined} engineer - the engineer who worked on the file
5
- * @property {string|undefined} artist - the artist
6
- * @property {string|undefined} album - the album
7
- * @property {string|undefined} genre - the genre of the song
8
- * @property {ArrayBuffer|undefined} picture - the image for the file (album cover)
9
- * @property {string|undefined} comment - the coment of the file
10
- * @property {string|undefined} creationDate - the creation date of the file
11
- * @property {string|undefined} copyright - the copyright of the file
12
- * @property {string|unescape} midiEncoding - the encoding of the inner MIDI file
13
- */
14
- /**
15
- * Writes an RMIDI file
16
- * @param soundfontBinary {Uint8Array}
17
- * @param mid {BasicMIDI}
18
- * @param soundfont {BasicSoundFont}
19
- * @param bankOffset {number} the bank offset for RMIDI
20
- * @param encoding {string} the encoding of the RMIDI info chunk
21
- * @param metadata {RMIDMetadata} the metadata of the file. Optional. If provided, the encoding is forced to utf-8/
22
- * @param correctBankOffset {boolean}
23
- * @returns {IndexedByteArray}
24
- */
25
- export function writeRMIDI(soundfontBinary: Uint8Array, mid: BasicMIDI, soundfont: BasicSoundFont, bankOffset?: number, encoding?: string, metadata?: RMIDMetadata, correctBankOffset?: boolean): IndexedByteArray;
26
- export type RMIDINFOChunks = string;
27
- export namespace RMIDINFOChunks {
28
- let name: string;
29
- let album: string;
30
- let album2: string;
31
- let artist: string;
32
- let genre: string;
33
- let picture: string;
34
- let copyright: string;
35
- let creationDate: string;
36
- let comment: string;
37
- let engineer: string;
38
- let software: string;
39
- let encoding: string;
40
- let midiEncoding: string;
41
- let bankOffset: string;
42
- }
43
- export type RMIDMetadata = {
44
- /**
45
- * - the name of the file
46
- */
47
- name: string | undefined;
48
- /**
49
- * - the engineer who worked on the file
50
- */
51
- engineer: string | undefined;
52
- /**
53
- * - the artist
54
- */
55
- artist: string | undefined;
56
- /**
57
- * - the album
58
- */
59
- album: string | undefined;
60
- /**
61
- * - the genre of the song
62
- */
63
- genre: string | undefined;
64
- /**
65
- * - the image for the file (album cover)
66
- */
67
- picture: ArrayBuffer | undefined;
68
- /**
69
- * - the coment of the file
70
- */
71
- comment: string | undefined;
72
- /**
73
- * - the creation date of the file
74
- */
75
- creationDate: string | undefined;
76
- /**
77
- * - the copyright of the file
78
- */
79
- copyright: string | undefined;
80
- /**
81
- * - the encoding of the inner MIDI file
82
- */
83
- midiEncoding: string | typeof unescape;
84
- };
85
- import { IndexedByteArray } from "../utils/indexed_array.js";
@@ -1,10 +0,0 @@
1
- /**
2
- * @param mid {BasicMIDI}
3
- * @param soundfont {{getPreset: function(number, number): BasicPreset}}
4
- * @returns {Object<string, Set<string>>}
5
- */
6
- export function getUsedProgramsAndKeys(mid: BasicMIDI, soundfont: {
7
- getPreset: (arg0: number, arg1: number) => BasicPreset;
8
- }): {
9
- [x: string]: Set<string>;
10
- };
@@ -1,277 +0,0 @@
1
- export class Sequencer {
2
- /**
3
- * Creates a new Midi sequencer for playing back MIDI files
4
- * @param midiBinaries {MIDIFile[]} List of the buffers of the MIDI files
5
- * @param synth {Synthetizer} synth to send events to
6
- * @param options {SequencerOptions} the sequencer's options
7
- */
8
- constructor(midiBinaries: MIDIFile[], synth: Synthetizer, options?: SequencerOptions);
9
- /**
10
- * Executes when MIDI parsing has an error.
11
- * @type {function(string)}
12
- */
13
- onError: (arg0: string) => any;
14
- /**
15
- * The sequence's data, except for the track data.
16
- * @type {MidiData}
17
- */
18
- midiData: MidiData;
19
- /**
20
- * @type {Object<string, function(MidiData)>}
21
- * @private
22
- */
23
- private onSongChange;
24
- /**
25
- * Fires on text event
26
- * @type {function}
27
- * @param data {Uint8Array} the data text
28
- * @param type {number} the status byte of the message (the meta-status byte)
29
- * @param lyricsIndex {number} if the text is a lyric, the index of the lyric in midiData.lyrics, otherwise -1
30
- */
31
- onTextEvent: Function;
32
- /**
33
- * Fires when CurrentTime changes
34
- * @type {Object<string, function(number)>} the time that was changed to
35
- * @private
36
- */
37
- private onTimeChange;
38
- /**
39
- * @type {Object<string, function>}
40
- * @private
41
- */
42
- private onSongEnded;
43
- /**
44
- * Fires on tempo change
45
- * @type {Object<string, function(number)>}
46
- */
47
- onTempoChange: {
48
- [x: string]: (arg0: number) => any;
49
- };
50
- /**
51
- * Current song's tempo in BPM
52
- * @type {number}
53
- */
54
- currentTempo: number;
55
- /**
56
- * Current song index
57
- * @type {number}
58
- */
59
- songIndex: number;
60
- /**
61
- * @type {function(BasicMIDI)}
62
- * @private
63
- */
64
- private _getMIDIResolve;
65
- /**
66
- * Indicates if the current midiData property has fake data in it (not yet loaded)
67
- * @type {boolean}
68
- */
69
- hasDummyData: boolean;
70
- /**
71
- * Indicates whether the sequencer has finished playing a sequence
72
- * @type {boolean}
73
- */
74
- isFinished: boolean;
75
- /**
76
- * The current sequence's length, in seconds
77
- * @type {number}
78
- */
79
- duration: number;
80
- /**
81
- * Indicates if the sequencer is paused.
82
- * Paused if a number, undefined if playing
83
- * @type {undefined|number}
84
- * @private
85
- */
86
- private pausedTime;
87
- ignoreEvents: boolean;
88
- synth: Synthetizer;
89
- highResTimeOffset: number;
90
- /**
91
- * Absolute playback startTime, bases on the synth's time
92
- * @type {number}
93
- */
94
- absoluteStartTime: number;
95
- /**
96
- * @type {boolean}
97
- * @private
98
- */
99
- private _skipToFirstNoteOn;
100
- /**
101
- * @type {boolean}
102
- * @private
103
- */
104
- private _preservePlaybackState;
105
- /**
106
- * Internal loop marker
107
- * @type {boolean}
108
- * @private
109
- */
110
- private _loop;
111
- set loop(value: boolean);
112
- get loop(): boolean;
113
- /**
114
- * Controls the playback's rate
115
- * @type {number}
116
- * @private
117
- */
118
- private _playbackRate;
119
- /**
120
- * @param value {number}
121
- */
122
- set playbackRate(value: number);
123
- /**
124
- * @returns {number}
125
- */
126
- get playbackRate(): number;
127
- /**
128
- * Indicates if the sequencer should skip to first note on
129
- * @param val {boolean}
130
- */
131
- set skipToFirstNoteOn(val: boolean);
132
- /**
133
- * Indicates if the sequencer should skip to first note on
134
- * @return {boolean}
135
- */
136
- get skipToFirstNoteOn(): boolean;
137
- /**
138
- * if true,
139
- * the sequencer will stay paused when seeking or changing the playback rate
140
- * @param val {boolean}
141
- */
142
- set preservePlaybackState(val: boolean);
143
- /**
144
- * if true,
145
- * the sequencer will stay paused when seeking or changing the playback rate
146
- * @returns {boolean}
147
- */
148
- get preservePlaybackState(): boolean;
149
- set currentTime(time: number);
150
- /**
151
- * @returns {number} Current playback time, in seconds
152
- */
153
- get currentTime(): number;
154
- /**
155
- * Use for visualization as it's not affected by the audioContext stutter
156
- * @returns {number}
157
- */
158
- get currentHighResolutionTime(): number;
159
- /**
160
- * true if paused, false if playing or stopped
161
- * @returns {boolean}
162
- */
163
- get paused(): boolean;
164
- /**
165
- * Adds a new event that gets called when the song changes
166
- * @param callback {function(MidiData)}
167
- * @param id {string} must be unique
168
- */
169
- addOnSongChangeEvent(callback: (arg0: MidiData) => any, id: string): void;
170
- /**
171
- * Adds a new event that gets called when the song ends
172
- * @param callback {function}
173
- * @param id {string} must be unique
174
- */
175
- addOnSongEndedEvent(callback: Function, id: string): void;
176
- /**
177
- * Adds a new event that gets called when the time changes
178
- * @param callback {function(number)} the new time, in seconds
179
- * @param id {string} must be unique
180
- */
181
- addOnTimeChangeEvent(callback: (arg0: number) => any, id: string): void;
182
- /**
183
- * Adds a new event that gets called when the tempo changes
184
- * @param callback {function(number)} the new tempo, in BPM
185
- * @param id {string} must be unique
186
- */
187
- addOnTempoChangeEvent(callback: (arg0: number) => any, id: string): void;
188
- resetMIDIOut(): void;
189
- /**
190
- * @param messageType {WorkletSequencerMessageType}
191
- * @param messageData {any}
192
- * @private
193
- */
194
- private _sendMessage;
195
- nextSong(): void;
196
- previousSong(): void;
197
- /**
198
- * @param type {Object<string, function>}
199
- * @param params {any}
200
- * @private
201
- */
202
- private _callEvents;
203
- /**
204
- * @param {WorkletSequencerReturnMessageType} messageType
205
- * @param {any} messageData
206
- * @private
207
- */
208
- private _handleMessage;
209
- /**
210
- * @param time
211
- * @private
212
- */
213
- private _recalculateStartTime;
214
- /**
215
- * @returns {Promise<MIDI>}
216
- */
217
- getMIDI(): Promise<MIDI>;
218
- /**
219
- * Loads a new song list
220
- * @param midiBuffers {MIDIFile[]} - the MIDI files to play
221
- * @param autoPlay {boolean} - if true, the first sequence will automatically start playing
222
- */
223
- loadNewSongList(midiBuffers: MIDIFile[], autoPlay?: boolean): void;
224
- songsAmount: number;
225
- /**
226
- * @param output {MIDIOutput}
227
- */
228
- connectMidiOutput(output: MIDIOutput): void;
229
- MIDIout: MIDIOutput;
230
- /**
231
- * Pauses the playback
232
- */
233
- pause(): void;
234
- unpause(): void;
235
- /**
236
- * Starts the playback
237
- * @param resetTime {boolean} If true, time is set to 0 s
238
- */
239
- play(resetTime?: boolean): void;
240
- /**
241
- * Stops the playback
242
- */
243
- stop(): void;
244
- }
245
- /**
246
- * {Object}
247
- */
248
- export type MidFile = {
249
- /**
250
- * - the binary data of the file.
251
- */
252
- binary: ArrayBuffer;
253
- /**
254
- * - the alternative name for the file
255
- */
256
- altName: string | undefined;
257
- };
258
- export type MIDIFile = BasicMIDI | MidFile;
259
- export type SequencerOptions = {
260
- /**
261
- * - if true, the sequencer will skip to the first note
262
- */
263
- skipToFirstNoteOn: boolean | undefined;
264
- /**
265
- * - if true, the sequencer will automatically start playing the MIDI
266
- */
267
- autoPlay: boolean | undefined;
268
- /**
269
- * - if true,
270
- * the sequencer will stay paused when seeking or changing the playback rate
271
- */
272
- preservePlaybackState: boolean | typeof unescape;
273
- };
274
- import { MidiData } from "../midi_parser/midi_data.js";
275
- import { Synthetizer } from "../synthetizer/synthetizer.js";
276
- import { MIDI } from "../midi_parser/midi_loader.js";
277
- import { BasicMIDI } from "../midi_parser/basic_midi.js";
@@ -1,31 +0,0 @@
1
- /**
2
- * *
3
- */
4
- export type WorkletSequencerMessageType = number;
5
- export namespace WorkletSequencerMessageType {
6
- let loadNewSongList: number;
7
- let pause: number;
8
- let stop: number;
9
- let play: number;
10
- let setTime: number;
11
- let changeMIDIMessageSending: number;
12
- let setPlaybackRate: number;
13
- let setLoop: number;
14
- let changeSong: number;
15
- let getMIDI: number;
16
- let setSkipToFirstNote: number;
17
- let setPreservePlaybackState: number;
18
- }
19
- export type WorkletSequencerReturnMessageType = number;
20
- export namespace WorkletSequencerReturnMessageType {
21
- export let midiEvent: number;
22
- export let songChange: number;
23
- export let textEvent: number;
24
- export let timeChange: number;
25
- let pause_1: number;
26
- export { pause_1 as pause };
27
- let getMIDI_1: number;
28
- export { getMIDI_1 as getMIDI };
29
- export let midiError: number;
30
- export let tempoChange: number;
31
- }
@@ -1,29 +0,0 @@
1
- export class BasicInstrument {
2
- /**
3
- * The instrument's name
4
- * @type {string}
5
- */
6
- instrumentName: string;
7
- /**
8
- * The instrument's zones
9
- * @type {BasicInstrumentZone[]}
10
- */
11
- instrumentZones: BasicInstrumentZone[];
12
- _useCount: number;
13
- /**
14
- * @returns {number}
15
- */
16
- get useCount(): number;
17
- addUseCount(): void;
18
- removeUseCount(): void;
19
- deleteInstrument(): void;
20
- /**
21
- * @param index {number}
22
- * @returns {boolean} is the zone has been deleted
23
- */
24
- safeDeleteZone(index: number): boolean;
25
- /**
26
- * @param index {number}
27
- */
28
- deleteZone(index: number): void;
29
- }
@@ -1,86 +0,0 @@
1
- export class BasicPreset {
2
- /**
3
- * @param modulators {Modulator[]}
4
- */
5
- constructor(modulators: Modulator[]);
6
- /**
7
- * The preset's name
8
- * @type {string}
9
- */
10
- presetName: string;
11
- /**
12
- * The preset's MIDI program number
13
- * @type {number}
14
- */
15
- program: number;
16
- /**
17
- * The preset's MIDI bank number
18
- * @type {number}
19
- */
20
- bank: number;
21
- /**
22
- * The preset's zones
23
- * @type {BasicPresetZone[]}
24
- */
25
- presetZones: BasicPresetZone[];
26
- /**
27
- * SampleID offset for this preset
28
- * @type {number}
29
- */
30
- sampleIDOffset: number;
31
- /**
32
- * Stores already found getSamplesAndGenerators for reuse
33
- * @type {SampleAndGenerators[][][]}
34
- */
35
- foundSamplesAndGenerators: SampleAndGenerators[][][];
36
- /**
37
- * unused metadata
38
- * @type {number}
39
- */
40
- library: number;
41
- /**
42
- * unused metadata
43
- * @type {number}
44
- */
45
- genre: number;
46
- /**
47
- * unused metadata
48
- * @type {number}
49
- */
50
- morphology: number;
51
- /**
52
- * Default modulators
53
- * @type {Modulator[]}
54
- */
55
- defaultModulators: Modulator[];
56
- deletePreset(): void;
57
- /**
58
- * @param index {number}
59
- */
60
- deleteZone(index: number): void;
61
- /**
62
- * Preloads all samples (async)
63
- */
64
- preload(keyMin: any, keyMax: any): void;
65
- /**
66
- * Preloads a specific key/velocity combo
67
- * @param key {number}
68
- * @param velocity {number}
69
- */
70
- preloadSpecific(key: number, velocity: number): void;
71
- /**
72
- * Returns generatorTranslator and generators for given note
73
- * @param midiNote {number}
74
- * @param velocity {number}
75
- * @returns {SampleAndGenerators[]}
76
- */
77
- getSamplesAndGenerators(midiNote: number, velocity: number): SampleAndGenerators[];
78
- }
79
- export type SampleAndGenerators = {
80
- instrumentGenerators: Generator[];
81
- presetGenerators: Generator[];
82
- modulators: Modulator[];
83
- sample: BasicSample;
84
- sampleID: number;
85
- };
86
- import { Modulator } from "./modulator.js";
@@ -1,88 +0,0 @@
1
- export class BasicSample {
2
- /**
3
- * The basic representation of a soundfont sample
4
- * @param sampleName {string} The sample's name
5
- * @param sampleRate {number} The sample's rate in Hz
6
- * @param samplePitch {number} The sample's pitch as a MIDI note number
7
- * @param samplePitchCorrection {number} The sample's pitch correction in cents
8
- * @param sampleLink {number} The sample's link, currently unused
9
- * @param sampleType {number} The sample's type, an enum
10
- * @param loopStart {number} The sample's loop start relative to the sample start in sample points
11
- * @param loopEnd {number} The sample's loop end relative to the sample start in sample points
12
- */
13
- constructor(sampleName: string, sampleRate: number, samplePitch: number, samplePitchCorrection: number, sampleLink: number, sampleType: number, loopStart: number, loopEnd: number);
14
- /**
15
- * Sample's name
16
- * @type {string}
17
- */
18
- sampleName: string;
19
- /**
20
- * Sample rate in Hz
21
- * @type {number}
22
- */
23
- sampleRate: number;
24
- /**
25
- * Original pitch of the sample as a MIDI note number
26
- * @type {number}
27
- */
28
- samplePitch: number;
29
- /**
30
- * Pitch correction, in cents. Can be negative
31
- * @type {number}
32
- */
33
- samplePitchCorrection: number;
34
- /**
35
- * Sample link, currently unused.
36
- * @type {number}
37
- */
38
- sampleLink: number;
39
- /**
40
- * Type of the sample, an enum
41
- * @type {number}
42
- */
43
- sampleType: number;
44
- /**
45
- * Relative to start of the sample in sample points
46
- * @type {number}
47
- */
48
- sampleLoopStartIndex: number;
49
- /**
50
- * Relative to start of the sample in sample points
51
- * @type {number}
52
- */
53
- sampleLoopEndIndex: number;
54
- /**
55
- * Indicates if the sample is compressed
56
- * @type {boolean}
57
- */
58
- isCompressed: boolean;
59
- /**
60
- * The compressed sample data if it was compressed by spessasynth
61
- * @type {Uint8Array}
62
- */
63
- compressedData: Uint8Array;
64
- /**
65
- * The sample's use count
66
- * @type {number}
67
- */
68
- useCount: number;
69
- /**
70
- * The sample's audio data
71
- * @type {Float32Array}
72
- */
73
- sampleData: Float32Array;
74
- /**
75
- * @returns {Uint8Array|IndexedByteArray}
76
- */
77
- getRawData(): Uint8Array | IndexedByteArray;
78
- resampleData(newSampleRate: any): void;
79
- /**
80
- * @param quality {number}
81
- * @param encodeVorbis {EncodeVorbisFunction}
82
- */
83
- compressSample(quality: number, encodeVorbis: EncodeVorbisFunction): void;
84
- /**
85
- * @returns {Float32Array}
86
- */
87
- getAudioData(): Float32Array;
88
- }
@@ -1,102 +0,0 @@
1
- export class BasicSoundFont {
2
- /**
3
- * Merges soundfonts with the given order. Keep in mind that the info read is copied from the first one
4
- * @param soundfonts {...BasicSoundFont} the soundfonts to merge, the first overwrites the last
5
- * @returns {BasicSoundFont}
6
- */
7
- static mergeSoundfonts(...soundfonts: BasicSoundFont[]): BasicSoundFont;
8
- /**
9
- * Creates a simple soundfont with one saw wave preset.
10
- * @returns {ArrayBufferLike}
11
- */
12
- static getDummySoundfontFile(): ArrayBufferLike;
13
- /**
14
- * Creates a new basic soundfont template
15
- * @param data {undefined|{presets: BasicPreset[], info: Object<string, string>}}
16
- */
17
- constructor(data?: undefined | {
18
- presets: BasicPreset[];
19
- info: {
20
- [x: string]: string;
21
- };
22
- });
23
- /**
24
- * Soundfont's info stored as name: value. ifil and iver are stored as string representation of float (e.g. 2.1)
25
- * @type {Object<string, string|IndexedByteArray>}
26
- */
27
- soundFontInfo: {
28
- [x: string]: any;
29
- };
30
- /**
31
- * The soundfont's presets
32
- * @type {BasicPreset[]}
33
- */
34
- presets: BasicPreset[];
35
- /**
36
- * The soundfont's samples
37
- * @type {BasicSample[]}
38
- */
39
- samples: BasicSample[];
40
- /**
41
- * The soundfont's instruments
42
- * @type {BasicInstrument[]}
43
- */
44
- instruments: BasicInstrument[];
45
- /**
46
- * Soundfont's default modulatorss
47
- * @type {Modulator[]}
48
- */
49
- defaultModulators: Modulator[];
50
- removeUnusedElements(): void;
51
- /**
52
- * @param instrument {BasicInstrument}
53
- */
54
- deleteInstrument(instrument: BasicInstrument): void;
55
- /**
56
- * @param preset {BasicPreset}
57
- */
58
- deletePreset(preset: BasicPreset): void;
59
- /**
60
- * @param sample {BasicSample}
61
- */
62
- deleteSample(sample: BasicSample): void;
63
- /**
64
- * To avoid overlapping on multiple desfonts
65
- * @param offset {number}
66
- */
67
- setSampleIDOffset(offset: number): void;
68
- /**
69
- * Get the appropriate preset, undefined if not foun d
70
- * @param bankNr {number}
71
- * @param programNr {number}
72
- * @param fallbackToProgram {boolean} if true, if no exact match is found, will use any bank with the given preset
73
- * @return {BasicPreset}
74
- */
75
- getPresetNoFallback(bankNr: number, programNr: number, fallbackToProgram?: boolean): BasicPreset;
76
- /**
77
- * Get the appropriate preset
78
- * @param bankNr {number}
79
- * @param programNr {number}
80
- * @returns {BasicPreset}
81
- */
82
- getPreset(bankNr: number, programNr: number): BasicPreset;
83
- /**
84
- * gets preset by name
85
- * @param presetName {string}
86
- * @returns {BasicPreset}
87
- */
88
- getPresetByName(presetName: string): BasicPreset;
89
- /**
90
- * @param error {string}
91
- */
92
- parsingError(error: string): void;
93
- destroySoundfont(): void;
94
- write: typeof write;
95
- writeDLS: typeof writeDLS;
96
- }
97
- import { BasicPreset } from "./basic_preset.js";
98
- import { BasicSample } from "./basic_sample.js";
99
- import { BasicInstrument } from "./basic_instrument.js";
100
- import { Modulator } from "./modulator.js";
101
- import { write } from "./write_sf2/write.js";
102
- import { writeDLS } from "./write_dls/write_dls.js";