Platform Support
Browser
In the browser, the library uses the Web MIDI API to communicate with VFLEX devices. Call tryConnect() to auto-discover the device.
Supported browsers: Chrome, Edge, Opera
Not supported: Firefox and Safari do not currently support Web MIDI.
Node.js
In Node.js, there is no Web MIDI API. Instead, use connectWithPorts(input, output) to provide your own MIDI input and output objects. The library works with any MIDI backend that matches the required port interface.
JZZ is a recommended cross-platform MIDI library for Node.js.
Install
npm install lib-vflex jzz
Port Interface
The MIDI ports you pass to connectWithPorts() must implement:
- input: must accept
onmidimessage = callbackwhere callback receives{ data: [status, d1, d2] } - output: must have a
send([status, d1, d2])method
See the Quick Start guide for a complete example of wrapping JZZ ports.
npm Package
The library is published on npm as lib-vflex:
npm install lib-vflex
const { VFLEX, VFLEX_COMMANDS } = require('lib-vflex');
The same file can also be loaded directly via a <script> tag in the browser, where VFLEX and VFLEX_COMMANDS are exposed as globals.