Starting with version 3.x, all notable changes to WebMidi.js will be documented in this file. The format used is the one suggested by Keep a Changelog.
-
WebMidi.js now has builtin Node.js support thanks to the jzz node module by Jazz-Soft.
-
WebMidi.js is now available in IIFE (Immediately Invoked Function Expression), CJS (CommonJS) and ESM (ECMAScript module) flavours (all with normal and minifed versions with sourcemaps).
-
WebMidi.js now publishes a TypeScript definition file for CJS and ESM with all releases.
-
WebMidi.js now explicitly checks for Jazz-Plugin support in environments with no native support for the Web MIDI API.
-
The
WebMidi.enable()method now returns a promise. The promise is fulfilled with theWebMidiobject. It still supports using a callback. -
InputandOutputobjects now emitopened,closedanddisconnectedevents. -
Hundreds of unit tests have been added and test coverage is now available.
-
There are new
InputChannelandOutputChannelobjects. They are used to communication with a single channel of an input or output. -
All emitted events now have a
targetproperty referencing the object that triggered the event. -
The
sendNoteOn()method has been added. It behaves the same way asplayNote()does except it does not accept adurationoption. It was added mostly for completeness' sake. -
The
sendNoteOff()method has been added. It behaves the same way asstopNote()does. Actually,stopNote()is an alias tosendNoteOff(). -
All methods of the
Outputobject that communication with a device are prefixed with "send". This makes it easier to find the right method. Old method names are still usable but are deprecated. -
The
sendChannelAftertouch(),sendKeyAftertouch()andsendPitchbend()method now have auseRawValueoptions allowing the assignment of value using an integer between 0 and 127 instead of a float between 0 and 1. -
There is a new
Noteobject that can be used in various places such as when callingplayNote()orstopNote(). It carries with it the note number, the duration (if any), the attack and release information, etc. -
A
WebMidi.validationproperty (defaults totrue) can be used to disable all argument checking and legacy support throughout the library (for performance). This property can also be in the options ofWebMidi.enable(). -
The
send()andsendSysex()methods ofOutputandOutputChannelcan now officially useUint8Arrayinput (not supported on Node.js however). -
Licence has been changed to Apache 2.0
-
An
octaveOffsetproperty has been added toInput,InputChannel,OutputandOutputChannel. This means you can offset the octave globally, at the input/output level or at the channel level -
A
Messageobject has been added. This allows easier routing of messages. -
Added support for RPN messages and improved NRPN parsing.
-
A two-position array can now be passed to
sendControlChange()to specify both MSB and LSB at once. -
The
InputChannelobject offers agetNoteState()method that reports if a note is currently playing or not. It also has a newnotesStateproperty which is an array holding the playing status of all notes (0-127). -
It is now possible to add a forwarder to an
Inputthat will forward MIDI messages to a specified output. Also, the inbound messages can be filtered for forwarding by message type and channel. A newForwarderclass has been added for that purpose. -
Added
WebMidi.version -
The
WedMidiobject now has adefaultsproperty where you can set system-wide defaults such as the defaultattackandreleasevelocity. More defaults to come!
- [BREAKING CHANGE] Passing
undefinedas thechannelvalue toaddListener()no longer means that all channels should be listening. This was a terrible design decision and it ends with version
-
Documentation is now generated with jsdoc instead of the outdated yuidoc.
-
[BREAKING CHANGE] The
"controlchange"event'svalueproperty is now a float between 0 and 1. ItsrawValueproperty now contains the 7bit integer value (between 0 and 127). -
[BREAKING CHANGE] The
"nrpn"event'svalueproperty is now a float between 0 and 1. ItsrawValueproperty now contains the 16bit integer value (between 0 and 65535). -
Grunt has been replaced with NPM scripts for all build purposes.
-
[BREAKING CHANGE] The
nrpnEventsEnabledproperty has been moved from theInputclass to theInputChannelclass. Trying to access it will trigger a warning in the console. -
[BREAKING CHANGE] The
getCcNameByNumber()method has been moved from theInputclass to theInputChannelclass and now returnsundefinedinstead offalsewhen no matching name is found. -
[BREAKING CHANGE] The
"tuningrequest"event has been renamed"tunerequest". -
The event received by listeners registered on
InputandInputChannelobjects has been slightly changed. Itsdataproperty now contains a regular array (instead of aUint8Array). ItsrawDataproperty now contains theUint8Array. -
Several methods have been moved from the
WebMidiobject to theUtilitiesobject. Using the old methods will continue to work but will trigger a deprecation warning in the console. -
The
send()method now accepts aMessageobject. -
If a device is disconnected and connected back, it will retain its state (such as listeners, etc.). This is particularly useful when the computer goes to sleep and is brought back online.
-
Several conversion methods have been added to the new
Utilitiesclass such asfrom7bitToFloat(),fromFloatTo7Bit(),fromMsbLsbToFloat(),fromFloatToMsbLsb(), etc. -
All enumerations have been move to the
Enumerationsobject (e.g.MIDI_CHANNEL_MESSAGES,MIDI_CHANNEL_NUMBERS, etc.)
-
The
velocityoption parameter has been renamedattack. There are newrawAttackandrawReleaseparameters that should be used instead of settingrawVelocitytotrue. -
The
WebMidi.noteNameToNumber()method was renamed and moved toUtilities.toNoteNumber(). The old method has been deprecated but will continue to work in v3.x. -
The
WebMidi.toMIDIChannels()method was renamed and moved toUtilities.sanitizeChannels(). The old method has been deprecated but will continue to work in v3.x. -
The name of the
Output.sendTuningRequest()method was changed toOutput.sendTuneRequest(). The old name has been deprecated but will continue to work in v3.x. -
The
on()method of theInputclass has been deprecated. UseaddListener()instead. -
The
InputChannel.nrpnEventsEnabledproperty has been renamed toInputChannel.parameterNumberEventsEnabled. The old property is deprecated but will be kept for backwards compatibility.
- Support for Bower.
Versions 2.5.x and earlier have not been tracked in this changelog.