spessasynth_lib 3.21.7 → 3.21.9

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 CHANGED
@@ -6,7 +6,6 @@ import { BasicSoundFont } from "./soundfont/basic_soundfont/basic_soundfont.js";
6
6
  import { loadSoundFont } from "./soundfont/load_soundfont.js";
7
7
  import { trimSoundfont } from "./soundfont/basic_soundfont/write_sf2/soundfont_trimmer.js";
8
8
  import { modulatorSources } from "./soundfont/basic_soundfont/modulator.js";
9
- import { encodeVorbis } from "./utils/encode_vorbis.js";
10
9
  import { MIDI } from './midi_parser/midi_loader.js';
11
10
  import { MIDIBuilder } from "./midi_parser/midi_builder.js";
12
11
  import { IndexedByteArray } from './utils/indexed_array.js';
@@ -35,4 +34,4 @@ import { readBytesAsUintBigEndian } from './utils/byte_functions/big_endian.js';
35
34
  import { NON_CC_INDEX_OFFSET } from "./synthetizer/worklet_system/worklet_utilities/controller_tables.js";
36
35
  import { ALL_CHANNELS_OR_DIFFERENT_ACTION } from './synthetizer/worklet_system/message_protocol/worklet_message.js';
37
36
  import { WORKLET_URL_ABSOLUTE } from './synthetizer/worklet_url.js';
38
- export { Sequencer, Synthetizer, DEFAULT_PERCUSSION, VOICE_CAP, BasicSoundFont, loadSoundFont, trimSoundfont, modulatorSources, encodeVorbis, MIDI, MIDIBuilder, IndexedByteArray, writeMIDIFile, writeRMIDI, applySnapshotToMIDI, modifyMIDI, MIDIticksToSeconds, audioBufferToWav, SpessaSynthLogging, SpessaSynthGroup, SpessaSynthTable, SpessaSynthGroupEnd, SpessaSynthInfo, SpessaSynthWarn, SpessaSynthGroupCollapsed, midiControllers, messageTypes, MIDIDeviceHandler, WebMidiLinkHandler, arrayToHexString, consoleColors, formatTitle, formatTime, readBytesAsUintBigEndian, NON_CC_INDEX_OFFSET, ALL_CHANNELS_OR_DIFFERENT_ACTION, WORKLET_URL_ABSOLUTE };
37
+ export { Sequencer, Synthetizer, DEFAULT_PERCUSSION, VOICE_CAP, BasicSoundFont, loadSoundFont, trimSoundfont, modulatorSources, MIDI, MIDIBuilder, IndexedByteArray, writeMIDIFile, writeRMIDI, applySnapshotToMIDI, modifyMIDI, MIDIticksToSeconds, audioBufferToWav, SpessaSynthLogging, SpessaSynthGroup, SpessaSynthTable, SpessaSynthGroupEnd, SpessaSynthInfo, SpessaSynthWarn, SpessaSynthGroupCollapsed, midiControllers, messageTypes, MIDIDeviceHandler, WebMidiLinkHandler, arrayToHexString, consoleColors, formatTitle, formatTime, readBytesAsUintBigEndian, NON_CC_INDEX_OFFSET, ALL_CHANNELS_OR_DIFFERENT_ACTION, WORKLET_URL_ABSOLUTE };
@@ -62,6 +62,18 @@ export class Modulator {
62
62
  secSrcUsesCC: number;
63
63
  secSrcIndex: number;
64
64
  secSrcCurveType: number;
65
+ /**
66
+ * Indicates if the given modulator is chorus or reverb effects modulator.
67
+ * This is done to simulate BASSMIDI effects behavior:
68
+ * - defaults to 1000 transform amount rather than 200
69
+ * - values can be changed, but anything above 200 is 1000
70
+ * (except for values above 1000, they are copied directly)
71
+ * - all values below are multiplied by 5 (200 * 5 = 1000)
72
+ * - still can be disabled if the soundfont has its own modulator curve
73
+ * - this fixes the very low amount of reverb by default and doesn't break soundfonts
74
+ * @type {boolean}
75
+ */
76
+ isEffectModulator: boolean;
65
77
  /**
66
78
  * Sums transform and creates a NEW modulator
67
79
  * @param modulator {Modulator}
package/externals/NOTICE CHANGED
@@ -2,8 +2,4 @@ LICENSE is for stbvorbis_sync.js which is licensed under Apache-2.0
2
2
 
3
3
  Modifications made to stbvorbis_sync.js
4
4
  1. minified the code
5
- 2. added types declaration
6
-
7
- OggVorbisEncoder (https://github.com/higuma/ogg-vorbis-encoder-js)
8
- is licensed under MIT.
9
- The file provided is a slight modification to work with es6.
5
+ 2. added types declaration
package/index.js CHANGED
@@ -29,8 +29,7 @@ import { modulatorSources } from "./soundfont/basic_soundfont/modulator.js";
29
29
  import { NON_CC_INDEX_OFFSET } from "./synthetizer/worklet_system/worklet_utilities/controller_tables.js";
30
30
  import { ALL_CHANNELS_OR_DIFFERENT_ACTION } from './synthetizer/worklet_system/message_protocol/worklet_message.js';
31
31
  import { trimSoundfont} from "./soundfont/basic_soundfont/write_sf2/soundfont_trimmer.js";
32
- import { WORKLET_URL_ABSOLUTE } from './synthetizer/worklet_url.js'
33
- import { encodeVorbis} from "./utils/encode_vorbis.js";
32
+ import { WORKLET_URL_ABSOLUTE } from './synthetizer/worklet_url.js';
34
33
 
35
34
  // Export modules
36
35
  export {
@@ -45,7 +44,6 @@ export {
45
44
  loadSoundFont,
46
45
  trimSoundfont,
47
46
  modulatorSources,
48
- encodeVorbis,
49
47
 
50
48
  // MIDI
51
49
  MIDI,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spessasynth_lib",
3
- "version": "3.21.7",
3
+ "version": "3.21.9",
4
4
  "description": "MIDI and SoundFont2/DLS library with no compromises",
5
5
  "browser": "index.js",
6
6
  "types": "@types/index.d.ts",
File without changes
File without changes
@@ -67,7 +67,27 @@ export class Modulator
67
67
  this.secSrcIndex = this.secondarySourceEnum & 127;
68
68
  this.secSrcCurveType = this.secondarySourceEnum >> 10 & 3;
69
69
 
70
- //this.precomputeModulatorTransform();
70
+ /**
71
+ * Indicates if the given modulator is chorus or reverb effects modulator.
72
+ * This is done to simulate BASSMIDI effects behavior:
73
+ * - defaults to 1000 transform amount rather than 200
74
+ * - values can be changed, but anything above 200 is 1000
75
+ * (except for values above 1000, they are copied directly)
76
+ * - all values below are multiplied by 5 (200 * 5 = 1000)
77
+ * - still can be disabled if the soundfont has its own modulator curve
78
+ * - this fixes the very low amount of reverb by default and doesn't break soundfonts
79
+ * @type {boolean}
80
+ */
81
+ this.isEffectModulator =
82
+ (
83
+ this.sourceEnum === 0x00DB
84
+ || this.sourceEnum === 0x00DD
85
+ )
86
+ && this.secondarySourceEnum === 0x0
87
+ && (
88
+ this.modulatorDestination === generatorTypes.reverbEffectsSend
89
+ || this.modulatorDestination === generatorTypes.chorusEffectsSend
90
+ );
71
91
  }
72
92
 
73
93
  /**
@@ -225,10 +245,10 @@ export const defaultModulators = [
225
245
  }),
226
246
 
227
247
  // reverb effects to send
228
- new Modulator({ srcEnum: 0x00DB, dest: generatorTypes.reverbEffectsSend, amt: 750, secSrcEnum: 0x0, transform: 0 }),
248
+ new Modulator({ srcEnum: 0x00DB, dest: generatorTypes.reverbEffectsSend, amt: 200, secSrcEnum: 0x0, transform: 0 }),
229
249
 
230
250
  // chorus effects to send
231
- new Modulator({ srcEnum: 0x00DD, dest: generatorTypes.chorusEffectsSend, amt: 750, secSrcEnum: 0x0, transform: 0 }),
251
+ new Modulator({ srcEnum: 0x00DD, dest: generatorTypes.chorusEffectsSend, amt: 200, secSrcEnum: 0x0, transform: 0 }),
232
252
 
233
253
  // custom modulators heck yeah
234
254
  // poly pressure to vibrato