spessasynth_core 1.0.3 → 1.0.5
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/README.md +18 -10
- package/index.js +2 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A fork of [SpessaSynth](https://github.com/spessasus/SpessaSynth).
|
|
|
4
4
|
|
|
5
5
|
`npm install --save spessasynth_core`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
> Looking for a browser version? Try [SpessaSynth](https://github.com/spessasus/SpessaSynth).
|
|
9
9
|
|
|
10
10
|
## Features:
|
|
@@ -59,6 +59,7 @@ import("spessasynth_core").then(core => {
|
|
|
59
59
|
- [Sequencer](#sequencer)
|
|
60
60
|
- [MIDI](#midi)
|
|
61
61
|
- [SoundFont2](#soundfont2)
|
|
62
|
+
- [How to disable console output](#logging)
|
|
62
63
|
|
|
63
64
|
### Importing the library
|
|
64
65
|
spessasynth_core is an es6 package.
|
|
@@ -95,8 +96,8 @@ synth.render(outputChannels, reverbOutputChannels, chorusOutputChannels);
|
|
|
95
96
|
- outputChannels - two `Float32Arrays` that get filled with the audio data. Left is the left channel and right is the right channel. Can be any length. (except zero)
|
|
96
97
|
- reverbOutputChannels - two `Float32Arrays` that get filled with the unprocessed audio data for reverb processing. Left is the left channel and right is the right channel. Can be undefined.
|
|
97
98
|
- reverbOutputChannels - two `Float32Arrays` that get filled with the unprocessed audio data for chorus processing. Left is the left channel and right is the right channel. Can be undefined.
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
|
|
100
|
+
**All arrays must be the same length.**
|
|
100
101
|
|
|
101
102
|
### noteOn
|
|
102
103
|
|
|
@@ -121,7 +122,6 @@ synth.noteOff(channel, midiNote);
|
|
|
121
122
|
|
|
122
123
|
- channel - the MIDI channel to use. Usually ranges from 0 to 15, but it depends on the channel count.
|
|
123
124
|
- midiNote - the note to play. Ranges from 0 to 127.
|
|
124
|
-
> [!TIP]
|
|
125
125
|
> To stop a note instantly, use `synth.killNote` (takes the same arguments)
|
|
126
126
|
|
|
127
127
|
### stopAllChannels
|
|
@@ -132,7 +132,6 @@ Stops all notes. Equivalent of MIDI "panic".
|
|
|
132
132
|
synth.stopAllChannels(force);
|
|
133
133
|
```
|
|
134
134
|
- force - `boolean`, if true, ignores the release time and stops everything instantly. Defaults to false.
|
|
135
|
-
> [!TIP]
|
|
136
135
|
> To stop all notes on a specific channel, use `synth.stopAll(channel, force)`. channel is the channel number.
|
|
137
136
|
|
|
138
137
|
### programChange
|
|
@@ -145,7 +144,6 @@ synth.programChange(channel, programNumber);
|
|
|
145
144
|
|
|
146
145
|
- channel - the MIDI channel to change. Usually ranges from 0 to 15, but it depends on the channel count.
|
|
147
146
|
- programNumber - the MIDI program number to use. Ranges from 0 to 127. To use other banks, go to [controllerChange](#controllerchange).
|
|
148
|
-
> [!TIP]
|
|
149
147
|
> To lock the preset (prevent MIDI file from changing it) use `synth.workletProcessorChannels[channel].lockPreset = true;`
|
|
150
148
|
|
|
151
149
|
### pitchWheel
|
|
@@ -158,7 +156,6 @@ synth.pitchWheel(channel, MSB, LSB);
|
|
|
158
156
|
|
|
159
157
|
- channel - the MIDI channel to use. Usually ranges from 0 to 15, but it depends on the channel count.
|
|
160
158
|
- MSB and LSB. 7-bit numbers that form a 14-bit pitch bend value.
|
|
161
|
-
> [!TIP]
|
|
162
159
|
> [I highly recommend this article for more info.](https://www.recordingblogs.com/wiki/midi-pitch-wheel-message)
|
|
163
160
|
|
|
164
161
|
### systemExclusive
|
|
@@ -170,7 +167,6 @@ synth.systemExclusive(messageData);
|
|
|
170
167
|
```
|
|
171
168
|
|
|
172
169
|
- message data - Uint8Array, the message byte data **Excluding the 0xF0 byte!**
|
|
173
|
-
> [!TIP]
|
|
174
170
|
> Refer to [this table](https://github.com/spessasus/SpessaSynth/wiki/Synthetizer-Class#supported-system-exclusives) for the list of supported System Exclusives.
|
|
175
171
|
|
|
176
172
|
### setMainVolume
|
|
@@ -231,7 +227,6 @@ synth.controllerChange(channel, controllerNumber, controllerValue);
|
|
|
231
227
|
- channel - the MIDI channel to use. Usually ranges from 0 to 15, but it depends on the channel count.
|
|
232
228
|
- controllerName - the MIDI CC number. Refer to [this table](https://github.com/spessasus/SpessaSynth/wiki/Synthetizer-Class#default-supported-controllers) for the list of controllers supported by default.
|
|
233
229
|
- controllerValue - the value to set the given controller to. Ranges from 0 to 127.
|
|
234
|
-
> [!NOTE]
|
|
235
230
|
> Note that theoreticallly all controllers are supported as it depends on the SoundFont's modulators.
|
|
236
231
|
|
|
237
232
|
### resetAllControllers
|
|
@@ -379,4 +374,17 @@ console.log(`The track lasts for ${sequencer.duration} seconds!`);
|
|
|
379
374
|
See [MIDI on SpessaSynth wiki](https://github.com/spessasus/SpessaSynth/wiki/MIDI-Class)
|
|
380
375
|
|
|
381
376
|
## SoundFont2
|
|
382
|
-
See [SoundFont2 on SpessaSynth wiki](https://github.com/spessasus/SpessaSynth/wiki/SoundFont2-Class)
|
|
377
|
+
See [SoundFont2 on SpessaSynth wiki](https://github.com/spessasus/SpessaSynth/wiki/SoundFont2-Class)
|
|
378
|
+
|
|
379
|
+
## Logging
|
|
380
|
+
By default, SpessaSynth prints out a lot of stuff to console.
|
|
381
|
+
Here's how you can disable it:
|
|
382
|
+
```js
|
|
383
|
+
// import (or require) here
|
|
384
|
+
SpessaSynthLogging(enableInfo, enableWarning, enableGroup, enableTable);
|
|
385
|
+
```
|
|
386
|
+
All the input variables are booleans corresponding to the things SpessaSynth logs.
|
|
387
|
+
- Info - all general info such as parsing soundfonts, midi files, RPN changes, etc.
|
|
388
|
+
- Warnings - all messages unrecognized by the synthesizer, other warnings
|
|
389
|
+
- group - the groups for parsing the soundfont and midi files.
|
|
390
|
+
- table - the debug table `when enableDebugging` is set to `true` for `synth.noteOn`
|
package/index.js
CHANGED
|
@@ -3,5 +3,6 @@ import {Sequencer} from "./spessasynth_core/sequencer/sequencer.js";
|
|
|
3
3
|
import {MIDI} from "./spessasynth_core/midi_parser/midi_loader.js";
|
|
4
4
|
import {rawDataToWav} from "./spessasynth_core/utils/buffer_to_wav.js";
|
|
5
5
|
import {SoundFont2} from "./spessasynth_core/soundfont/soundfont_parser.js";
|
|
6
|
+
import {SpessaSynthLogging} from "./spessasynth_core/utils/loggin.js";
|
|
6
7
|
|
|
7
|
-
export { Synthesizer, Sequencer, MIDI, SoundFont2, rawDataToWav };
|
|
8
|
+
export { Synthesizer, Sequencer, MIDI, SoundFont2, rawDataToWav, SpessaSynthLogging };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spessasynth_core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "SoundFont2 synthesizer library for node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/spessasus/spessasynth_core.git"
|
|
12
|
+
"url": "git+https://github.com/spessasus/spessasynth_core.git"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"sf2",
|