js-synthesizer
Advanced tools
Comparing version 1.8.2 to 1.8.3
# Changelog | ||
## v1.8.3 | ||
(This version has no updates for js-synthesizer itself.) | ||
- Update libfluidsynth scripts | ||
- Update README.md | ||
## v1.8.2 | ||
@@ -4,0 +11,0 @@ |
/*! | ||
js-synthesizer version 1.8.2 | ||
js-synthesizer version 1.8.3 | ||
@@ -4,0 +4,0 @@ @license |
/*! | ||
js-synthesizer version 1.8.2 | ||
js-synthesizer version 1.8.3 | ||
@@ -4,0 +4,0 @@ @license |
@@ -43,3 +43,3 @@ { | ||
"types": "./dist/lib/index.d.ts", | ||
"version": "1.8.2" | ||
"version": "1.8.3" | ||
} |
@@ -8,2 +8,6 @@ [![NPM version](https://badge.fury.io/js/js-synthesizer.svg)](https://www.npmjs.com/package/js-synthesizer) | ||
## Demo | ||
https://www.pg-fl.jp/music/js-synthesizer/index.en.htm | ||
## Install | ||
@@ -36,3 +40,3 @@ | ||
When initialized, you can use APIs via `JSSynth` namespace object. | ||
After initialized, you can use APIs via `JSSynth` namespace object. | ||
@@ -74,3 +78,3 @@ ```js | ||
If you prefer to load js-synthesizer as an ES module, you can use `import` statement such as `import * as JSSynth from 'js-synthesizer'`. | ||
js-synthesizer is built as UMD module. If you prefer to load js-synthesizer as a CommonJS / ES module, you can use `import` statement such as `import * as JSSynth from 'js-synthesizer'` by using bundlers (such as webpack). | ||
@@ -80,4 +84,4 @@ Notes: | ||
* `js-synthesizer.js` intends the ES2015-supported environment. If you need to run the script without errors on non-ES2015 environment such as IE11 (to notify 'unsupported'), you should load those scripts dynamically, or use transpiler such as babel. | ||
* When just after the scripts loaded, some APIs may fail since libfluidsynth is not ready. To avoid this, you can use the Promise object returned by `JSSynth.waitForReady`. | ||
* libfluidsynth JS file is not `import`-able and its license (LGPL v2.1) is differ from js-synthesizer's (BSD-3-Clause). | ||
* When just after the scripts loaded, some APIs may fail since libfluidsynth is not ready. To avoid this, you can use the Promise object returned by `JSSynth.waitForReady` as above example. | ||
* libfluidsynth JS file is not `import`-able and its license (LGPL v2.1) is different from js-synthesizer's (BSD-3-Clause). | ||
@@ -125,10 +129,8 @@ ### With AudioWorklet | ||
(You can also load js-synthesizer as an ES Module from the Web Worker.) | ||
Note that since the Web Audio is not supported on the Web Worker, the APIs/methods related to the Web Audio will not work. If you want to use both Web Worker and AudioWorklet, you should implement AudioWorkletProcessor manually as followings: | ||
* main thread -- create AudioWorkletNode and establish connections between Web Worker and AudioWorklet | ||
* You must transfer rendered audio frames from Web Worker to AudioWorklet because AudioWorklet environment does not support creating Web Worker. By creating `MessageChannel` and sending its port instances to Web Worker and AudioWorklet, they can communicate each other directly. | ||
* You need to transfer rendered audio frames from Web Worker to AudioWorklet, but AudioWorklet environment does not support creating Web Worker. By creating `MessageChannel` and sending its port instances to Web Worker and AudioWorklet, they can communicate each other directly. | ||
* Web Worker thread -- render audio frames into raw buffers and send it for AudioWorklet thread | ||
* AudioWorklet thread -- receive audio frames and 'render' it in the `process` method | ||
* AudioWorklet thread -- receive audio frames (and queue) and 'render' it in the `process` method | ||
@@ -145,3 +147,3 @@ ## API | ||
* Creates the synthesizer instance communicating AudioWorklet (see above). No parameters are available. | ||
* You must call `createAudioNode` method to use other instance methods. | ||
* You must call `createAudioNode` method first to use other instance methods. | ||
@@ -159,6 +161,4 @@ ### Creation of Sequencer instance | ||
NOTE: `libfluidsynth-2.0.2.js` (or above) is necessary to use this feature. | ||
You can hook MIDI events posted by player. For `JSSynth.Synthesizer` instance, use `hookPlayerMIDIEvents` method as followings: | ||
From v1.2.0, you can hook MIDI events posted by player. For `JSSynth.Synthesizer` instance, use `hookPlayerMIDIEvents` method as followings: | ||
```js | ||
@@ -211,7 +211,7 @@ syn.hookPlayerMIDIEvents(function (s, type, event) { | ||
* For sequncer instance created by `Synthesizer.createSequencer`, use `Synthesizer.registerSequencerClient` static method. | ||
* You can use `Synthesizer.sendEventNow` static method to event data processed by the synthesizer or another clients. | ||
* You can use `Synthesizer.sendEventNow` static method to send event data, processed by the synthesizer or clients, to another clients/synthesizers. | ||
* For sequncer instance created by `createSequencer` of `AudioWorkletNodeSynthesizer`, use `registerSequencerClientByName` instance method. | ||
* The callback function must be added to 'AudioWorkletGlobalScope' like `hookPlayerMIDIEventsByName`'s callback. | ||
* To re-send event data, use `Synthesizer.sendEventNow` in the worklet. `Synthesizer` constructor is available via `AudioWorkletGlobalScope.JSSynth.Synthesizer`. | ||
* You can rewrite event data passed to the callback, with using `JSSynth.rewriteEventData` (`AudioWorkletGlobalScope.JSSynth.rewriteEventData` for worklet). | ||
* You can rewrite event data passed to the callback, by using `JSSynth.rewriteEventData` (`AudioWorkletGlobalScope.JSSynth.rewriteEventData` for worklet). | ||
@@ -218,0 +218,0 @@ ### `JSSynth` methods |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2924715