0.0.3 • Published 4 years ago

omsjs v0.0.3

Weekly downloads
6
License
ISC
Repository
github
Last release
4 years ago

npm GitHub package.json version GitHub file size in bytes GitHub All Releases

  • Warning! OMSJS is new meaning many features are not operational at the moment. If you decide to use this library in its current state then make sure to check for updates and update regularly.

OMSJS

Open MIDI Standard JS (OMSJS) is node JS library which allows you to manage MIDI within your node application.

Installation

This will install the latest version of OMSJS.

From npm:

$ npm i omsjs

From source:

$ git clone https://github.com/JakeHughesMusic/OMSJS.git
$ cd omsjs/
$ npm install

OMSJS requires the node midi library to operate.

From npm:

$ npm i midi

From source:

$ git clone https://github.com/justinlatimer/node-midi.git
$ cd node-midi/
$ npm install

Usage

To use OMS, you'll need to import it using the code below:

const omsjs = require('omsjs');

This will give you access to the entire OMS library.

Inputs & Outputs

In OMS we handle midi data in two different ways:

  • MIDI Inputs - MIDI Inputs handle data coming in.
  • MIDI Outputs - MIDI Outputs handle data going out.

By default the inputs and outputs are completely seperate. This means they operate independently from each other.

We'll use the code below to create independent instances of inputs and outputs:

// New MIDI input instance
var input = new omsjs.MIDIInput('Your Input Name');

// New MIDI output instance
var output = new omsjs.MIDIOutput('Your Output Name');

This code creats new instances however only work as interfaces which can only send or receive to or from existing ports. However, we can create whats called a port. This allows us other programs to input and output to and from custom virtual ports.

Virtual Ports

Here we'll look at creating custom ports. The ports are handled by the instances that we created previously. This means each port must have its own instance.

The code below demonstrates to creation of input and output ports:

// New MIDI input instance and port
var input = new omsjs.MIDIInput('Your Input Name');
input.CreateVirtualInputPort();

// New MIDI output instance and port
var output = new omsjs.MIDIOutput('Your Output Name');
output.CreateVirtualOutputPort();

Once the code is running, the ports will exist globally on your system. You can view these ports in software such as Ableton Live. These ports will show with the same name as the instance so be thoughtful of what you name them.

© 2020, MSTR Audio, JakeHughesMusic

0.0.3

4 years ago

0.0.1

4 years ago

0.0.2

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago