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 theWebMidi
object. It still supports using a callback. -
Input
andOutput
objects now emitopened
,closed
anddisconnected
events. -
Hundreds of unit tests have been added and test coverage is now available.
-
There are new
InputChannel
andOutputChannel
objects. They are used to communication with a single channel of an input or output. -
All emitted events now have a
target
property 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 aduration
option. 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
Output
object 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 auseRawValue
options allowing the assignment of value using an integer between 0 and 127 instead of a float between 0 and 1. -
There is a new
Note
object 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.validation
property (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 ofOutput
andOutputChannel
can now officially useUint8Array
input (not supported on Node.js however). -
Licence has been changed to Apache 2.0
-
An
octaveOffset
property has been added toInput
,InputChannel
,Output
andOutputChannel
. This means you can offset the octave globally, at the input/output level or at the channel level -
A
Message
object 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
InputChannel
object offers agetNoteState()
method that reports if a note is currently playing or not. It also has a newnotesState
property which is an array holding the playing status of all notes (0-127). -
It is now possible to add a forwarder to an
Input
that will forward MIDI messages to a specified output. Also, the inbound messages can be filtered for forwarding by message type and channel. A newForwarder
class has been added for that purpose. -
Added
WebMidi.version
-
The
WedMidi
object now has adefaults
property where you can set system-wide defaults such as the defaultattack
andrelease
velocity. More defaults to come!
- [BREAKING CHANGE] Passing
undefined
as thechannel
value 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'svalue
property is now a float between 0 and 1. ItsrawValue
property now contains the 7bit integer value (between 0 and 127). -
[BREAKING CHANGE] The
"nrpn"
event'svalue
property is now a float between 0 and 1. ItsrawValue
property now contains the 16bit integer value (between 0 and 65535). -
Grunt has been replaced with NPM scripts for all build purposes.
-
[BREAKING CHANGE] The
nrpnEventsEnabled
property has been moved from theInput
class to theInputChannel
class. Trying to access it will trigger a warning in the console. -
[BREAKING CHANGE] The
getCcNameByNumber()
method has been moved from theInput
class to theInputChannel
class and now returnsundefined
instead offalse
when no matching name is found. -
[BREAKING CHANGE] The
"tuningrequest"
event has been renamed"tunerequest"
. -
The event received by listeners registered on
Input
andInputChannel
objects has been slightly changed. Itsdata
property now contains a regular array (instead of aUint8Array
). ItsrawData
property now contains theUint8Array
. -
Several methods have been moved from the
WebMidi
object to theUtilities
object. Using the old methods will continue to work but will trigger a deprecation warning in the console. -
The
send()
method now accepts aMessage
object. -
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
Utilities
class such asfrom7bitToFloat()
,fromFloatTo7Bit()
,fromMsbLsbToFloat()
,fromFloatToMsbLsb()
, etc. -
All enumerations have been move to the
Enumerations
object (e.g.MIDI_CHANNEL_MESSAGES
,MIDI_CHANNEL_NUMBERS
, etc.)
-
The
velocity
option parameter has been renamedattack
. There are newrawAttack
andrawRelease
parameters that should be used instead of settingrawVelocity
totrue
. -
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 theInput
class has been deprecated. UseaddListener()
instead. -
The
InputChannel.nrpnEventsEnabled
property 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.