Coder Social home page Coder Social logo

colintsteele / midimessage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from notthetup/midimessage

0.0 1.0 0.0 28 KB

Simple Web-MIDI Message Parser

Home Page: http://notthetup.github.io/midimessage

License: MIT License

JavaScript 98.91% HTML 1.09%

midimessage's Introduction

midimessage

npm version

Simple MIDI Message Parser for JavaScript. This parser takes in a MIDIMessageEvent and returns a plain Javascript Object with propties indicating the data in the MIDI message.

Installation

npm install midimessage

Usage

var MIDIMessage = require('midimessage');

midiInput.onmidimessage = function(event){
	var midiMessage = MIDIMessage(event);
	console.log("Parsed", midiMessage);
}

API

MIDIMessage : Function - Takes a MIDIMessageEvent as the only argument and decodes the data in the MIDIMessageEvent. Returns a MIDIMessage Object which has various properties set to values based on the MIDIMessage.

These properties are based off the MIDI Message Standard as defined in the MIDI Spec

These are some of the properties that may be exposed (based on the incoming MIDI message) :

  • channel: Number (0-127) - MIDI Channel Number.
  • messageType: String - Type of message. Possible values defined below.
  • key: Number (0-127) - The key (note) number. Defined on -noteon,noteoff,keypressure messages.
  • velocity: Number (0-127) - Velocity. Defined on noteon,noteoff messages.
  • controllerNumber: Number (0-127) - Controller Number. Controller numbers 120-127 are reserved as "Channel Mode Messages".
  • controllerValue: Number (0-127) Controller Value. Has various meanings based on controllerNumber.
  • channelModeMessage: String - Channel Mode Message. Specific messages for Channel Modes based on controllerNumber. Possible values defined below.
  • pressure: Number (0-127) - Pressure value.
  • pitchBend: Number (0-16383) - Pitch Bend value. Center (no pitch change) is 8192.

Possible values of messageType property.

[
'noteon', // Note On event.
'noteoff', // Note Off event.
'keypressure', // Polyphonic Key Pressure (Aftertouch).
'controlchange', // Control Change.
'programchange', // Program Change.
'channelpressure', // Channel Pressure (After-touch).
'pitchbendchange', // Pitch Bend Change.
]

Possible values of channelModeMessage property.

[
'allsoundoff', // All Sound Off.
'resetallcontrollers', // Reset All Controllers.
'localcontroloff', // Local Control Off.
'localcontrolon', // Local Control On.
'allnotesoff', // All Notes Off.
'omnimodeoff', // Omni Mode Off.
'omnimodeon', // Omni Mode On.
'monomodeon', // Mono Mode On (Poly Off).
'polymodeon' // Poly Mode On (Mono Off)
]

License

MIT

See License file

midimessage's People

Contributors

notthetup avatar colintsteele avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.