spessasynth_lib 3.25.23 → 3.26.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 +29 -114
- package/index.js +33 -33
- package/package.json +16 -6
- package/external_midi/README.md +0 -4
- package/external_midi/midi_handler.js +0 -130
- package/external_midi/web_midi_link.js +0 -43
- package/externals/fflate/LICENSE +0 -21
- package/externals/fflate/fflate.min.js +0 -1
- package/externals/stbvorbis_sync/@types/stbvorbis_sync.d.ts +0 -12
- package/externals/stbvorbis_sync/LICENSE +0 -202
- package/externals/stbvorbis_sync/NOTICE +0 -6
- package/externals/stbvorbis_sync/stbvorbis_sync.min.js +0 -1
- package/midi/README.md +0 -32
- package/midi/basic_midi.js +0 -565
- package/midi/midi_builder.js +0 -202
- package/midi/midi_data.js +0 -63
- package/midi/midi_loader.js +0 -324
- package/midi/midi_message.js +0 -254
- package/midi/midi_sequence.js +0 -225
- package/midi/midi_tools/get_note_times.js +0 -154
- package/midi/midi_tools/midi_editor.js +0 -611
- package/midi/midi_tools/midi_writer.js +0 -99
- package/midi/midi_tools/rmidi_writer.js +0 -567
- package/midi/midi_tools/used_keys_loaded.js +0 -238
- package/midi/xmf_loader.js +0 -454
- package/sequencer/README.md +0 -32
- package/sequencer/sequencer_engine/events.js +0 -104
- package/sequencer/sequencer_engine/play.js +0 -353
- package/sequencer/sequencer_engine/process_event.js +0 -169
- package/sequencer/sequencer_engine/process_tick.js +0 -106
- package/sequencer/sequencer_engine/sequencer_engine.js +0 -335
- package/sequencer/sequencer_engine/song_control.js +0 -229
- package/sequencer/worklet_wrapper/default_sequencer_options.js +0 -8
- package/sequencer/worklet_wrapper/sequencer.js +0 -807
- package/sequencer/worklet_wrapper/sequencer_message.js +0 -53
- package/soundfont/README.md +0 -13
- package/soundfont/basic_soundfont/basic_instrument.js +0 -77
- package/soundfont/basic_soundfont/basic_preset.js +0 -336
- package/soundfont/basic_soundfont/basic_sample.js +0 -197
- package/soundfont/basic_soundfont/basic_soundfont.js +0 -565
- package/soundfont/basic_soundfont/basic_zone.js +0 -64
- package/soundfont/basic_soundfont/basic_zones.js +0 -43
- package/soundfont/basic_soundfont/generator.js +0 -220
- package/soundfont/basic_soundfont/modulator.js +0 -378
- package/soundfont/basic_soundfont/riff_chunk.js +0 -149
- package/soundfont/basic_soundfont/write_dls/art2.js +0 -173
- package/soundfont/basic_soundfont/write_dls/articulator.js +0 -49
- package/soundfont/basic_soundfont/write_dls/combine_zones.js +0 -400
- package/soundfont/basic_soundfont/write_dls/ins.js +0 -103
- package/soundfont/basic_soundfont/write_dls/lins.js +0 -18
- package/soundfont/basic_soundfont/write_dls/modulator_converter.js +0 -330
- package/soundfont/basic_soundfont/write_dls/rgn2.js +0 -121
- package/soundfont/basic_soundfont/write_dls/wave.js +0 -94
- package/soundfont/basic_soundfont/write_dls/write_dls.js +0 -119
- package/soundfont/basic_soundfont/write_dls/wsmp.js +0 -78
- package/soundfont/basic_soundfont/write_dls/wvpl.js +0 -32
- package/soundfont/basic_soundfont/write_sf2/ibag.js +0 -39
- package/soundfont/basic_soundfont/write_sf2/igen.js +0 -80
- package/soundfont/basic_soundfont/write_sf2/imod.js +0 -46
- package/soundfont/basic_soundfont/write_sf2/inst.js +0 -34
- package/soundfont/basic_soundfont/write_sf2/pbag.js +0 -39
- package/soundfont/basic_soundfont/write_sf2/pgen.js +0 -82
- package/soundfont/basic_soundfont/write_sf2/phdr.js +0 -42
- package/soundfont/basic_soundfont/write_sf2/pmod.js +0 -46
- package/soundfont/basic_soundfont/write_sf2/sdta.js +0 -80
- package/soundfont/basic_soundfont/write_sf2/shdr.js +0 -55
- package/soundfont/basic_soundfont/write_sf2/write.js +0 -222
- package/soundfont/dls/articulator_converter.js +0 -396
- package/soundfont/dls/dls_destinations.js +0 -38
- package/soundfont/dls/dls_preset.js +0 -44
- package/soundfont/dls/dls_sample.js +0 -75
- package/soundfont/dls/dls_soundfont.js +0 -186
- package/soundfont/dls/dls_sources.js +0 -62
- package/soundfont/dls/dls_zone.js +0 -95
- package/soundfont/dls/read_articulation.js +0 -299
- package/soundfont/dls/read_instrument.js +0 -121
- package/soundfont/dls/read_instrument_list.js +0 -17
- package/soundfont/dls/read_lart.js +0 -35
- package/soundfont/dls/read_region.js +0 -152
- package/soundfont/dls/read_samples.js +0 -270
- package/soundfont/load_soundfont.js +0 -21
- package/soundfont/read_sf2/generators.js +0 -46
- package/soundfont/read_sf2/instruments.js +0 -66
- package/soundfont/read_sf2/modulators.js +0 -36
- package/soundfont/read_sf2/presets.js +0 -80
- package/soundfont/read_sf2/samples.js +0 -304
- package/soundfont/read_sf2/soundfont.js +0 -305
- package/soundfont/read_sf2/zones.js +0 -263
- package/synthetizer/README.md +0 -10
- package/synthetizer/audio_effects/effects_config.js +0 -25
- package/synthetizer/audio_effects/fancy_chorus.js +0 -162
- package/synthetizer/audio_effects/rb_compressed.min.js +0 -1
- package/synthetizer/audio_effects/reverb.js +0 -35
- package/synthetizer/audio_effects/reverb_as_binary.js +0 -18
- package/synthetizer/audio_engine/README.md +0 -25
- package/synthetizer/audio_engine/engine_components/compute_modulator.js +0 -266
- package/synthetizer/audio_engine/engine_components/controller_tables.js +0 -88
- package/synthetizer/audio_engine/engine_components/key_modifier_manager.js +0 -149
- package/synthetizer/audio_engine/engine_components/lfo.js +0 -26
- package/synthetizer/audio_engine/engine_components/lowpass_filter.js +0 -282
- package/synthetizer/audio_engine/engine_components/midi_audio_channel.js +0 -471
- package/synthetizer/audio_engine/engine_components/modulation_envelope.js +0 -181
- package/synthetizer/audio_engine/engine_components/modulator_curves.js +0 -89
- package/synthetizer/audio_engine/engine_components/soundfont_manager.js +0 -228
- package/synthetizer/audio_engine/engine_components/stereo_panner.js +0 -120
- package/synthetizer/audio_engine/engine_components/unit_converter.js +0 -73
- package/synthetizer/audio_engine/engine_components/voice.js +0 -519
- package/synthetizer/audio_engine/engine_components/volume_envelope.js +0 -401
- package/synthetizer/audio_engine/engine_components/wavetable_oscillator.js +0 -263
- package/synthetizer/audio_engine/engine_methods/controller_control/controller_change.js +0 -132
- package/synthetizer/audio_engine/engine_methods/controller_control/master_parameters.js +0 -48
- package/synthetizer/audio_engine/engine_methods/controller_control/reset_controllers.js +0 -241
- package/synthetizer/audio_engine/engine_methods/create_midi_channel.js +0 -27
- package/synthetizer/audio_engine/engine_methods/data_entry/data_entry_coarse.js +0 -253
- package/synthetizer/audio_engine/engine_methods/data_entry/data_entry_fine.js +0 -66
- package/synthetizer/audio_engine/engine_methods/mute_channel.js +0 -17
- package/synthetizer/audio_engine/engine_methods/note_on.js +0 -175
- package/synthetizer/audio_engine/engine_methods/portamento_time.js +0 -92
- package/synthetizer/audio_engine/engine_methods/program_change.js +0 -61
- package/synthetizer/audio_engine/engine_methods/render_voice.js +0 -196
- package/synthetizer/audio_engine/engine_methods/soundfont_management/clear_sound_font.js +0 -30
- package/synthetizer/audio_engine/engine_methods/soundfont_management/get_preset.js +0 -22
- package/synthetizer/audio_engine/engine_methods/soundfont_management/reload_sound_font.js +0 -40
- package/synthetizer/audio_engine/engine_methods/soundfont_management/send_preset_list.js +0 -34
- package/synthetizer/audio_engine/engine_methods/soundfont_management/set_embedded_sound_font.js +0 -21
- package/synthetizer/audio_engine/engine_methods/stopping_notes/kill_note.js +0 -20
- package/synthetizer/audio_engine/engine_methods/stopping_notes/note_off.js +0 -55
- package/synthetizer/audio_engine/engine_methods/stopping_notes/stop_all_channels.js +0 -16
- package/synthetizer/audio_engine/engine_methods/stopping_notes/stop_all_notes.js +0 -30
- package/synthetizer/audio_engine/engine_methods/stopping_notes/voice_killing.js +0 -63
- package/synthetizer/audio_engine/engine_methods/system_exclusive.js +0 -776
- package/synthetizer/audio_engine/engine_methods/tuning_control/channel_pressure.js +0 -24
- package/synthetizer/audio_engine/engine_methods/tuning_control/pitch_wheel.js +0 -33
- package/synthetizer/audio_engine/engine_methods/tuning_control/poly_pressure.js +0 -31
- package/synthetizer/audio_engine/engine_methods/tuning_control/set_master_tuning.js +0 -15
- package/synthetizer/audio_engine/engine_methods/tuning_control/set_modulation_depth.js +0 -27
- package/synthetizer/audio_engine/engine_methods/tuning_control/set_octave_tuning.js +0 -19
- package/synthetizer/audio_engine/engine_methods/tuning_control/set_tuning.js +0 -27
- package/synthetizer/audio_engine/engine_methods/tuning_control/transpose_all_channels.js +0 -15
- package/synthetizer/audio_engine/engine_methods/tuning_control/transpose_channel.js +0 -34
- package/synthetizer/audio_engine/main_processor.js +0 -765
- package/synthetizer/audio_engine/message_protocol/README.md +0 -13
- package/synthetizer/audio_engine/message_protocol/message_sending.js +0 -22
- package/synthetizer/audio_engine/message_protocol/worklet_message.js +0 -107
- package/synthetizer/audio_engine/snapshot/apply_synthesizer_snapshot.js +0 -14
- package/synthetizer/audio_engine/snapshot/channel_snapshot.js +0 -175
- package/synthetizer/audio_engine/snapshot/synthesizer_snapshot.js +0 -122
- package/synthetizer/synth_constants.js +0 -20
- package/synthetizer/worklet_processor.min.js +0 -21
- package/synthetizer/worklet_wrapper/key_modifier_manager.js +0 -104
- package/synthetizer/worklet_wrapper/sfman_message.js +0 -9
- package/synthetizer/worklet_wrapper/synth_event_handler.js +0 -214
- package/synthetizer/worklet_wrapper/synth_soundfont_manager.js +0 -109
- package/synthetizer/worklet_wrapper/synthetizer.js +0 -1027
- package/synthetizer/worklet_wrapper/worklet_processor.js +0 -454
- package/synthetizer/worklet_wrapper/worklet_url.js +0 -16
- package/utils/README.md +0 -5
- package/utils/buffer_to_wav.js +0 -186
- package/utils/byte_functions/big_endian.js +0 -32
- package/utils/byte_functions/little_endian.js +0 -77
- package/utils/byte_functions/string.js +0 -107
- package/utils/byte_functions/variable_length_quantity.js +0 -42
- package/utils/fill_with_defaults.js +0 -21
- package/utils/indexed_array.js +0 -52
- package/utils/loggin.js +0 -79
- package/utils/other.js +0 -92
- package/utils/sysex_detector.js +0 -58
- package/utils/xg_hacks.js +0 -193
package/utils/xg_hacks.js
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { SpessaSynthInfo } from "./loggin.js";
|
|
2
|
-
import { consoleColors } from "./other.js";
|
|
3
|
-
import { DEFAULT_PERCUSSION } from "../synthetizer/synth_constants.js";
|
|
4
|
-
|
|
5
|
-
export const XG_SFX_VOICE = 64;
|
|
6
|
-
|
|
7
|
-
const GM2_DEFAULT_BANK = 121;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @param sys {SynthSystem}
|
|
11
|
-
* @returns {number}
|
|
12
|
-
*/
|
|
13
|
-
export function getDefaultBank(sys)
|
|
14
|
-
{
|
|
15
|
-
return sys === "gm2" ? GM2_DEFAULT_BANK : 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @param bankNr {number}
|
|
20
|
-
* @returns {boolean}
|
|
21
|
-
*/
|
|
22
|
-
export function isXGDrums(bankNr)
|
|
23
|
-
{
|
|
24
|
-
return bankNr === 120 || bankNr === 126 || bankNr === 127;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @param bank {number}
|
|
29
|
-
* @returns {boolean}
|
|
30
|
-
*/
|
|
31
|
-
export function isValidXGMSB(bank)
|
|
32
|
-
{
|
|
33
|
-
return isXGDrums(bank) || bank === XG_SFX_VOICE || bank === GM2_DEFAULT_BANK;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Bank select hacks abstracted here
|
|
38
|
-
* @param bankBefore {number} the current bank number
|
|
39
|
-
* @param bank {number} the cc change bank number
|
|
40
|
-
* @param system {SynthSystem} MIDI system
|
|
41
|
-
* @param isLSB {boolean} is bank LSB?
|
|
42
|
-
* @param isDrums {boolean} is drum channel?
|
|
43
|
-
* @param channelNumber {number} channel number
|
|
44
|
-
* @returns {{
|
|
45
|
-
* newBank: number,
|
|
46
|
-
* drumsStatus: 0|1|2
|
|
47
|
-
* }} 0 - unchanged, 1 - OFF, 2 - ON
|
|
48
|
-
*/
|
|
49
|
-
export function parseBankSelect(bankBefore, bank, system, isLSB, isDrums, channelNumber)
|
|
50
|
-
{
|
|
51
|
-
// 64 means SFX in MSB, so it is allowed
|
|
52
|
-
let out = bankBefore;
|
|
53
|
-
let drumsStatus = 0;
|
|
54
|
-
if (isLSB)
|
|
55
|
-
{
|
|
56
|
-
if (isSystemXG(system))
|
|
57
|
-
{
|
|
58
|
-
if (!isValidXGMSB(bank))
|
|
59
|
-
{
|
|
60
|
-
out = bank;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
else if (system === "gm2")
|
|
64
|
-
{
|
|
65
|
-
out = bank;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
else
|
|
69
|
-
{
|
|
70
|
-
let canSetBankSelect = true;
|
|
71
|
-
switch (system)
|
|
72
|
-
{
|
|
73
|
-
case "gm":
|
|
74
|
-
// gm ignores bank select
|
|
75
|
-
SpessaSynthInfo(
|
|
76
|
-
`%cIgnoring the Bank Select (${bank}), as the synth is in GM mode.`,
|
|
77
|
-
consoleColors.info
|
|
78
|
-
);
|
|
79
|
-
canSetBankSelect = false;
|
|
80
|
-
break;
|
|
81
|
-
|
|
82
|
-
case "xg":
|
|
83
|
-
canSetBankSelect = isValidXGMSB(bank);
|
|
84
|
-
// for xg, if msb is 120, 126 or 127, then it's drums
|
|
85
|
-
if (isXGDrums(bank))
|
|
86
|
-
{
|
|
87
|
-
drumsStatus = 2;
|
|
88
|
-
}
|
|
89
|
-
else
|
|
90
|
-
{
|
|
91
|
-
// drums shall not be disabled on channel 9
|
|
92
|
-
if (channelNumber % 16 !== DEFAULT_PERCUSSION)
|
|
93
|
-
{
|
|
94
|
-
drumsStatus = 1;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
break;
|
|
98
|
-
|
|
99
|
-
case "gm2":
|
|
100
|
-
if (bank === 120)
|
|
101
|
-
{
|
|
102
|
-
drumsStatus = 2;
|
|
103
|
-
}
|
|
104
|
-
else
|
|
105
|
-
{
|
|
106
|
-
if (channelNumber % 16 !== DEFAULT_PERCUSSION)
|
|
107
|
-
{
|
|
108
|
-
drumsStatus = 1;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (isDrums)
|
|
114
|
-
{
|
|
115
|
-
// 128 for percussion channel
|
|
116
|
-
bank = 128;
|
|
117
|
-
}
|
|
118
|
-
if (bank === 128 && !isDrums)
|
|
119
|
-
{
|
|
120
|
-
// if a channel is not for percussion, default to bank current
|
|
121
|
-
bank = bankBefore;
|
|
122
|
-
}
|
|
123
|
-
if (canSetBankSelect)
|
|
124
|
-
{
|
|
125
|
-
out = bank;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
newBank: out,
|
|
130
|
-
drumsStatus: drumsStatus
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Chooses a bank number according to spessasynth logic
|
|
137
|
-
* That is:
|
|
138
|
-
* for GS, bank MSB if not drum, otherwise 128
|
|
139
|
-
* for XG: bank MSB if drum and MSB is valid, 128 othewise, bank MSB if it is SFX voice, LSB otherwise
|
|
140
|
-
* @param msb {number}
|
|
141
|
-
* @param lsb {number}
|
|
142
|
-
* @param isDrums {boolean}
|
|
143
|
-
* @param isXG {boolean}
|
|
144
|
-
* @returns {number}
|
|
145
|
-
*/
|
|
146
|
-
export function chooseBank(msb, lsb, isDrums, isXG)
|
|
147
|
-
{
|
|
148
|
-
if (isXG)
|
|
149
|
-
{
|
|
150
|
-
if (isDrums)
|
|
151
|
-
{
|
|
152
|
-
if (isXGDrums(msb))
|
|
153
|
-
{
|
|
154
|
-
return msb;
|
|
155
|
-
}
|
|
156
|
-
else
|
|
157
|
-
{
|
|
158
|
-
return 128;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
else
|
|
162
|
-
{
|
|
163
|
-
// check for SFX
|
|
164
|
-
if (isValidXGMSB(msb))
|
|
165
|
-
{
|
|
166
|
-
return msb;
|
|
167
|
-
}
|
|
168
|
-
// if lsb is 0 and msb is not, use that
|
|
169
|
-
if (lsb === 0 && msb !== 0)
|
|
170
|
-
{
|
|
171
|
-
return msb;
|
|
172
|
-
}
|
|
173
|
-
if (!isValidXGMSB(lsb))
|
|
174
|
-
{
|
|
175
|
-
return lsb;
|
|
176
|
-
}
|
|
177
|
-
return 0;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else
|
|
181
|
-
{
|
|
182
|
-
return isDrums ? 128 : msb;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* @param system {SynthSystem}
|
|
188
|
-
* @returns boolean
|
|
189
|
-
*/
|
|
190
|
-
export function isSystemXG(system)
|
|
191
|
-
{
|
|
192
|
-
return system === "gm2" || system === "xg";
|
|
193
|
-
}
|