spessasynth_lib 3.24.3 → 3.24.6

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 (99) hide show
  1. package/README.md +14 -4
  2. package/midi_parser/midi_loader.js +51 -28
  3. package/package.json +1 -2
  4. package/sequencer/sequencer.js +3 -3
  5. package/sequencer/worklet_sequencer/worklet_sequencer.js +6 -0
  6. package/synthetizer/synthetizer.js +8 -6
  7. package/synthetizer/worklet_processor.min.js +9 -9
  8. package/synthetizer/worklet_system/main_processor.js +9 -7
  9. package/synthetizer/worklet_system/worklet_methods/note_on.js +2 -1
  10. package/@types/external_midi/midi_handler.d.ts +0 -39
  11. package/@types/external_midi/web_midi_link.d.ts +0 -12
  12. package/@types/externals/stbvorbis_sync/stbvorbis_sync.min.d.ts +0 -1
  13. package/@types/index.d.ts +0 -44
  14. package/@types/midi_parser/basic_midi.d.ts +0 -36
  15. package/@types/midi_parser/midi_builder.d.ts +0 -68
  16. package/@types/midi_parser/midi_data.d.ts +0 -46
  17. package/@types/midi_parser/midi_editor.d.ts +0 -89
  18. package/@types/midi_parser/midi_loader.d.ts +0 -30
  19. package/@types/midi_parser/midi_message.d.ts +0 -155
  20. package/@types/midi_parser/midi_sequence.d.ts +0 -135
  21. package/@types/midi_parser/midi_writer.d.ts +0 -6
  22. package/@types/midi_parser/rmidi_writer.d.ts +0 -85
  23. package/@types/midi_parser/used_keys_loaded.d.ts +0 -10
  24. package/@types/sequencer/sequencer.d.ts +0 -277
  25. package/@types/sequencer/worklet_sequencer/sequencer_message.d.ts +0 -31
  26. package/@types/soundfont/basic_soundfont/basic_instrument.d.ts +0 -29
  27. package/@types/soundfont/basic_soundfont/basic_preset.d.ts +0 -86
  28. package/@types/soundfont/basic_soundfont/basic_sample.d.ts +0 -88
  29. package/@types/soundfont/basic_soundfont/basic_soundfont.d.ts +0 -102
  30. package/@types/soundfont/basic_soundfont/basic_zone.d.ts +0 -58
  31. package/@types/soundfont/basic_soundfont/basic_zones.d.ts +0 -22
  32. package/@types/soundfont/basic_soundfont/generator.d.ts +0 -102
  33. package/@types/soundfont/basic_soundfont/modulator.d.ts +0 -92
  34. package/@types/soundfont/basic_soundfont/riff_chunk.d.ts +0 -45
  35. package/@types/soundfont/basic_soundfont/write_dls/art2.d.ts +0 -6
  36. package/@types/soundfont/basic_soundfont/write_dls/articulator.d.ts +0 -28
  37. package/@types/soundfont/basic_soundfont/write_dls/combine_zones.d.ts +0 -8
  38. package/@types/soundfont/basic_soundfont/write_dls/ins.d.ts +0 -7
  39. package/@types/soundfont/basic_soundfont/write_dls/lins.d.ts +0 -5
  40. package/@types/soundfont/basic_soundfont/write_dls/modulator_converter.d.ts +0 -11
  41. package/@types/soundfont/basic_soundfont/write_dls/rgn2.d.ts +0 -8
  42. package/@types/soundfont/basic_soundfont/write_dls/wave.d.ts +0 -6
  43. package/@types/soundfont/basic_soundfont/write_dls/write_dls.d.ts +0 -6
  44. package/@types/soundfont/basic_soundfont/write_dls/wsmp.d.ts +0 -12
  45. package/@types/soundfont/basic_soundfont/write_dls/wvpl.d.ts +0 -8
  46. package/@types/soundfont/basic_soundfont/write_sf2/ibag.d.ts +0 -6
  47. package/@types/soundfont/basic_soundfont/write_sf2/igen.d.ts +0 -6
  48. package/@types/soundfont/basic_soundfont/write_sf2/imod.d.ts +0 -6
  49. package/@types/soundfont/basic_soundfont/write_sf2/inst.d.ts +0 -6
  50. package/@types/soundfont/basic_soundfont/write_sf2/pbag.d.ts +0 -6
  51. package/@types/soundfont/basic_soundfont/write_sf2/pgen.d.ts +0 -6
  52. package/@types/soundfont/basic_soundfont/write_sf2/phdr.d.ts +0 -6
  53. package/@types/soundfont/basic_soundfont/write_sf2/pmod.d.ts +0 -6
  54. package/@types/soundfont/basic_soundfont/write_sf2/sdta.d.ts +0 -11
  55. package/@types/soundfont/basic_soundfont/write_sf2/shdr.d.ts +0 -8
  56. package/@types/soundfont/basic_soundfont/write_sf2/soundfont_trimmer.d.ts +0 -6
  57. package/@types/soundfont/basic_soundfont/write_sf2/write.d.ts +0 -21
  58. package/@types/soundfont/dls/articulator_converter.d.ts +0 -19
  59. package/@types/soundfont/dls/dls_destinations.d.ts +0 -29
  60. package/@types/soundfont/dls/dls_preset.d.ts +0 -13
  61. package/@types/soundfont/dls/dls_sample.d.ts +0 -19
  62. package/@types/soundfont/dls/dls_soundfont.d.ts +0 -31
  63. package/@types/soundfont/dls/dls_sources.d.ts +0 -27
  64. package/@types/soundfont/dls/dls_zone.d.ts +0 -23
  65. package/@types/soundfont/dls/read_articulation.d.ts +0 -12
  66. package/@types/soundfont/dls/read_instrument.d.ts +0 -5
  67. package/@types/soundfont/dls/read_instrument_list.d.ts +0 -5
  68. package/@types/soundfont/dls/read_lart.d.ts +0 -7
  69. package/@types/soundfont/dls/read_region.d.ts +0 -7
  70. package/@types/soundfont/dls/read_samples.d.ts +0 -5
  71. package/@types/soundfont/load_soundfont.d.ts +0 -6
  72. package/@types/soundfont/read_sf2/generators.d.ts +0 -16
  73. package/@types/soundfont/read_sf2/instruments.d.ts +0 -29
  74. package/@types/soundfont/read_sf2/modulators.d.ts +0 -15
  75. package/@types/soundfont/read_sf2/presets.d.ts +0 -30
  76. package/@types/soundfont/read_sf2/samples.d.ts +0 -55
  77. package/@types/soundfont/read_sf2/soundfont.d.ts +0 -28
  78. package/@types/soundfont/read_sf2/zones.d.ts +0 -99
  79. package/@types/synthetizer/audio_effects/effects_config.d.ts +0 -41
  80. package/@types/synthetizer/audio_effects/fancy_chorus.d.ts +0 -97
  81. package/@types/synthetizer/audio_effects/reverb.d.ts +0 -7
  82. package/@types/synthetizer/key_modifier_manager.d.ts +0 -56
  83. package/@types/synthetizer/synth_event_handler.d.ts +0 -263
  84. package/@types/synthetizer/synth_soundfont_manager.d.ts +0 -52
  85. package/@types/synthetizer/synthetizer.d.ts +0 -358
  86. package/@types/synthetizer/worklet_system/message_protocol/worklet_message.d.ts +0 -98
  87. package/@types/synthetizer/worklet_system/worklet_methods/worklet_key_modifier.d.ts +0 -77
  88. package/@types/synthetizer/worklet_system/worklet_methods/worklet_soundfont_manager/sfman_message.d.ts +0 -7
  89. package/@types/synthetizer/worklet_system/worklet_utilities/controller_tables.d.ts +0 -23
  90. package/@types/synthetizer/worklet_system/worklet_utilities/worklet_processor_channel.d.ts +0 -155
  91. package/@types/synthetizer/worklet_url.d.ts +0 -5
  92. package/@types/utils/buffer_to_wav.d.ts +0 -31
  93. package/@types/utils/byte_functions/big_endian.d.ts +0 -13
  94. package/@types/utils/byte_functions/little_endian.d.ts +0 -35
  95. package/@types/utils/byte_functions/string.d.ts +0 -27
  96. package/@types/utils/byte_functions/variable_length_quantity.d.ts +0 -12
  97. package/@types/utils/indexed_array.d.ts +0 -21
  98. package/@types/utils/loggin.d.ts +0 -26
  99. package/@types/utils/other.d.ts +0 -37
@@ -1,6 +0,0 @@
1
- /**
2
- * @this {BasicSoundFont}
3
- * @returns {IndexedByteArray}
4
- */
5
- export function getPHDR(this: BasicSoundFont): IndexedByteArray;
6
- import { IndexedByteArray } from "../../../utils/indexed_array.js";
@@ -1,6 +0,0 @@
1
- /**
2
- * @this {BasicSoundFont}
3
- * @returns {IndexedByteArray}
4
- */
5
- export function getPMOD(this: BasicSoundFont): IndexedByteArray;
6
- import { IndexedByteArray } from "../../../utils/indexed_array.js";
@@ -1,11 +0,0 @@
1
- /**
2
- * @this {BasicSoundFont}
3
- * @param smplStartOffsets {number[]}
4
- * @param smplEndOffsets {number[]}
5
- * @param compress {boolean}
6
- * @param quality {number}
7
- * @param vorbisFunc {EncodeVorbisFunction}
8
- * @returns {IndexedByteArray}
9
- */
10
- export function getSDTA(this: BasicSoundFont, smplStartOffsets: number[], smplEndOffsets: number[], compress: boolean, quality: number, vorbisFunc: EncodeVorbisFunction): IndexedByteArray;
11
- import { IndexedByteArray } from "../../../utils/indexed_array.js";
@@ -1,8 +0,0 @@
1
- /**
2
- * @this {BasicSoundFont}
3
- * @param smplStartOffsets {number[]}
4
- * @param smplEndOffsets {number[]}
5
- * @returns {IndexedByteArray}
6
- */
7
- export function getSHDR(this: BasicSoundFont, smplStartOffsets: number[], smplEndOffsets: number[]): IndexedByteArray;
8
- import { IndexedByteArray } from "../../../utils/indexed_array.js";
@@ -1,6 +0,0 @@
1
- /**
2
- * @param soundfont {BasicSoundFont}
3
- * @param mid {BasicMIDI}
4
- * @returns {Uint8Array}
5
- */
6
- export function trimSoundfont(soundfont: BasicSoundFont, mid: BasicMIDI): Uint8Array;
@@ -1,21 +0,0 @@
1
- /**
2
- * Write the soundfont as an .sf2 file. This method is DESTRUCTIVE
3
- * @this {BasicSoundFont}
4
- * @param {SoundFont2WriteOptions} options
5
- * @returns {Uint8Array}
6
- */
7
- export function write(this: BasicSoundFont, options?: SoundFont2WriteOptions): Uint8Array;
8
- export type SoundFont2WriteOptions = {
9
- /**
10
- * - if the soundfont should be compressed with the ogg vorbis codec
11
- */
12
- compress: boolean;
13
- /**
14
- * - the vorbis compression quality, from -0.1 to 1
15
- */
16
- compressionQuality: number;
17
- /**
18
- * - the encode vorbis function. Can be undefined if not compressing.
19
- */
20
- compressionFunction: EncodeVorbisFunction | undefined;
21
- };
@@ -1,19 +0,0 @@
1
- /**
2
- * @param source {number}
3
- * @param control {number}
4
- * @param destination {number}
5
- * @param value {number}
6
- * @param transform {number}
7
- * @param msg {string}
8
- */
9
- export function modulatorConverterDebug(source: number, control: number, destination: number, value: number, transform: number, msg?: string): void;
10
- /**
11
- * @param source {number}
12
- * @param control {number}
13
- * @param destination {number}
14
- * @param transform {number}
15
- * @param value {number}
16
- * @returns {Modulator|undefined}
17
- */
18
- export function getSF2ModulatorFromArticulator(source: number, control: number, destination: number, transform: number, value: number): Modulator | undefined;
19
- import { Modulator } from "../basic_soundfont/modulator.js";
@@ -1,29 +0,0 @@
1
- export type DLSDestinations = number;
2
- export namespace DLSDestinations {
3
- let none: number;
4
- let gain: number;
5
- let reserved: number;
6
- let pitch: number;
7
- let pan: number;
8
- let keyNum: number;
9
- let chorusSend: number;
10
- let reverbSend: number;
11
- let modLfoFreq: number;
12
- let modLfoDelay: number;
13
- let vibLfoFreq: number;
14
- let vibLfoDelay: number;
15
- let volEnvAttack: number;
16
- let volEnvDecay: number;
17
- let volEnvRelease: number;
18
- let volEnvSustain: number;
19
- let volEnvDelay: number;
20
- let volEnvHold: number;
21
- let modEnvAttack: number;
22
- let modEnvDecay: number;
23
- let modEnvRelease: number;
24
- let modEnvSustain: number;
25
- let modEnvDelay: number;
26
- let modEnvHold: number;
27
- let filterCutoff: number;
28
- let filterQ: number;
29
- }
@@ -1,13 +0,0 @@
1
- export class DLSPreset extends BasicPreset {
2
- /**
3
- * Creates a new DLS preset
4
- * @param ulBank {number}
5
- * @param ulInstrument {number}
6
- */
7
- constructor(ulBank: number, ulInstrument: number);
8
- DLSInstrument: BasicInstrument;
9
- presetZones: BasicPresetZone[];
10
- }
11
- import { BasicPreset } from "../basic_soundfont/basic_preset.js";
12
- import { BasicInstrument } from "../basic_soundfont/basic_instrument.js";
13
- import { BasicPresetZone } from "../basic_soundfont/basic_zones.js";
@@ -1,19 +0,0 @@
1
- export class DLSSample extends BasicSample {
2
- /**
3
- * @param name {string}
4
- * @param rate {number}
5
- * @param pitch {number}
6
- * @param pitchCorrection {number}
7
- * @param loopStart {number} sample data points
8
- * @param loopEnd {number} sample data points
9
- * @param data {Float32Array}
10
- * @param sampleDbAttenuation {number} in db
11
- */
12
- constructor(name: string, rate: number, pitch: number, pitchCorrection: number, loopStart: number, loopEnd: number, data: Float32Array, sampleDbAttenuation: number);
13
- /**
14
- * in decibels of attenuation, WITHOUT EMU CORRECTION
15
- * @type {number}
16
- */
17
- sampleDbAttenuation: number;
18
- }
19
- import { BasicSample } from "../basic_soundfont/basic_sample.js";
@@ -1,31 +0,0 @@
1
- export class DLSSoundFont extends BasicSoundFont {
2
- /**
3
- * Loads a new DLS (Downloadable sounds) soundfont
4
- * @param buffer {ArrayBuffer}
5
- */
6
- constructor(buffer: ArrayBuffer);
7
- dataArray: IndexedByteArray;
8
- instrumentAmount: number;
9
- /**
10
- * @param chunk {RiffChunk}
11
- * @param expected {string}
12
- */
13
- verifyHeader(chunk: RiffChunk, expected: string): void;
14
- /**
15
- * @param text {string}
16
- * @param expected {string}
17
- */
18
- verifyText(text: string, expected: string): void;
19
- readDLSInstrumentList: typeof readDLSInstrumentList;
20
- readDLSInstrument: typeof readDLSInstrument;
21
- readRegion: typeof readRegion;
22
- readLart: typeof readLart;
23
- readDLSSamples: typeof readDLSSamples;
24
- }
25
- import { BasicSoundFont } from "../basic_soundfont/basic_soundfont.js";
26
- import { IndexedByteArray } from "../../utils/indexed_array.js";
27
- import { readDLSInstrumentList } from "./read_instrument_list.js";
28
- import { readDLSInstrument } from "./read_instrument.js";
29
- import { readRegion } from "./read_region.js";
30
- import { readLart } from "./read_lart.js";
31
- import { readDLSSamples } from "./read_samples.js";
@@ -1,27 +0,0 @@
1
- export type DLSSources = number;
2
- export namespace DLSSources {
3
- let none: number;
4
- let modLfo: number;
5
- let velocity: number;
6
- let keyNum: number;
7
- let volEnv: number;
8
- let modEnv: number;
9
- let pitchWheel: number;
10
- let polyPressure: number;
11
- let channelPressure: number;
12
- let vibratoLfo: number;
13
- let modulationWheel: number;
14
- let volume: number;
15
- let pan: number;
16
- let expression: number;
17
- let chorus: number;
18
- let reverb: number;
19
- let pitchWheelRange: number;
20
- let fineTune: number;
21
- let coarseTune: number;
22
- }
23
- export const DEFAULT_DLS_REVERB: Modulator;
24
- export const DEFAULT_DLS_CHORUS: Modulator;
25
- export const DLS_1_NO_VIBRATO_MOD: Modulator;
26
- export const DLS_1_NO_VIBRATO_PRESSURE: Modulator;
27
- import { Modulator } from "../basic_soundfont/modulator.js";
@@ -1,23 +0,0 @@
1
- export class DLSZone extends BasicInstrumentZone {
2
- /**
3
- * @param keyRange {SoundFontRange}
4
- * @param velRange {SoundFontRange}
5
- */
6
- constructor(keyRange: SoundFontRange, velRange: SoundFontRange);
7
- keyRange: SoundFontRange;
8
- velRange: SoundFontRange;
9
- /**
10
- * @param attenuationCb {number} with EMU correction
11
- * @param loopingMode {number} the sfont one
12
- * @param loop {{start: number, end: number}}
13
- * @param sampleKey {number}
14
- * @param sample {BasicSample}
15
- * @param sampleID {number}
16
- * @param samplePitchCorrection {number} cents
17
- */
18
- setWavesample(attenuationCb: number, loopingMode: number, loop: {
19
- start: number;
20
- end: number;
21
- }, sampleKey: number, sample: BasicSample, sampleID: number, samplePitchCorrection: number): void;
22
- }
23
- import { BasicInstrumentZone } from "../basic_soundfont/basic_zones.js";
@@ -1,12 +0,0 @@
1
- /**
2
- * Reads the articulator chunk
3
- * @param chunk {RiffChunk}
4
- * @param disableVibrato {boolean} it seems that dls 1 does not have vibrato lfo, so we shall disable it
5
- * @returns {{modulators: Modulator[], generators: Generator[]}}
6
- */
7
- export function readArticulation(chunk: RiffChunk, disableVibrato: boolean): {
8
- modulators: Modulator[];
9
- generators: Generator[];
10
- };
11
- import { Modulator } from "../basic_soundfont/modulator.js";
12
- import { Generator } from "../basic_soundfont/generator.js";
@@ -1,5 +0,0 @@
1
- /**
2
- * @this {DLSSoundFont}
3
- * @param chunk {RiffChunk}
4
- */
5
- export function readDLSInstrument(this: DLSSoundFont, chunk: RiffChunk): void;
@@ -1,5 +0,0 @@
1
- /**
2
- * @this {DLSSoundFont}
3
- * @param instrumentListChunk {RiffChunk}
4
- */
5
- export function readDLSInstrumentList(this: DLSSoundFont, instrumentListChunk: RiffChunk): void;
@@ -1,7 +0,0 @@
1
- /**
2
- * @param lartChunk {RiffChunk|undefined}
3
- * @param lar2Chunk {RiffChunk|undefined}
4
- * @param zone {BasicInstrumentZone}
5
- * @this {DLSSoundFont}
6
- */
7
- export function readLart(this: DLSSoundFont, lartChunk: RiffChunk | undefined, lar2Chunk: RiffChunk | undefined, zone: BasicInstrumentZone): void;
@@ -1,7 +0,0 @@
1
- /**
2
- * @this {DLSSoundFont}
3
- * @param chunk {RiffChunk}
4
- * @returns {DLSZone}
5
- */
6
- export function readRegion(this: DLSSoundFont, chunk: RiffChunk): DLSZone;
7
- import { DLSZone } from "./dls_zone.js";
@@ -1,5 +0,0 @@
1
- /**
2
- * @this {DLSSoundFont}
3
- * @param waveListChunk {RiffChunk}
4
- */
5
- export function readDLSSamples(this: DLSSoundFont, waveListChunk: RiffChunk): void;
@@ -1,6 +0,0 @@
1
- /**
2
- * Loads a soundfont file
3
- * @param buffer {ArrayBuffer}
4
- * @returns {BasicSoundFont}
5
- */
6
- export function loadSoundFont(buffer: ArrayBuffer): BasicSoundFont;
@@ -1,16 +0,0 @@
1
- /**
2
- * Reads the generator read
3
- * @param generatorChunk {RiffChunk}
4
- * @returns {Generator[]}
5
- */
6
- export function readGenerators(generatorChunk: RiffChunk): Generator[];
7
- export class ReadGenerator extends Generator {
8
- /**
9
- * Creates a generator
10
- * @param dataArray {IndexedByteArray}
11
- */
12
- constructor(dataArray: IndexedByteArray);
13
- }
14
- import { RiffChunk } from "../basic_soundfont/riff_chunk.js";
15
- import { Generator } from "../basic_soundfont/generator.js";
16
- import { IndexedByteArray } from "../../utils/indexed_array.js";
@@ -1,29 +0,0 @@
1
- /**
2
- * Reads the instruments
3
- * @param instrumentChunk {RiffChunk}
4
- * @param instrumentZones {InstrumentZone[]}
5
- * @returns {Instrument[]}
6
- */
7
- export function readInstruments(instrumentChunk: RiffChunk, instrumentZones: InstrumentZone[]): Instrument[];
8
- /**
9
- * instrument.js
10
- * purpose: parses soundfont instrument and stores them as a class
11
- */
12
- export class Instrument extends BasicInstrument {
13
- /**
14
- * Creates an instrument
15
- * @param instrumentChunk {RiffChunk}
16
- */
17
- constructor(instrumentChunk: RiffChunk);
18
- instrumentZoneIndex: number;
19
- instrumentZonesAmount: number;
20
- /**
21
- * Loads all the instrument zones, given the amount
22
- * @param amount {number}
23
- * @param zones {InstrumentZone[]}
24
- */
25
- getInstrumentZones(amount: number, zones: InstrumentZone[]): void;
26
- }
27
- import { RiffChunk } from "../basic_soundfont/riff_chunk.js";
28
- import { InstrumentZone } from "./zones.js";
29
- import { BasicInstrument } from "../basic_soundfont/basic_instrument.js";
@@ -1,15 +0,0 @@
1
- /**
2
- * Reads the modulator read
3
- * @param modulatorChunk {RiffChunk}
4
- * @returns {Modulator[]}
5
- */
6
- export function readModulators(modulatorChunk: RiffChunk): Modulator[];
7
- export class ReadModulator extends Modulator {
8
- /**
9
- * Creates a modulator
10
- * @param dataArray {IndexedByteArray}
11
- */
12
- constructor(dataArray: IndexedByteArray);
13
- }
14
- import { Modulator } from "../basic_soundfont/modulator.js";
15
- import { IndexedByteArray } from "../../utils/indexed_array.js";
@@ -1,30 +0,0 @@
1
- /**
2
- * Reads the presets
3
- * @param presetChunk {RiffChunk}
4
- * @param presetZones {PresetZone[]}
5
- * @param defaultModulators {Modulator[]}
6
- * @returns {Preset[]}
7
- */
8
- export function readPresets(presetChunk: RiffChunk, presetZones: PresetZone[], defaultModulators: Modulator[]): Preset[];
9
- /**
10
- * parses soundfont presets, also includes function for getting the generators and samples from midi note and velocity
11
- */
12
- export class Preset extends BasicPreset {
13
- /**
14
- * Creates a preset
15
- * @param presetChunk {RiffChunk}
16
- * @param defaultModulators {Modulator[]}
17
- */
18
- constructor(presetChunk: RiffChunk, defaultModulators: Modulator[]);
19
- presetZoneStartIndex: number;
20
- presetZonesAmount: number;
21
- /**
22
- * Loads all the preset zones, given the amount
23
- * @param amount {number}
24
- * @param zones {PresetZone[]}
25
- */
26
- getPresetZones(amount: number, zones: PresetZone[]): void;
27
- }
28
- import { RiffChunk } from "../basic_soundfont/riff_chunk.js";
29
- import { PresetZone } from "./zones.js";
30
- import { BasicPreset } from "../basic_soundfont/basic_preset.js";
@@ -1,55 +0,0 @@
1
- /**
2
- * Reads the generatorTranslator from the shdr read
3
- * @param sampleHeadersChunk {RiffChunk}
4
- * @param smplChunkData {IndexedByteArray|Float32Array}
5
- * @param isSmplDataRaw {boolean}
6
- * @returns {LoadedSample[]}
7
- */
8
- export function readSamples(sampleHeadersChunk: RiffChunk, smplChunkData: IndexedByteArray | Float32Array, isSmplDataRaw?: boolean): LoadedSample[];
9
- export class LoadedSample extends BasicSample {
10
- /**
11
- * Creates a sample
12
- * @param sampleName {string}
13
- * @param sampleStartIndex {number}
14
- * @param sampleEndIndex {number}
15
- * @param sampleLoopStartIndex {number}
16
- * @param sampleLoopEndIndex {number}
17
- * @param sampleRate {number}
18
- * @param samplePitch {number}
19
- * @param samplePitchCorrection {number}
20
- * @param sampleLink {number}
21
- * @param sampleType {number}
22
- * @param smplArr {IndexedByteArray|Float32Array}
23
- * @param sampleIndex {number} initial sample index when loading the sfont
24
- * @param isDataRaw {boolean} if false, the data is decoded as float32.
25
- * Used for SF2Pack support
26
- */
27
- constructor(sampleName: string, sampleStartIndex: number, sampleEndIndex: number, sampleLoopStartIndex: number, sampleLoopEndIndex: number, sampleRate: number, samplePitch: number, samplePitchCorrection: number, sampleLink: number, sampleType: number, smplArr: IndexedByteArray | Float32Array, sampleIndex: number, isDataRaw: boolean);
28
- sampleStartIndex: number;
29
- sampleEndIndex: number;
30
- isSampleLoaded: boolean;
31
- sampleID: number;
32
- sampleLength: number;
33
- sampleDataArray: Float32Array<ArrayBuffer> | IndexedByteArray;
34
- isDataRaw: boolean;
35
- /**
36
- * Get raw data, whether it's compressed or not as we simply write it to the file
37
- * @return {Uint8Array} either s16 or vorbis data
38
- */
39
- getRawData(): Uint8Array;
40
- /**
41
- * Decode binary vorbis into a float32 pcm
42
- */
43
- decodeVorbis(): void;
44
- /**
45
- * @returns {Float32Array}
46
- */
47
- loadUncompressedData(): Float32Array;
48
- /**
49
- * @returns {Float32Array}
50
- */
51
- getUncompressedReadyData(): Float32Array;
52
- }
53
- import { RiffChunk } from "../basic_soundfont/riff_chunk.js";
54
- import { IndexedByteArray } from "../../utils/indexed_array.js";
55
- import { BasicSample } from "../basic_soundfont/basic_sample.js";
@@ -1,28 +0,0 @@
1
- /**
2
- * soundfont.js
3
- * purpose: parses a soundfont2 file
4
- */
5
- export class SoundFont2 extends BasicSoundFont {
6
- /**
7
- * Initializes a new SoundFont2 Parser and parses the given data array
8
- * @param arrayBuffer {ArrayBuffer}
9
- * @param warnDeprecated {boolean}
10
- */
11
- constructor(arrayBuffer: ArrayBuffer, warnDeprecated?: boolean);
12
- dataArray: IndexedByteArray;
13
- sampleDataStartIndex: number;
14
- instruments: import("./instruments.js").Instrument[];
15
- /**
16
- * @param chunk {RiffChunk}
17
- * @param expected {string}
18
- */
19
- verifyHeader(chunk: RiffChunk, expected: string): void;
20
- /**
21
- * @param text {string}
22
- * @param expected {string}
23
- */
24
- verifyText(text: string, expected: string): void;
25
- }
26
- import { BasicSoundFont } from "../basic_soundfont/basic_soundfont.js";
27
- import { IndexedByteArray } from "../../utils/indexed_array.js";
28
- import { RiffChunk } from "../basic_soundfont/riff_chunk.js";
@@ -1,99 +0,0 @@
1
- /**
2
- * Reads the given instrument zone read
3
- * @param zonesChunk {RiffChunk}
4
- * @param instrumentGenerators {Generator[]}
5
- * @param instrumentModulators {Modulator[]}
6
- * @param instrumentSamples {BasicSample[]}
7
- * @returns {InstrumentZone[]}
8
- */
9
- export function readInstrumentZones(zonesChunk: RiffChunk, instrumentGenerators: Generator[], instrumentModulators: Modulator[], instrumentSamples: BasicSample[]): InstrumentZone[];
10
- /**
11
- * Reads the given preset zone read
12
- * @param zonesChunk {RiffChunk}
13
- * @param presetGenerators {Generator[]}
14
- * @param instruments {Instrument[]}
15
- * @param presetModulators {Modulator[]}
16
- * @returns {PresetZone[]}
17
- */
18
- export function readPresetZones(zonesChunk: RiffChunk, presetGenerators: Generator[], presetModulators: Modulator[], instruments: Instrument[]): PresetZone[];
19
- /**
20
- * zones.js
21
- * purpose: reads instrumend and preset zones from soundfont and gets their respective samples and generators and modulators
22
- */
23
- export class InstrumentZone extends BasicInstrumentZone {
24
- /**
25
- * Creates a zone (instrument)
26
- * @param dataArray {IndexedByteArray}
27
- */
28
- constructor(dataArray: IndexedByteArray);
29
- generatorZoneStartIndex: number;
30
- modulatorZoneStartIndex: number;
31
- modulatorZoneSize: number;
32
- generatorZoneSize: number;
33
- setZoneSize(modulatorZoneSize: any, generatorZoneSize: any): void;
34
- /**
35
- * grab the generators
36
- * @param generators {Generator[]}
37
- */
38
- getGenerators(generators: Generator[]): void;
39
- /**
40
- * grab the modulators
41
- * @param modulators {Modulator[]}
42
- */
43
- getModulators(modulators: Modulator[]): void;
44
- /**
45
- * Loads the zone's sample
46
- * @param samples {BasicSample[]}
47
- */
48
- getSample(samples: BasicSample[]): void;
49
- /**
50
- * Reads the keyRange of the zone
51
- */
52
- getKeyRange(): void;
53
- /**
54
- * reads the velolicty range of the zone
55
- */
56
- getVelRange(): void;
57
- }
58
- export class PresetZone extends BasicPresetZone {
59
- /**
60
- * Creates a zone (preset)
61
- * @param dataArray {IndexedByteArray}
62
- */
63
- constructor(dataArray: IndexedByteArray);
64
- generatorZoneStartIndex: number;
65
- modulatorZoneStartIndex: number;
66
- modulatorZoneSize: number;
67
- generatorZoneSize: number;
68
- setZoneSize(modulatorZoneSize: any, generatorZoneSize: any): void;
69
- /**
70
- * grab the generators
71
- * @param generators {Generator[]}
72
- */
73
- getGenerators(generators: Generator[]): void;
74
- /**
75
- * grab the modulators
76
- * @param modulators {Modulator[]}
77
- */
78
- getModulators(modulators: Modulator[]): void;
79
- /**
80
- * grab the instrument
81
- * @param instruments {Instrument[]}
82
- */
83
- getInstrument(instruments: Instrument[]): void;
84
- /**
85
- * Reads the keyRange of the zone
86
- */
87
- getKeyRange(): void;
88
- /**
89
- * reads the velolicty range of the zone
90
- */
91
- getVelRange(): void;
92
- }
93
- import { RiffChunk } from "../basic_soundfont/riff_chunk.js";
94
- import { Generator } from "../basic_soundfont/generator.js";
95
- import { Modulator } from "../basic_soundfont/modulator.js";
96
- import { Instrument } from "./instruments.js";
97
- import { BasicInstrumentZone } from "../basic_soundfont/basic_zones.js";
98
- import { IndexedByteArray } from "../../utils/indexed_array.js";
99
- import { BasicPresetZone } from "../basic_soundfont/basic_zones.js";
@@ -1,41 +0,0 @@
1
- /**
2
- * @typedef {Object} SynthConfig
3
- * @property {boolean} chorusEnabled - indicates if the chorus effect is enabled.
4
- * @property {ChorusConfig?} chorusConfig - the configuration for chorus. Pass undefined to use defaults
5
- * @property {boolean} reverbEnabled - indicates if the reverb effect is enabled.
6
- * @property {AudioBuffer?} reverbImpulseResponse - the impulse response for the reverb. Pass undefined to use defaults
7
- * @property {{
8
- * worklet: function(context: object, name: string, options?: Object)
9
- * }} audioNodeCreators - custom audio node creation functions for Web Audio wrappers.
10
- */
11
- /**
12
- * @type {SynthConfig}
13
- */
14
- export const DEFAULT_SYNTH_CONFIG: SynthConfig;
15
- export type SynthConfig = {
16
- /**
17
- * - indicates if the chorus effect is enabled.
18
- */
19
- chorusEnabled: boolean;
20
- /**
21
- * - the configuration for chorus. Pass undefined to use defaults
22
- */
23
- chorusConfig: ChorusConfig | null;
24
- /**
25
- * - indicates if the reverb effect is enabled.
26
- */
27
- reverbEnabled: boolean;
28
- /**
29
- * - the impulse response for the reverb. Pass undefined to use defaults
30
- */
31
- reverbImpulseResponse: AudioBuffer | null;
32
- /**
33
- * )
34
- * }} audioNodeCreators - custom audio node creation functions for Web Audio wrappers.
35
- */
36
- "": {
37
- worklet: (arg0: context) => object;
38
- name: string;
39
- options?: any;
40
- };
41
- };