spessasynth_lib 3.24.34 → 3.24.35
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/midi_parser/midi_editor.js +1 -1
- package/midi_parser/rmidi_writer.js +1 -1
- package/midi_parser/used_keys_loaded.js +1 -1
- package/package.json +1 -1
- package/sequencer/worklet_sequencer/events.js +2 -1
- package/sequencer/worklet_sequencer/worklet_sequencer.js +2 -1
- package/soundfont/basic_soundfont/write_dls/wave.js +2 -1
- package/synthetizer/audio_effects/effects_config.js +3 -3
- package/synthetizer/audio_effects/fancy_chorus.js +7 -7
- package/synthetizer/audio_effects/reverb.js +5 -5
- package/synthetizer/audio_effects/reverb_as_binary.js +15 -0
- package/synthetizer/audio_effects/reverb_buffer.min.js +1 -0
- package/synthetizer/synth_constants.js +14 -0
- package/synthetizer/synthetizer.js +1 -17
- package/synthetizer/worklet_processor.min.js +11 -11
- package/synthetizer/worklet_system/main_processor.js +1 -1
- package/synthetizer/worklet_system/worklet_methods/controller_control/controller_change.js +1 -1
- package/synthetizer/worklet_system/worklet_methods/controller_control/reset_controllers.js +1 -1
- package/synthetizer/worklet_system/worklet_methods/create_worklet_channel.js +2 -1
- package/synthetizer/worklet_system/worklet_processor.js +1 -1
- package/synthetizer/audio_effects/impulse_response_2.flac +0 -0
- package/synthetizer/worklet_system/minify_processor.sh +0 -4
|
@@ -2,9 +2,9 @@ import { messageTypes, midiControllers, MIDIMessage } from "./midi_message.js";
|
|
|
2
2
|
import { IndexedByteArray } from "../utils/indexed_array.js";
|
|
3
3
|
import { SpessaSynthGroupCollapsed, SpessaSynthGroupEnd, SpessaSynthInfo } from "../utils/loggin.js";
|
|
4
4
|
import { consoleColors } from "../utils/other.js";
|
|
5
|
-
import { DEFAULT_PERCUSSION } from "../synthetizer/synthetizer.js";
|
|
6
5
|
|
|
7
6
|
import { customControllers } from "../synthetizer/worklet_system/worklet_utilities/controller_tables.js";
|
|
7
|
+
import { DEFAULT_PERCUSSION } from "../synthetizer/synth_constants.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @param ticks {number}
|
|
@@ -2,11 +2,11 @@ import { combineArrays, IndexedByteArray } from "../utils/indexed_array.js";
|
|
|
2
2
|
import { writeRIFFOddSize } from "../soundfont/basic_soundfont/riff_chunk.js";
|
|
3
3
|
import { getStringBytes, getStringBytesZero } from "../utils/byte_functions/string.js";
|
|
4
4
|
import { messageTypes, midiControllers, MIDIMessage } from "./midi_message.js";
|
|
5
|
-
import { DEFAULT_PERCUSSION } from "../synthetizer/synthetizer.js";
|
|
6
5
|
import { getGsOn } from "./midi_editor.js";
|
|
7
6
|
import { SpessaSynthGroup, SpessaSynthGroupEnd, SpessaSynthInfo } from "../utils/loggin.js";
|
|
8
7
|
import { consoleColors } from "../utils/other.js";
|
|
9
8
|
import { writeLittleEndian } from "../utils/byte_functions/little_endian.js";
|
|
9
|
+
import { DEFAULT_PERCUSSION } from "../synthetizer/synth_constants.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @enum {string}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SpessaSynthGroupCollapsed, SpessaSynthGroupEnd, SpessaSynthInfo } from "../utils/loggin.js";
|
|
2
2
|
import { consoleColors } from "../utils/other.js";
|
|
3
|
-
import { DEFAULT_PERCUSSION } from "../synthetizer/synthetizer.js";
|
|
4
3
|
import { messageTypes, midiControllers } from "./midi_message.js";
|
|
4
|
+
import { DEFAULT_PERCUSSION } from "../synthetizer/synth_constants.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets the used programs and keys for this MIDI file with a given sound bank
|
package/package.json
CHANGED
|
@@ -4,7 +4,8 @@ import {
|
|
|
4
4
|
} from "../../synthetizer/worklet_system/message_protocol/worklet_message.js";
|
|
5
5
|
import { SongChangeType, WorkletSequencerMessageType, WorkletSequencerReturnMessageType } from "./sequencer_message.js";
|
|
6
6
|
import { messageTypes, midiControllers } from "../../midi_parser/midi_message.js";
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import { MIDI_CHANNEL_COUNT } from "../../synthetizer/synth_constants.js";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* @param messageType {WorkletSequencerMessageType}
|
|
@@ -14,7 +14,8 @@ import {
|
|
|
14
14
|
sendMIDIReset
|
|
15
15
|
} from "./events.js";
|
|
16
16
|
import { SpessaSynthWarn } from "../../utils/loggin.js";
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
import { MIDI_CHANNEL_COUNT } from "../../synthetizer/synth_constants.js";
|
|
18
19
|
|
|
19
20
|
class WorkletSequencer
|
|
20
21
|
{
|
|
@@ -2,13 +2,13 @@ import { DEFAULT_CHORUS_CONFIG } from "./fancy_chorus.js";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef {Object} SynthConfig
|
|
5
|
-
* @property {boolean} chorusEnabled - indicates if the chorus effect is enabled.
|
|
5
|
+
* @property {boolean?} chorusEnabled - indicates if the chorus effect is enabled.
|
|
6
6
|
* @property {ChorusConfig?} chorusConfig - the configuration for chorus. Pass undefined to use defaults
|
|
7
|
-
* @property {boolean} reverbEnabled - indicates if the reverb effect is enabled.
|
|
7
|
+
* @property {boolean?} reverbEnabled - indicates if the reverb effect is enabled.
|
|
8
8
|
* @property {AudioBuffer?} reverbImpulseResponse - the impulse response for the reverb. Pass undefined to use defaults
|
|
9
9
|
* @property {{
|
|
10
10
|
* worklet: function(context: object, name: string, options?: Object)
|
|
11
|
-
* }} audioNodeCreators - custom audio node creation functions for Web Audio wrappers.
|
|
11
|
+
* }?} audioNodeCreators - custom audio node creation functions for Web Audio wrappers.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @typedef {Object} ChorusConfig
|
|
16
|
-
* @property {number} nodesAmount - the amount of delay nodes (for each channel) and the corresponding oscillators
|
|
17
|
-
* @property {number} defaultDelay - the initial delay, in seconds
|
|
18
|
-
* @property {number} delayVariation - the difference between delays in the delay nodes
|
|
19
|
-
* @property {number} stereoDifference - the difference of delays between two channels (added to the left channel and subtracted from the right)
|
|
20
|
-
* @property {number} oscillatorFrequency - the initial delay time oscillator frequency, in Hz.
|
|
21
|
-
* @property {number} oscillatorFrequencyVariation - the difference between frequencies of oscillators, in Hz
|
|
22
|
-
* @property {number} oscillatorGain - how much will oscillator alter the delay in delay nodes, in seconds
|
|
16
|
+
* @property {number?} nodesAmount - the amount of delay nodes (for each channel) and the corresponding oscillators
|
|
17
|
+
* @property {number?} defaultDelay - the initial delay, in seconds
|
|
18
|
+
* @property {number?} delayVariation - the difference between delays in the delay nodes
|
|
19
|
+
* @property {number?} stereoDifference - the difference of delays between two channels (added to the left channel and subtracted from the right)
|
|
20
|
+
* @property {number?} oscillatorFrequency - the initial delay time oscillator frequency, in Hz.
|
|
21
|
+
* @property {number?} oscillatorFrequencyVariation - the difference between frequencies of oscillators, in Hz
|
|
22
|
+
* @property {number?} oscillatorGain - how much will oscillator alter the delay in delay nodes, in seconds
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
const NODES_AMOUNT = 4;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { reverbBufferBinary } from "./reverb_as_binary.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Creates a reverb processor
|
|
3
5
|
* @param context {BaseAudioContext}
|
|
@@ -13,12 +15,10 @@ export function getReverbProcessor(context, reverbBuffer = undefined)
|
|
|
13
15
|
}
|
|
14
16
|
else
|
|
15
17
|
{
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
fetch(impulseURL).then(async response =>
|
|
18
|
+
// decode
|
|
19
|
+
context.decodeAudioData(reverbBufferBinary.buffer).then(b =>
|
|
19
20
|
{
|
|
20
|
-
|
|
21
|
-
convolver.buffer = await context.decodeAudioData(data);
|
|
21
|
+
convolver.buffer = b;
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
return convolver;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { rb } from "./reverb_buffer.min.js";
|
|
2
|
+
|
|
3
|
+
const binaryString = atob(rb);
|
|
4
|
+
const binary = new Uint8Array(binaryString.length);
|
|
5
|
+
for (let i = 0; i < binaryString.length; i++)
|
|
6
|
+
{
|
|
7
|
+
binary[i] = binaryString.charCodeAt(i);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @type {ArrayBuffer}
|
|
13
|
+
*/
|
|
14
|
+
const reverbBufferBinary = binary.buffer;
|
|
15
|
+
export { reverbBufferBinary };
|