spessasynth_lib 3.13.1 → 3.14.0

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.
@@ -25,6 +25,11 @@ export class Sequencer {
25
25
  */
26
26
  _playbackRate: number;
27
27
  songIndex: number;
28
+ /**
29
+ * Indicates if the current midiData property has dummy data in it (not yet loaded)
30
+ * @type {boolean}
31
+ */
32
+ hasDummyData: boolean;
28
33
  _loop: boolean;
29
34
  /**
30
35
  * Indicates whether the sequencer has finished playing a sequence
@@ -5,6 +5,7 @@
5
5
  * @property {Float32Array} customControllers - array of custom (not sf2) control values such as RPN pitch tuning, transpose, modulation depth, etc.
6
6
  *
7
7
  * @property {number} channelTransposeKeyShift - key shift of the channel
8
+ * @property {Int8Array} channelOctaveTuning - the tuning for octave on this channel
8
9
  * @property {boolean} holdPedal - indicates whether the hold pedal is active
9
10
  * @property {boolean} drumChannel - indicates whether the channel is a drum channel
10
11
  *
@@ -72,6 +73,10 @@ export type WorkletProcessorChannel = {
72
73
  * - key shift of the channel
73
74
  */
74
75
  channelTransposeKeyShift: number;
76
+ /**
77
+ * - the tuning for octave on this channel
78
+ */
79
+ channelOctaveTuning: Int8Array;
75
80
  /**
76
81
  * - indicates whether the hold pedal is active
77
82
  */
package/README.md CHANGED
@@ -26,6 +26,7 @@ document.getElementById("button").onclick = async () => {
26
26
  ```
27
27
 
28
28
  ## Current Features
29
+
29
30
  ### Easy Integration
30
31
  - **Modular design:** Easy integration into other projects (load what you need)
31
32
  - **[Detailed documentation:](https://github.com/spessasus/SpessaSynth/wiki/Home)** With [examples!](https://github.com/spessasus/SpessaSynth/wiki/Usage-As-Library#examples)
@@ -35,32 +36,38 @@ document.getElementById("button").onclick = async () => {
35
36
  ### Powerful SoundFont Synthesizer
36
37
  - Suitable for both **real-time** and **offline** synthesis
37
38
  - **Excellent SoundFont support:**
38
- - - **Generator Support**
39
- - - **Modulator Support:** _First (to my knowledge) JavaScript SoundFont synth with that feature!_
40
- - - **SoundFont3 Support:** Play compressed SoundFonts!
41
- - - **Can load very large SoundFonts:** up to 4GB! _Note: Only Firefox handles this well; Chromium has a hard-coded memory limit_
39
+ - **Generator Support**
40
+ - **Modulator Support:** _First (to my knowledge) JavaScript SoundFont synth with that feature!_
41
+ - **SoundFont3 Support:** Play compressed SoundFonts!
42
+ - **Can load very large SoundFonts:** up to 4GB! _Note: Only Firefox handles this well; Chromium has a hard-coded memory limit_
42
43
  - **Reverb and chorus support:** [customizable!](https://github.com/spessasus/SpessaSynth/wiki/Synthetizer-Class#effects-configuration-object)
43
44
  - **Export audio files** using [OfflineAudioContext](https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext)
44
45
  - **[Custom modulators for additional controllers](https://github.com/spessasus/SpessaSynth/wiki/Modulator-Class#default-modulators):** Why not?
45
- - **Written using AudioWorklets:** runs in a separate thread for maximum performance, works perfectly in Firefox and Chrome!
46
+ - **Written using AudioWorklets:**
47
+ - Runs in a **separate thread** for maximum performance
48
+ - Supported by all modern browsers
46
49
  - **Unlimited channel count:** Your CPU is the limit!
47
50
  - **Various MIDI Standards Support:**
48
- - - **MIDI Controller Support:** Default supported controllers [here](https://github.com/spessasus/SpessaSynth/wiki/MIDI-Implementation#supported-controllers)
49
- - - [Full **RPN** and limited **NRPN** support](https://github.com/spessasus/SpessaSynth/wiki/MIDI-Implementation#supported-registered-parameters)
50
- - - Supports some [**Roland GS** and **Yamaha XG** system exclusives](https://github.com/spessasus/SpessaSynth/wiki/MIDI-Implementation#supported-system-exclusives)
51
+ - **MIDI Controller Support:** Default supported controllers [here](https://github.com/spessasus/SpessaSynth/wiki/MIDI-Implementation#supported-controllers)
52
+ - **MIDI Tuning Standard Support:** [more info here](https://github.com/spessasus/SpessaSynth/wiki/MIDI-Implementation#midi-tuning-standard)
53
+ - [Full **RPN** and limited **NRPN** support](https://github.com/spessasus/SpessaSynth/wiki/MIDI-Implementation#supported-registered-parameters)
54
+ - Supports some [**Roland GS** and **Yamaha XG** system exclusives](https://github.com/spessasus/SpessaSynth/wiki/MIDI-Implementation#supported-system-exclusives)
55
+
51
56
  - **High-performance mode:** Play Rush E! _note: may kill your browser ;)_
52
- - **Written in pure JavaScript using the WebAudio API:** Supported by all modern browsers!
53
57
 
54
58
  ### Built-in Powerful and Fast Sequencer
55
59
  - **Supports MIDI formats 0, 1, and 2:** _note: format 2 support is experimental as it's very, very rare_
56
60
  - **[Multi-Port MIDI](https://github.com/spessasus/SpessaSynth/wiki/About-Multi-Port) support:** More than 16 channels!
57
61
  - **Smart preloading:** Only preloads the samples used in the MIDI file for smooth playback (down to key and velocity!)
58
62
  - **Lyrics support:** Add karaoke to your program!
59
- - **Raw lyrics available:** Decode in any encoding! (Kanji? No problem!)
63
+ - **Raw lyrics available:** Decode in any encoding! *(Kanji? No problem!)*
64
+ - **Runs in Audio Thread as well:** Never blocks the main thread
65
+ - **Loop points support:** Ensures seamless loops
60
66
 
61
67
  ### Read and Write SoundFont and MIDI Files with Ease
62
68
  #### Read and write MIDI files
63
69
  - **Smart name detection:** Handles incorrectly formatted and non-standard track names
70
+ - **Raw name available:** Decode in any encoding! *(Kanji? No problem!)*
64
71
  - **Port detection during load time:** Manage ports and channels easily!
65
72
  - **Used channels on track:** Quickly determine which channels are used
66
73
  - **Key range detection:** Detect the key range of the MIDI
@@ -70,15 +77,18 @@ document.getElementById("button").onclick = async () => {
70
77
  - **Easy saving:** Save with just [one function!](https://github.com/spessasus/SpessaSynth/wiki/Writing-MIDI-Files#writemidifile)
71
78
  #### Read and write [RMID files with embedded SF2 soundfonts](https://github.com/spessasus/SpessaSynth/wiki/About-RMIDI)
72
79
  - **Compression and trimming support:** Reduce a MIDI file with a 1GB soundfont to **as small as 5MB**!
80
+ - **Automatic bank shifting and validation:** Every soundfont *just works!*
81
+ - **Metadata support:** Add title, artist, album name and cover and more! And of course read them too! *(In any encoding!)*
82
+ - **Compatible with [Falcosoft Midi Player 6!](https://falcosoft.hu/softwares.html#midiplayer)**
73
83
  - **Easy saving:** [As simple as saving a MIDI file!](https://github.com/spessasus/SpessaSynth/wiki/Writing-MIDI-Files#writermidi)
74
84
  #### Read and write SoundFont2 files
75
- - **Smart trimming:** Trim the SoundFont to only include samples used in the MIDI (down to key and velocity!)
76
- - **sf3 conversion:** Compress SoundFont2 files to SoundFont3!
85
+ - **Easy info access:** Just an [object of strings!](https://github.com/spessasus/SpessaSynth/wiki/SoundFont2-Class#soundfontinfo)
86
+ - **Smart trimming:** Trim the SoundFont to only include samples used in the MIDI *(down to key and velocity!)*
87
+ - **sf3 conversion:** Compress SoundFont2 files to SoundFont3 with variable quality!
77
88
  - **Easy saving:** Also just [one function!](https://github.com/spessasus/SpessaSynth/wiki/SoundFont2-Class#write)
78
89
  #### Read and write SoundFont3 files
79
90
  - Same features as SoundFont2 but with now with **Ogg Vorbis compression!**
80
91
  - **Variable compression quality:** You choose between file size and quality!
81
92
  - **Compression preserving:** Avoid decompressing and recompressing uncompressed samples for minimal quality loss!
82
-
83
93
  ## License
84
94
  MIT License, except for the stbvorbis_sync.js in the `externals` folder which is licensed under the Apache-2.0 license.
@@ -27,7 +27,7 @@ export const RMIDINFOChunks = {
27
27
  }
28
28
 
29
29
  const FORCED_ENCODING = "utf-8";
30
- const DEFAULT_COPYRIGHT = "Created by SpessaSynth";
30
+ const DEFAULT_COPYRIGHT = "Created using SpessaSynth";
31
31
 
32
32
  /**
33
33
  * @typedef {Object} RMIDMetadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spessasynth_lib",
3
- "version": "3.13.1",
3
+ "version": "3.14.0",
4
4
  "description": "No compromise MIDI and SoundFont2 Synthesizer library",
5
5
  "browser": "index.js",
6
6
  "types": "@types/index.d.ts",
@@ -69,6 +69,12 @@ export class Sequencer
69
69
 
70
70
  this.songIndex = 0;
71
71
 
72
+ /**
73
+ * Indicates if the current midiData property has dummy data in it (not yet loaded)
74
+ * @type {boolean}
75
+ */
76
+ this.hasDummyData = true;
77
+
72
78
  this._loop = true;
73
79
 
74
80
  /**
@@ -206,6 +212,7 @@ export class Sequencer
206
212
  let songChangeData = messageData[0];
207
213
  this.songIndex = messageData[1];
208
214
  this.midiData = songChangeData;
215
+ this.hasDummyData = false;
209
216
  this.absoluteStartTime = 0;
210
217
  this.duration = this.midiData.duration;
211
218
  Object.entries(this.onSongChange).forEach((callback) => callback[1](songChangeData));
@@ -327,6 +334,7 @@ export class Sequencer
327
334
  this.pause();
328
335
  // add some dummy data
329
336
  this.midiData = DUMMY_MIDI_DATA;
337
+ this.hasDummyData = true;
330
338
  this.duration = 99999;
331
339
  this._sendMessage(WorkletSequencerMessageType.loadNewSongList, midiBuffers);
332
340
  this.songIndex = 0;