spessasynth_core 3.26.39 → 3.26.40
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/package.json +1 -1
- package/src/midi/midi_tools/rmidi_writer.js +11 -11
- package/src/soundfont/basic_soundfont/basic_instrument.js +1 -1
- package/src/soundfont/basic_soundfont/basic_preset.js +1 -1
- package/src/soundfont/basic_soundfont/write_dls/write_dls.js +2 -2
- package/src/soundfont/basic_soundfont/write_sf2/write.js +7 -7
- package/src/utils/buffer_to_wav.js +5 -5
package/package.json
CHANGED
|
@@ -35,16 +35,16 @@ const DEFAULT_COPYRIGHT = "Created using SpessaSynth";
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* @typedef {Object} RMIDMetadata
|
|
38
|
-
* @property {string
|
|
39
|
-
* @property {string
|
|
40
|
-
* @property {string
|
|
41
|
-
* @property {string
|
|
42
|
-
* @property {string
|
|
43
|
-
* @property {ArrayBuffer
|
|
44
|
-
* @property {string
|
|
45
|
-
* @property {string
|
|
46
|
-
* @property {string
|
|
47
|
-
* @property {string
|
|
38
|
+
* @property {string} name - the name of the file
|
|
39
|
+
* @property {string} engineer - the engineer who worked on the file
|
|
40
|
+
* @property {string} artist - the artist
|
|
41
|
+
* @property {string} album - the album
|
|
42
|
+
* @property {string} genre - the genre of the song
|
|
43
|
+
* @property {ArrayBuffer} picture - the image for the file (album cover)
|
|
44
|
+
* @property {string} comment - the coment of the file
|
|
45
|
+
* @property {string} creationDate - the creation date of the file
|
|
46
|
+
* @property {string} copyright - the copyright of the file
|
|
47
|
+
* @property {string} midiEncoding - the encoding of the inner MIDI file
|
|
48
48
|
*/
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -54,7 +54,7 @@ const DEFAULT_COPYRIGHT = "Created using SpessaSynth";
|
|
|
54
54
|
* @param soundfont {BasicSoundBank}
|
|
55
55
|
* @param bankOffset {number} the bank offset for RMIDI
|
|
56
56
|
* @param encoding {string} the encoding of the RMIDI info chunk
|
|
57
|
-
* @param metadata {RMIDMetadata} the metadata of the file. Optional. If provided, the encoding is forced to utf-8/
|
|
57
|
+
* @param metadata {Partial<RMIDMetadata>} the metadata of the file. Optional. If provided, the encoding is forced to utf-8/
|
|
58
58
|
* @param correctBankOffset {boolean}
|
|
59
59
|
* @returns {IndexedByteArray}
|
|
60
60
|
*/
|
|
@@ -85,6 +85,7 @@ export class BasicInstrument
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
// unlinks everything from this instrument
|
|
88
89
|
deleteInstrument()
|
|
89
90
|
{
|
|
90
91
|
if (this.useCount > 0)
|
|
@@ -92,7 +93,6 @@ export class BasicInstrument
|
|
|
92
93
|
throw new Error(`Cannot delete an instrument that is used by: ${this.linkedPresets.map(p => p.presetName)}.`);
|
|
93
94
|
}
|
|
94
95
|
this.instrumentZones.forEach(z => z.deleteZone());
|
|
95
|
-
this.instrumentZones.length = 0;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/**
|
|
@@ -10,7 +10,7 @@ import { fillWithDefaults } from "../../../utils/fill_with_defaults.js";
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @typedef {Object} DLSWriteOptions
|
|
13
|
-
* @property {ProgressFunction
|
|
13
|
+
* @property {ProgressFunction} progressFunction - a function to show progress for writing large banks. It can be undefined.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ const DEFAULT_DLS_OPTIONS = {
|
|
|
24
24
|
/**
|
|
25
25
|
* Write the soundfont as a .dls file. Experimental
|
|
26
26
|
* @this {BasicSoundBank}
|
|
27
|
-
* @param {DLSWriteOptions
|
|
27
|
+
* @param {Partial<DLSWriteOptions>} options - options for writing the file.
|
|
28
28
|
* @returns {Uint8Array}
|
|
29
29
|
*/
|
|
30
30
|
export async function writeDLS(options = DEFAULT_DLS_OPTIONS)
|
|
@@ -26,15 +26,15 @@ import { fillWithDefaults } from "../../../utils/fill_with_defaults.js";
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* @typedef {Object} SoundFont2WriteOptions
|
|
29
|
-
* @property {boolean
|
|
30
|
-
* @property {SampleEncodingFunction
|
|
29
|
+
* @property {boolean} compress - if the soundfont should be compressed with a given function.
|
|
30
|
+
* @property {SampleEncodingFunction} compressionFunction -
|
|
31
31
|
* the encode vorbis function. It can be undefined if not compressed.
|
|
32
|
-
* @property {ProgressFunction
|
|
33
|
-
* @property {boolean
|
|
32
|
+
* @property {ProgressFunction} progressFunction - a function to show progress for writing large banks. It can be undefined.
|
|
33
|
+
* @property {boolean} writeDefaultModulators - if the DMOD chunk should be written.
|
|
34
34
|
* Recommended.
|
|
35
|
-
* @property {boolean
|
|
35
|
+
* @property {boolean} writeExtendedLimits - if the xdta chunk should be written to allow virtually infinite parameters.
|
|
36
36
|
* Recommended.
|
|
37
|
-
* @property {boolean
|
|
37
|
+
* @property {boolean} decompress - if an sf3 bank should be decompressed back to sf2. Not recommended.
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
40
|
|
|
@@ -61,7 +61,7 @@ const DEFAULT_WRITE_OPTIONS = {
|
|
|
61
61
|
/**
|
|
62
62
|
* Write the soundfont as an .sf2 file
|
|
63
63
|
* @this {BasicSoundBank}
|
|
64
|
-
* @param {SoundFont2WriteOptions} options
|
|
64
|
+
* @param {Partial<SoundFont2WriteOptions>} options
|
|
65
65
|
* @returns {Uint8Array}
|
|
66
66
|
*/
|
|
67
67
|
export async function write(options = DEFAULT_WRITE_OPTIONS)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {Object} WaveMetadata
|
|
3
|
-
* @property {string
|
|
4
|
-
* @property {string
|
|
5
|
-
* @property {string
|
|
6
|
-
* @property {string
|
|
3
|
+
* @property {string} title - the song's title
|
|
4
|
+
* @property {string} artist - the song's artist
|
|
5
|
+
* @property {string} album - the song's album
|
|
6
|
+
* @property {string} genre - the song's genre
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { IndexedByteArray } from "./indexed_array.js";
|
|
@@ -16,7 +16,7 @@ import { writeLittleEndian } from "./byte_functions/little_endian.js";
|
|
|
16
16
|
* @param audioData {Float32Array[]} channels
|
|
17
17
|
* @param sampleRate {number}
|
|
18
18
|
* @param normalizeAudio {boolean} find the max sample point and set it to 1, and scale others with it
|
|
19
|
-
* @param metadata {WaveMetadata}
|
|
19
|
+
* @param metadata {Partial<WaveMetadata>}
|
|
20
20
|
* @param loop {{start: number, end: number}} loop start and end points in seconds. Undefined if no loop
|
|
21
21
|
* @returns {ArrayBuffer}
|
|
22
22
|
*/
|