spessasynth_lib 3.16.5 → 3.17.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/@types/index.d.ts +5 -4
- package/@types/midi_parser/basic_midi.d.ts +125 -0
- package/@types/midi_parser/midi_builder.d.ts +69 -0
- package/@types/midi_parser/midi_data.d.ts +2 -2
- package/@types/midi_parser/midi_editor.d.ts +4 -4
- package/@types/midi_parser/midi_loader.d.ts +3 -100
- package/@types/midi_parser/midi_writer.d.ts +2 -2
- package/@types/midi_parser/rmidi_writer.d.ts +3 -3
- package/@types/midi_parser/used_keys_loaded.d.ts +2 -2
- package/@types/sequencer/sequencer.d.ts +1 -1
- package/@types/soundfont/basic_soundfont/write_sf2/soundfont_trimmer.d.ts +2 -2
- package/@types/soundfont/dls/dls_preset.d.ts +11 -0
- package/@types/soundfont/dls/dls_soundfont.d.ts +24 -0
- package/@types/soundfont/dls/read_instrument.d.ts +5 -0
- package/@types/soundfont/dls/read_instrument_list.d.ts +5 -0
- package/@types/soundfont/load_soundfont.d.ts +6 -0
- package/@types/soundfont/soundfont.d.ts +2 -1
- package/@types/synthetizer/synthetizer.d.ts +2 -2
- package/@types/utils/byte_functions/little_endian.d.ts +1 -1
- package/README.md +17 -15
- package/index.js +6 -4
- package/midi_parser/basic_midi.js +146 -0
- package/midi_parser/midi_builder.js +281 -0
- package/midi_parser/midi_data.js +1 -1
- package/midi_parser/midi_editor.js +2 -2
- package/midi_parser/midi_loader.js +8 -53
- package/midi_parser/midi_writer.js +1 -1
- package/midi_parser/rmidi_writer.js +2 -2
- package/midi_parser/used_keys_loaded.js +1 -1
- package/package.json +1 -1
- package/sequencer/sequencer.js +1 -1
- package/sequencer/worklet_sequencer/song_control.js +3 -3
- package/sequencer/worklet_sequencer/worklet_sequencer.js +1 -1
- package/soundfont/basic_soundfont/riff_chunk.js +2 -2
- package/soundfont/basic_soundfont/write_sf2/soundfont_trimmer.js +1 -1
- package/soundfont/dls/dls_preset.js +25 -0
- package/soundfont/dls/dls_soundfont.js +93 -0
- package/soundfont/dls/read_instrument.js +22 -0
- package/soundfont/dls/read_instrument_list.js +17 -0
- package/soundfont/load_soundfont.js +21 -0
- package/soundfont/read_sf2/instruments.js +2 -2
- package/soundfont/read_sf2/modulators.js +5 -5
- package/soundfont/read_sf2/presets.js +7 -7
- package/soundfont/read_sf2/samples.js +8 -8
- package/soundfont/read_sf2/zones.js +5 -5
- package/soundfont/soundfont.js +8 -3
- package/synthetizer/synthetizer.js +1 -1
- package/synthetizer/worklet_processor.min.js +7 -6
- package/synthetizer/worklet_system/main_processor.js +1 -2
- package/synthetizer/worklet_system/worklet_methods/program_control.js +6 -3
- package/synthetizer/worklet_system/worklet_methods/worklet_soundfont_manager/worklet_soundfont_manager.js +5 -5
- package/utils/byte_functions/little_endian.js +1 -1
- /package/@types/{midi_handler → external_midi}/midi_handler.d.ts +0 -0
- /package/@types/{midi_handler → external_midi}/web_midi_link.d.ts +0 -0
- /package/{midi_handler → external_midi}/README.md +0 -0
- /package/{midi_handler → external_midi}/midi_handler.js +0 -0
- /package/{midi_handler → external_midi}/web_midi_link.js +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DEFAULT_PERCUSSION, DEFAULT_SYNTH_MODE, VOICE_CAP } from '../synthetizer.js'
|
|
2
|
-
import { SoundFont2 } from '../../soundfont/soundfont.js'
|
|
3
2
|
import { WorkletSequencer } from '../../sequencer/worklet_sequencer/worklet_sequencer.js'
|
|
4
3
|
import { SpessaSynthInfo } from '../../utils/loggin.js'
|
|
5
4
|
import { consoleColors } from '../../utils/other.js'
|
|
@@ -134,7 +133,7 @@ class SpessaSynthProcessor extends AudioWorkletProcessor
|
|
|
134
133
|
|
|
135
134
|
/**
|
|
136
135
|
* Overrides the main soundfont (embedded for example
|
|
137
|
-
* @type {
|
|
136
|
+
* @type {BasicSoundFont}
|
|
138
137
|
*/
|
|
139
138
|
this.overrideSoundfont = undefined;
|
|
140
139
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { midiControllers } from '../../../midi_parser/midi_message.js'
|
|
2
|
-
import { SoundFont2 } from '../../../soundfont/soundfont.js'
|
|
3
2
|
import { clearSamplesList } from '../worklet_utilities/worklet_voice.js'
|
|
4
3
|
import { generatorTypes } from '../../../soundfont/read_sf2/generators.js'
|
|
5
4
|
import { returnMessageType } from '../message_protocol/worklet_message.js'
|
|
6
5
|
import { SpessaSynthInfo } from '../../../utils/loggin.js'
|
|
7
6
|
import { consoleColors } from '../../../utils/other.js'
|
|
7
|
+
import { loadSoundFont } from '../../../soundfont/load_soundfont.js'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* executes a program change
|
|
@@ -196,7 +196,10 @@ export function clearSoundFont(sendPresets = true, clearOverride = true)
|
|
|
196
196
|
{
|
|
197
197
|
channelObject.cachedVoices.push([]);
|
|
198
198
|
}
|
|
199
|
-
|
|
199
|
+
if(!clearOverride)
|
|
200
|
+
{
|
|
201
|
+
channelObject.lockPreset = false;
|
|
202
|
+
}
|
|
200
203
|
this.programChange(i, channelObject.preset.program);
|
|
201
204
|
}
|
|
202
205
|
if(sendPresets)
|
|
@@ -217,7 +220,7 @@ export function reloadSoundFont(buffer, isOverride = false)
|
|
|
217
220
|
{
|
|
218
221
|
if(isOverride)
|
|
219
222
|
{
|
|
220
|
-
this.overrideSoundfont =
|
|
223
|
+
this.overrideSoundfont = loadSoundFont(buffer);
|
|
221
224
|
// assign sample offset
|
|
222
225
|
this.overrideSoundfont.setSampleIDOffset(this.soundfontManager.totalSoundfontOffset)
|
|
223
226
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SoundFont2 } from '../../../../soundfont/soundfont.js'
|
|
2
1
|
import { SpessaSynthWarn } from '../../../../utils/loggin.js'
|
|
3
2
|
import { WorkletSoundfontManagerMessageType } from './sfman_message.js'
|
|
3
|
+
import { loadSoundFont } from '../../../../soundfont/load_soundfont.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {Object} SoundFontType
|
|
7
7
|
* @property {string} id - unique id for the soundfont
|
|
8
|
-
* @property {
|
|
8
|
+
* @property {BasicSoundFont} soundfont - the soundfont itself
|
|
9
9
|
* @property {number} bankOffset - the soundfont's bank offset
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -110,7 +110,7 @@ export class WorkletSoundfontManager
|
|
|
110
110
|
*/
|
|
111
111
|
reloadManager(soundFontArrayBuffer)
|
|
112
112
|
{
|
|
113
|
-
const font =
|
|
113
|
+
const font = loadSoundFont(soundFontArrayBuffer);
|
|
114
114
|
/**
|
|
115
115
|
* All the soundfonts, ordered from the most important to the least.
|
|
116
116
|
* @type {SoundFontType[]}
|
|
@@ -159,7 +159,7 @@ export class WorkletSoundfontManager
|
|
|
159
159
|
}
|
|
160
160
|
this.soundfontList.push({
|
|
161
161
|
id: id,
|
|
162
|
-
soundfont:
|
|
162
|
+
soundfont: loadSoundFont(buffer),
|
|
163
163
|
bankOffset: bankOffset
|
|
164
164
|
});
|
|
165
165
|
this.generatePresetList();
|
|
@@ -182,7 +182,7 @@ export class WorkletSoundfontManager
|
|
|
182
182
|
* Gets a given preset from the soundfont stack
|
|
183
183
|
* @param bankNumber {number}
|
|
184
184
|
* @param programNumber {number}
|
|
185
|
-
* @returns {
|
|
185
|
+
* @returns {BasicPreset} the preset
|
|
186
186
|
*/
|
|
187
187
|
getPreset(bankNumber, programNumber)
|
|
188
188
|
{
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|