spessasynth_lib 3.27.7 → 4.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.
Files changed (34) hide show
  1. package/README.md +50 -44
  2. package/dist/index.d.ts +1328 -0
  3. package/dist/index.js +3212 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/spessasynth_processor.min.js +21 -0
  6. package/dist/spessasynth_processor.min.js.map +7 -0
  7. package/package.json +28 -9
  8. package/index.js +0 -29
  9. package/src/external_midi/README.md +0 -4
  10. package/src/external_midi/midi_handler.js +0 -130
  11. package/src/external_midi/web_midi_link.js +0 -43
  12. package/src/sequencer/README.md +0 -30
  13. package/src/sequencer/default_sequencer_options.js +0 -9
  14. package/src/sequencer/midi_data.js +0 -67
  15. package/src/sequencer/sequencer.js +0 -813
  16. package/src/sequencer/sequencer_message.js +0 -53
  17. package/src/synthetizer/README.md +0 -30
  18. package/src/synthetizer/audio_effects/effects_config.js +0 -25
  19. package/src/synthetizer/audio_effects/fancy_chorus.js +0 -166
  20. package/src/synthetizer/audio_effects/rb_compressed.min.js +0 -1
  21. package/src/synthetizer/audio_effects/reverb.js +0 -35
  22. package/src/synthetizer/audio_effects/reverb_as_binary.js +0 -18
  23. package/src/synthetizer/key_modifier_manager.js +0 -113
  24. package/src/synthetizer/sfman_message.js +0 -9
  25. package/src/synthetizer/synth_event_handler.js +0 -217
  26. package/src/synthetizer/synth_soundfont_manager.js +0 -115
  27. package/src/synthetizer/synthetizer.js +0 -1033
  28. package/src/synthetizer/worklet_message.js +0 -121
  29. package/src/synthetizer/worklet_processor.js +0 -654
  30. package/src/synthetizer/worklet_url.js +0 -18
  31. package/src/utils/buffer_to_wav.js +0 -40
  32. package/src/utils/fill_with_defaults.js +0 -21
  33. package/src/utils/other.js +0 -11
  34. package/synthetizer/worklet_processor.min.js +0 -22
@@ -1,40 +0,0 @@
1
- /**
2
- * @typedef {Object} WaveMetadata
3
- * @property {string|undefined} title - the song's title
4
- * @property {string|undefined} artist - the song's artist
5
- * @property {string|undefined} album - the song's album
6
- * @property {string|undefined} genre - the song's genre
7
- */
8
-
9
- import { audioToWav } from "spessasynth_core";
10
-
11
- // noinspection JSUnusedGlobalSymbols
12
- /**
13
- * Converts an audio buffer into a wave file
14
- * @param audioBuffer {AudioBuffer} variable channels
15
- * @param normalizeAudio {boolean} find the max sample point and set it to 1, and scale others with it
16
- * @param channelOffset {number} channel offset and channel offset + 1 get saved
17
- * @param metadata {WaveMetadata}
18
- * @param loop {{start: number, end: number}} loop start and end points in seconds. Undefined if no loop
19
- * @param channelCount {number} the channel count, defaults to all the channels
20
- * @returns {Blob}
21
- */
22
- export function audioBufferToWav(audioBuffer, normalizeAudio = true, channelOffset = 0, metadata = {}, loop = undefined, channelCount = audioBuffer.numberOfChannels)
23
- {
24
- /**
25
- * @type {Float32Array[]}
26
- */
27
- const channels = [];
28
- for (let i = channelOffset; i < audioBuffer.numberOfChannels; i++)
29
- {
30
- channels.push(audioBuffer.getChannelData(i));
31
- if (channels.length >= channelCount)
32
- {
33
- break;
34
- }
35
- }
36
- return new Blob(
37
- [audioToWav(channels, audioBuffer.sampleRate, normalizeAudio, metadata, loop)],
38
- { type: "audio/wav" }
39
- );
40
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Fills the object with default values
3
- * @param obj {Object}
4
- * @param defObj {Object}
5
- * @returns {Object}
6
- */
7
- export function fillWithDefaults(obj, defObj)
8
- {
9
- if (obj === undefined)
10
- {
11
- obj = {};
12
- }
13
- for (const key in defObj)
14
- {
15
- if (defObj.hasOwnProperty(key) && !(key in obj))
16
- {
17
- obj[key] = defObj[key];
18
- }
19
- }
20
- return obj;
21
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * other.js
3
- * purpose: contains some useful functions that don't belong in any specific category
4
- */
5
-
6
- import { SpessaSynthCoreUtils } from "spessasynth_core";
7
-
8
- const consoleColors = SpessaSynthCoreUtils.consoleColors;
9
-
10
- export { consoleColors };
11
-