Skip to content

Send and receive MIDI messages between the Cordova app and attached hardware devices.

License

Notifications You must be signed in to change notification settings

manuelnelson/cordova-plugin-midi-sender

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIDISender

This is a fork of cordova-plugin-midi-sender. I added android capabilities to the original plugin which was just ios based.

Installation

NPM:

cordova plugin add cordova-plugin-midi-sender-android

Repository:

cordova plugin add https://github.com/manuelnelson/cordova-plugin-midi-sender.git

Dependencies

CoreMIDI.framework is required, and will be linked for you automatically

Methods

Listen for incoming MIDI messages on all channels:

cordova.plugins.MIDISender.getIncoming(function(msg) {
  if (msg.channel){ // Ignore msg sent on plugin initialization
  
    /* MESSAGE DATA
      msg.channel = MIDI channel (1-16)
      msg.type = Type of MIDI message: 'Program Change', 'Control Change', 'Note On', 'Note off'
      msg.data = MIDI Data: <number> for PC/CC (1-128), or Note (i.e. "C3") for Note On/Off
      msg.value = Not present for 'Program Change' messages
    */
    
  }
});

Send MIDI Messages:

// Send Program Change (Channel, Data)
cordova.plugins.MIDISender.sendProgramChange(1, 30);

// Send NoteOn (Channel, Data, Value)
cordova.plugins.MIDISender.sendNote(1, 60, 127); // Ch 1, NoteOn C3, Value

// Send Control Change (Channel, Data, Value)
cordova.plugins.MIDISender.sendControlChange(1, 1, 1);

Permissions

<feature name="MIDISender">
    <param name="ios-package" value="MIDISender" onload="true" />
</feature>

Debugging

Debug messages are sent to NSLog

Resources

If you're unfamiliar with MIDI, checkout this spec on MIDI messages.

Credits

Jonathan Kelly

About

Send and receive MIDI messages between the Cordova app and attached hardware devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 63.8%
  • Java 27.0%
  • JavaScript 9.2%