You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63-4Lines changed: 63 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,10 +15,10 @@ npm install --save fluid-js
15
15
16
16
### From main thread
17
17
18
-
Copies `dist/fluid.js` (or `dist/fluid.min.js`) and `externals/libfluidsynth-2.0.1.js` (libfluidsynth JS file) to your project, and writes `<script>` tags as following order:
18
+
Copies `dist/fluid.js` (or `dist/fluid.min.js`) and `externals/libfluidsynth-2.0.2.js` (libfluidsynth JS file) to your project, and writes `<script>` tags as following order:
19
19
20
20
```html
21
-
<scriptsrc="libfluidsynth-2.0.1.js"></script>
21
+
<scriptsrc="libfluidsynth-2.0.2.js"></script>
22
22
<scriptsrc="fluid.js"></script>
23
23
```
24
24
@@ -73,7 +73,7 @@ fluid-js supports AudioWorklet process via `dist/fluid.worklet.js` (or `dist/flu
* Returns the Promise object that resolves with `Fluid.ISequencer` instance. The instance can be used with `Fluid.AudioWorkletNodeSynthesizer` instances which handled `createSequencer` calls.
140
140
141
+
### Using hook / handle MIDI-related event data with user-defined calllback
142
+
143
+
NOTE: `libfluidsynth-2.0.2.js` (or above) is necessary to use this feature.
144
+
145
+
From v1.2.0, you can hook MIDI events posted by player. For `Fluid.Synthesizer` instance, use `hookPlayerMIDIEvents` method as followings:
The sequencer also supports 'user-defined client' to handle event data.
192
+
193
+
* For sequncer instance created by `Synthesizer.createSequencer`, use `Synthesizer.registerSequencerClient` static method.
194
+
* You can use `Synthesizer.sendEventNow` static method to event data processed by the synthesizer or another clients.
195
+
* For sequncer instance created by `createSequencer` of `AudioWorkletNodeSynthesizer`, use `registerSequencerClientByName` instance method.
196
+
* The callback function must be added to 'AudioWorkletGlobalScope' like `hookPlayerMIDIEventsByName`'s callback.
197
+
* To re-send event data, use `Synthesizer.sendEventNow` in the worklet. `Synthesizer` constructor is available via `AudioWorkletGlobalScope.Fluid.Synthesizer`.
198
+
* You can rewrite event data passed to the callback, with using `Fluid.rewriteEventData` (`AudioWorkletGlobalScope.Fluid.rewriteEventData` for worklet).
0 commit comments