JSPM

  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q34022F
  • License MIT

Easily interact with Pirate Midi devices over USB from Node.js

Package Exports

  • pirate-midi-usb
  • pirate-midi-usb/lib/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pirate-midi-usb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pirate-midi-usb

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

Easily interact with Pirate Midi devices over USB from Node.js

Install

npm install pirate-midi-usb

Usage

import { getDevices } from 'pirate-midi-usb';

const devices = await getDevices();

await device[0].goToBank(2);

API

This package implements the Pirate Midi Device API to interact with Bridge4 and Bridge6 devices, see the API documentation for the underlying details.

Use getDevices to retrieve available devices

Scans USB devices and returns a promise with an array of PirateMidiDevice instances (one per device) to interact with.

import { getDevices } from 'pirate-midi-usb';

const devices = await getDevices();

const bridge6 = device.find(device => device.deviceName === 'Bridge6');

Each instance of a device is returned with the deviceInfo prefetched. This information could be used to select a specific device when multiple are connected. When no devices are found an empty array will be returned

Use PirateMidiDevice methods to interact with the device

Check PirateMidiDevice.ts to see all implemented methods.

Examples

See the examples folder, check out the intro example to get started!

Run examples by their filename:

npm run examples:intro

Thanks

Thanks to Pirate Midi for the awesome devices and the openness.

This repo was started with typescript-npm-package-template

Tooling used