requestMIDIAccess for all
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.eslintrc
.gitignore
.travis.yml
README.md
index.js
package.json
test.js

README.md

request-midi-access

Build Status NPM Version License

requestMIDIAccess for all

Installation

npm install --save request-midi-access

or copy and paste

function requestMIDIAccess(opts) {
  opts = opts || {};
  if (window.navigator && typeof window.navigator.requestMIDIAccess === "function") {
    return window.navigator.requestMIDIAccess(opts);
  }
  return Promise.reject(new TypeError("Web MIDI API is not supported"));
}

How to use

const requestMIDIAccess = require("request-midi-access");

requestMIDIAccess().then((access) => {
  // Web MIDI API is supported
}, (e) => {
  console.log(e);
  // → TypeError "Web MIDI API is not supported"
});

License

MIT