Skip to main content

InputChannel

The InputChannel class represents a single MIDI input channel (1-16) from a single input device. This object is derived from the host's MIDI subsystem and should not be instantiated directly.

All 16 InputChannel objects can be found inside the input's channels property.

Since: 3.0.0

Extends: EventEmitter

Fires: allnotesoff, allsoundoff, channelaftertouch, controlchange, controlchange-controllerxxx, keyaftertouch, localcontrol, midimessage, monomode, noteoff, noteon, nrpn, nrpn-databuttondecrement, nrpn-databuttonincrement, nrpn-dataentrycoarse, nrpn-dataentryfine, omnimode, pitchbend, programchange, resetallcontrollers, rpn, rpn-databuttondecrement, rpn-databuttonincrement, rpn-dataentrycoarse, rpn-dataentryfine, unknownmessage

Constructorโ€‹

Creates an InputChannel object.

Parameters

new InputChannel(input, number)

ParameterTypeDefaultDescription
inputInput
The Input object this channel belongs to.
numbernumber
The channel's MIDI number (1-16).

Propertiesโ€‹

.eventCountโ€‹

Type: number
Attributes: read-only

The number of unique events that have registered listeners.

Note: this excludes global events registered with EventEmitter.ANY_EVENT because they are not tied to a specific event.

.eventMapโ€‹

Type: Object
Attributes: read-only

An object containing a property for each event with at least one registered listener. Each event property contains an array of all the Listener objects registered for the event.

.eventNamesโ€‹

Type: Array.<string>
Attributes: read-only

An array of all the unique event names for which the emitter has at least one registered listener.

Note: this excludes global events registered with EventEmitter.ANY_EVENT because they are not tied to a specific event.

.eventsSuspendedโ€‹

Type: boolean

Whether or not the execution of callbacks is currently suspended for this emitter.

.inputโ€‹

Since: 3.0
Type: Input

The Input this channel belongs to.

.notesStateโ€‹

Type: Array.<boolean>

Contains the current playing state of all MIDI notes of this channel (0-127). The state is true for a currently playing note and false otherwise.

.numberโ€‹

Since: 3.0
Type: number

This channel's MIDI number (1-16).

.octaveOffsetโ€‹

Since: 3.0
Type: number

An integer to offset the reported octave of incoming note-specific messages (noteon, noteoff and keyaftertouch). By default, middle C (MIDI note number 60) is placed on the 4th octave (C4).

If, for example, octaveOffset is set to 2, MIDI note number 60 will be reported as C6. If octaveOffset is set to -1, MIDI note number 60 will be reported as C3.

Note that this value is combined with the global offset value defined by WebMidi.octaveOffset object and with the value defined on the parent input object with Input.octaveOffset.

.parameterNumberEventsEnabledโ€‹

Type: boolean

Indicates whether events for Registered Parameter Number and Non-Registered Parameter Number should be dispatched. RPNs and NRPNs are composed of a sequence of specific control change messages. When a valid sequence of such control change messages is received, an rpn or nrpn event will fire.

If an invalid or out-of-order control change message is received, it will fall through the collector logic and all buffered control change messages will be discarded as incomplete.


Methodsโ€‹

.addListener(...)โ€‹

Adds a listener for the specified event. It returns the Listener object that was created and attached to the event.

To attach a global listener that will be triggered for any events, use EventEmitter.ANY_EVENT as the first parameter. Note that a global listener will also be triggered by non-registered events.

Parameters

Signature: addListener(event, callback, [options])

ParameterType(s)DefaultDescription
eventstring
Symbol
The event to listen to.
callbackEventEmitter~callback
The callback function to execute when the event occurs.
[options]Object
{}
[options.context]Object
thisThe value of this in the callback function.
[options.prepend]boolean
falseWhether the listener should be added at the beginning of the listeners array and thus executed first.
[options.duration]number
InfinityThe number of milliseconds before the listener automatically expires.
[options.remaining]number
InfinityThe number of times after which the callback should automatically be removed.
[options.arguments]array
An array of arguments which will be passed separately to the callback function. This array is stored in the arguments property of the Listener object and can be retrieved or modified as desired.

Return Value

Returns: Listener

The newly created Listener object.

Throws:

  • TypeError : The event parameter must be a string or EventEmitter.ANY_EVENT.
  • TypeError : The callback parameter must be a function.

.addOneTimeListener(...)โ€‹

Adds a one-time listener for the specified event. The listener will be executed once and then destroyed. It returns the Listener object that was created and attached to the event.

To attach a global listener that will be triggered for any events, use EventEmitter.ANY_EVENT as the first parameter. Note that a global listener will also be triggered by non-registered events.

Parameters

Signature: addOneTimeListener(event, callback, [options])

ParameterType(s)DefaultDescription
eventstring
Symbol
The event to listen to
callbackEventEmitter~callback
The callback function to execute when the event occurs
[options]Object
{}
[options.context]Object
thisThe context to invoke the callback function in.
[options.prepend]boolean
falseWhether the listener should be added at the beginning of the listeners array and thus executed first.
[options.duration]number
InfinityThe number of milliseconds before the listener automatically expires.
[options.arguments]array
An array of arguments which will be passed separately to the callback function. This array is stored in the arguments property of the Listener object and can be retrieved or modified as desired.

Return Value

Returns: Listener

The newly created Listener object.

Throws:

  • TypeError : The event parameter must be a string or EventEmitter.ANY_EVENT.
  • TypeError : The callback parameter must be a function.

.destroy()โ€‹

Destroys the InputChannel by removing all listeners and severing the link with the MIDI subsystem's input.

.emit(...)โ€‹

Executes the callback function of all the Listener objects registered for a given event. The callback functions are passed the additional arguments passed to emit() (if any) followed by the arguments present in the arguments property of the Listener object (if any).

If the eventsSuspended property is true or the Listener.suspended property is true, the callback functions will not be executed.

This function returns an array containing the return values of each of the callbacks.

It should be noted that the regular listeners are triggered first followed by the global listeners (those added with EventEmitter.ANY_EVENT).

Parameters

Signature: emit(event, ...args)

ParameterType(s)DefaultDescription
eventstring
The event
args*
Arbitrary number of arguments to pass along to the callback functions

Return Value

Returns: Array

An array containing the return value of each of the executed listener functions.

Throws:

  • TypeError : The event parameter must be a string.

.getListenerCount(...)โ€‹

Returns the number of listeners registered for a specific event.

Please note that global events (those added with EventEmitter.ANY_EVENT) do not count towards the remaining number for a "regular" event. To get the number of global listeners, specifically use EventEmitter.ANY_EVENT as the parameter.

Parameters

Signature: getListenerCount(event)

ParameterType(s)DefaultDescription
eventstring
Symbol
The event which is usually a string but can also be the special EventEmitter.ANY_EVENT symbol.

Return Value

Returns: number

An integer representing the number of listeners registered for the specified event.

.getListeners(...)โ€‹

Returns an array of all the Listener objects that have been registered for a specific event.

Please note that global events (those added with EventEmitter.ANY_EVENT) are not returned for "regular" events. To get the list of global listeners, specifically use EventEmitter.ANY_EVENT as the parameter.

Parameters

Signature: getListeners(event)

ParameterType(s)DefaultDescription
eventstring
Symbol
The event to get listeners for.

Return Value

Returns: Array.<Listener>

An array of Listener objects.

.getNoteState(...)โ€‹

Since: version 3.0.0

Returns the playing status of the specified note (true if the note is currently playing, false if it is not). The note parameter can be an unsigned integer (0-127), a note identifier ("C4", "G#5", etc.) or a Note object.

IF the note is specified using an integer (0-127), no octave offset will be applied.

Parameters

Signature: getNoteState(note)

ParameterType(s)DefaultDescription
notenumber
string
Note
The note to get the state for. The octaveOffset (channel, input and global) will be factored in for note identifiers and Note objects.

Return Value

Returns: boolean

.hasListener(...)โ€‹

Returns true if the specified event has at least one registered listener. If no event is specified, the method returns true if any event has at least one listener registered (this includes global listeners registered to EventEmitter.ANY_EVENT).

Note: to specifically check for global listeners added with EventEmitter.ANY_EVENT, use EventEmitter.ANY_EVENT as the parameter.

Parameters

Signature: hasListener([event], [callback])

ParameterType(s)DefaultDescription
[event]string
Symbol
(any event)The event to check
[callback]function
Listener
(any callback)The actual function that was added to the event or the Listener object returned by addListener().

Return Value

Returns: boolean

.removeListener(...)โ€‹

Removes all the listeners that match the specified criterias. If no parameters are passed, all listeners will be removed. If only the event parameter is passed, all listeners for that event will be removed. You can remove global listeners by using EventEmitter.ANY_EVENT as the first parameter.

To use more granular options, you must at least define the event. Then, you can specify the callback to match or one or more of the additional options.

Parameters

Signature: removeListener([event], [callback], [options])

ParameterType(s)DefaultDescription
[event]string
The event name.
[callback]EventEmitter~callback
Only remove the listeners that match this exact callback function.
[options]Object
[options.context]*
Only remove the listeners that have this exact context.
[options.remaining]number
Only remove the listener if it has exactly that many remaining times to be executed.

.suspendEvent(...)โ€‹

Suspends execution of all callbacks functions registered for the specified event type.

You can suspend execution of callbacks registered with EventEmitter.ANY_EVENT by passing EventEmitter.ANY_EVENT to suspendEvent(). Beware that this will not suspend all callbacks but only those registered with EventEmitter.ANY_EVENT. While this may seem counter-intuitive at first glance, it allows the selective suspension of global listeners while leaving other listeners alone. If you truly want to suspends all callbacks for a specific EventEmitter, simply set its eventsSuspended property to true.

Parameters

Signature: suspendEvent(event)

ParameterType(s)DefaultDescription
eventstring
Symbol
The event name (or EventEmitter.ANY_EVENT) for which to suspend execution of all callback functions.

.unsuspendEvent(...)โ€‹

Resumes execution of all suspended callback functions registered for the specified event type.

You can resume execution of callbacks registered with EventEmitter.ANY_EVENT by passing EventEmitter.ANY_EVENT to unsuspendEvent(). Beware that this will not resume all callbacks but only those registered with EventEmitter.ANY_EVENT. While this may seem counter-intuitive, it allows the selective unsuspension of global listeners while leaving other callbacks alone.

Parameters

Signature: unsuspendEvent(event)

ParameterType(s)DefaultDescription
eventstring
Symbol
The event name (or EventEmitter.ANY_EVENT) for which to resume execution of all callback functions.

.waitFor(...)โ€‹

Attributes: async

The waitFor() method is an async function which returns a promise. The promise is fulfilled when the specified event occurs. The event can be a regular event or EventEmitter.ANY_EVENT (if you want to resolve as soon as any event is emitted).

If the duration option is set, the promise will only be fulfilled if the event is emitted within the specified duration. If the event has not been fulfilled after the specified duration, the promise is rejected. This makes it super easy to wait for an event and timeout after a certain time if the event is not triggered.

Parameters

Signature: waitFor(event, [options])

ParameterType(s)DefaultDescription
eventstring
Symbol
The event to wait for
[options]Object
{}
[options.duration]number
InfinityThe number of milliseconds to wait before the promise is automatically rejected.

Eventsโ€‹

allnotesoffโ€‹

Event emitted when an "all notes off" channel-mode MIDI message has been received.

Event Properties

PropertyTypeDescription
typestringallnotesoff
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

allsoundoffโ€‹

Event emitted when an "all sound off" channel-mode MIDI message has been received.

Event Properties

PropertyTypeDescription
typestringallsoundoff
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

channelaftertouchโ€‹

Event emitted when a control change MIDI message has been received.

Event Properties

PropertyTypeDescription
typestringchannelaftertouch
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
valuenumberThe value expressed as a float between 0 and 1.
rawValuenumberThe raw MIDI value expressed as an integer between 0 and 127.

controlchangeโ€‹

Event emitted when a control change MIDI message has been received.

Event Properties

PropertyTypeDescription
typestringcontrolchange
subtypestringThe type of control change message that was received.
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
controllerobject
controller.numberobjectThe number of the controller.
controller.nameobjectThe usual name or function of the controller.
valuenumberThe value expressed as a float between 0 and 1.
rawValuenumberThe value expressed as an integer (between 0 and 127).

controlchange-controllerxxxโ€‹

Event emitted when a control change MIDI message has been received and that message is targeting the controller numbered "xxx". Of course, "xxx" should be replaced by a valid controller number (0-127).

Event Properties

PropertyTypeDescription
typestringcontrolchange-controllerxxx
subtypestringThe type of control change message that was received.
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
controllerobject
controller.numberobjectThe number of the controller.
controller.nameobjectThe usual name or function of the controller.
valuenumberThe value expressed as a float between 0 and 1.
rawValuenumberThe value expressed as an integer (between 0 and 127).

keyaftertouchโ€‹

Event emitted when a key-specific aftertouch MIDI message has been received.

Event Properties

PropertyTypeDescription
typestring"keyaftertouch"
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
noteobjectA Note object containing information such as note name and number.
valuenumberThe aftertouch amount expressed as a float between 0 and 1.
rawValuenumberThe aftertouch amount expressed as an integer (between 0 and 127).

localcontrolโ€‹

Event emitted when a "local control" channel-mode MIDI message has been received. The value property of the event is set to either true (local control on) of false (local control off).

Event Properties

PropertyTypeDescription
typestringlocalcontrol
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
valuebooleanFor local control on, the value is true. For local control off, the value is false.
rawValuebooleanFor local control on, the value is 127. For local control off, the value is 0.

midimessageโ€‹

Event emitted when a MIDI message of any kind is received by an InputChannel

Event Properties

PropertyTypeDescription
typestringmidimessage
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

monomodeโ€‹

Event emitted when a "mono/poly mode" MIDI message has been received. The value property of the event is set to either true (mono mode on / poly mode off) or false (mono mode off / poly mode on).

Event Properties

PropertyTypeDescription
typestringmonomode
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
valuebooleanThe value is true for omni mode on and false for omni mode off.
rawValuebooleanThe raw MIDI value

noteoffโ€‹

Event emitted when a note off MIDI message has been received on the channel.

Event Properties

PropertyTypeDescription
typestringnoteoff
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
noteobjectA Note object containing information such as note name, octave and release velocity.
valuenumberThe release velocity amount expressed as a float between 0 and 1.
rawValuenumberThe release velocity amount expressed as an integer (between 0 and 127).

noteonโ€‹

Event emitted when a note on MIDI message has been received.

Event Properties

PropertyTypeDescription
typestringnoteon
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
noteobjectA Note object containing information such as note name, octave and release velocity.
valuenumberThe attack velocity amount expressed as a float between 0 and 1.
rawValuenumberThe attack velocity amount expressed as an integer (between 0 and 127).

nrpnโ€‹

Event emitted when any NRPN message is received on the input. There are four subtypes of NRPN messages:

  • nrpn-dataentrycoarse
  • nrpn-dataentryfine
  • nrpn-databuttonincrement
  • nrpn-databuttondecrement

The parameter to which the message applies can be found in the event's parameter property.

Event Properties

PropertyTypeDescription
typestringnrpn
subtypestringThe precise type of NRPN message that was received.
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
messageMessageA Message object containing information about the incoming MIDI message.
parameternumberThe non-registered parameter number (0-16383)
parameterMsbnumberThe MSB portion of the non-registered parameter number (0-127)
parameterLsb:numberThe LSB portion of the non-registered parameter number (0-127)
valuenumberThe received value as a normalized number between 0 and 1.
rawValuenumberThe value as received (0-127)

nrpn-databuttondecrementโ€‹

Event emitted when an NRPN data button decrement message is received on the input. The specific parameter to which the message applies can be found in the event's parameter property. It is one of the ones defined in Enumerations.MIDI_REGISTERED_PARAMETERS.

Event Properties

PropertyTypeDescription
typestringnrpn-databuttondecrement
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
messageMessageA Message object containing information about the incoming MIDI message.
parameterstringThe registered parameter's name
parameterMsbnumberThe MSB portion of the registered parameter (0-127)
parameterLsb:numberThe LSB portion of the registered parameter (0-127)
valuenumberThe received value as a normalized number between 0 and 1.
rawValuenumberThe value as received (0-127)

nrpn-databuttonincrementโ€‹

Event emitted when an NRPN data button increment message is received on the input. The specific parameter to which the message applies can be found in the event's parameter property. It is one of the ones defined in Enumerations.MIDI_REGISTERED_PARAMETERS.

Event Properties

PropertyTypeDescription
typestringnrpn-databuttonincrement
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
messageMessageA Message object containing information about the incoming MIDI message.
parameterstringThe registered parameter's name
parameterMsbnumberThe MSB portion of the registered parameter (0-127)
parameterLsb:numberThe LSB portion of the registered parameter (0-127)
valuenumberThe received value as a normalized number between 0 and 1.
rawValuenumberThe value as received (0-127)

nrpn-dataentrycoarseโ€‹

Event emitted when an NRPN data entry coarse message is received on the input. The specific parameter to which the message applies can be found in the event's parameter property. It is one of the ones defined in Enumerations.MIDI_REGISTERED_PARAMETERS.

Event Properties

PropertyTypeDescription
typestringnrpn-dataentrycoarse
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
messageMessageA Message object containing information about the incoming MIDI message.
parameterstringThe registered parameter's name
parameterMsbnumberThe MSB portion of the registered parameter (0-127)
parameterLsb:numberThe LSB portion of the registered parameter (0-127)
valuenumberThe received value as a normalized number between 0 and 1.
rawValuenumberThe value as received (0-127)

nrpn-dataentryfineโ€‹

Event emitted when an NRPN data entry fine message is received on the input. The specific parameter to which the message applies can be found in the event's parameter property. It is one of the ones defined in Enumerations.MIDI_REGISTERED_PARAMETERS.

Event Properties

PropertyTypeDescription
typestringnrpn-dataentryfine
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
messageMessageA Message object containing information about the incoming MIDI message.
parameterstringThe registered parameter's name
parameterMsbnumberThe MSB portion of the registered parameter (0-127)
parameterLsb:numberThe LSB portion of the registered parameter (0-127)
valuenumberThe received value as a normalized number between 0 and 1.
rawValuenumberThe value as received (0-127)

omnimodeโ€‹

Event emitted when an "omni mode" channel-mode MIDI message has been received. The value property of the event is set to either true (omni mode on) of false (omni mode off).

Event Properties

PropertyTypeDescription
typestring"omnimode"
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
valuebooleanThe value is true for omni mode on and false for omni mode off.
rawValuebooleanThe raw MIDI value

pitchbendโ€‹

Event emitted when a pitch bend MIDI message has been received.

Event Properties

PropertyTypeDescription
typestringpitchbend
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
valuenumberThe value expressed as a float between 0 and 1.
rawValuenumberThe raw MIDI value expressed as an integer (between 0 and 16383).

programchangeโ€‹

Event emitted when a program change MIDI message has been received.

Event Properties

PropertyTypeDescription
typestringprogramchange
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
valuenumberThe value expressed as an integer between 0 and 127.
rawValuenumberThe raw MIDI value expressed as an integer between 0 and 127.

resetallcontrollersโ€‹

Event emitted when a "reset all controllers" channel-mode MIDI message has been received.

Event Properties

PropertyTypeDescription
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
messageMessageA Message object containing information about the incoming MIDI message.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

rpnโ€‹

Event emitted when any RPN message is received on the input. There are four subtypes of RPN messages:

  • rpn-dataentrycoarse
  • rpn-dataentryfine
  • rpn-databuttonincrement
  • rpn-databuttondecrement

The parameter to which the message applies can be found in the event's parameter property. It is one of the ones defined in Enumerations.MIDI_REGISTERED_PARAMETERS.

Event Properties

PropertyTypeDescription
typestringrpn
subtypestringThe precise type of RPN message that was received.
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
messageMessageA Message object containing information about the incoming MIDI message.
parameterstringThe registered parameter's name
parameterMsbnumberThe MSB portion of the registered parameter (0-127)
parameterLsb:numberThe LSB portion of the registered parameter (0-127)
valuenumberThe received value as a normalized number between 0 and 1.
rawValuenumberThe value as received (0-127)

rpn-databuttondecrementโ€‹

Event emitted when an RPN data button decrement message is received on the input. The specific parameter to which the message applies can be found in the event's parameter property. It is one of the ones defined in Enumerations.MIDI_REGISTERED_PARAMETERS.

Event Properties

PropertyTypeDescription
typestringrpn-databuttondecrement
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
messageMessageA Message object containing information about the incoming MIDI message.
parameterstringThe registered parameter's name
parameterMsbnumberThe MSB portion of the registered parameter (0-127)
parameterLsb:numberThe LSB portion of the registered parameter (0-127)
valuenumberThe received value as a normalized number between 0 and 1.
rawValuenumberThe value as received (0-127)

rpn-databuttonincrementโ€‹

Event emitted when an RPN data button increment message is received on the input. The specific parameter to which the message applies can be found in the event's parameter property. It is one of the ones defined in Enumerations.MIDI_REGISTERED_PARAMETERS.

Event Properties

PropertyTypeDescription
typestringrpn-databuttonincrement
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
messageMessageA Message object containing information about the incoming MIDI message.
parameterstringThe registered parameter's name
parameterMsbnumberThe MSB portion of the registered parameter (0-127)
parameterLsb:numberThe LSB portion of the registered parameter (0-127)
valuenumberThe received value as a normalized number between 0 and 1.
rawValuenumberThe value as received (0-127)

rpn-dataentrycoarseโ€‹

Event emitted when an RPN data entry coarse message is received on the input. The specific parameter to which the message applies can be found in the event's parameter property. It is one of the ones defined in Enumerations.MIDI_REGISTERED_PARAMETERS.

Event Properties

PropertyTypeDescription
typestringrpn-dataentrycoarse
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
messageMessageA Message object containing information about the incoming MIDI message.
parameterstringThe registered parameter's name
parameterMsbnumberThe MSB portion of the registered parameter (0-127)
parameterLsb:numberThe LSB portion of the registered parameter (0-127)
valuenumberThe received value as a normalized number between 0 and 1.
rawValuenumberThe value as received (0-127)

rpn-dataentryfineโ€‹

Event emitted when an RPN data entry fine message is received on the input. The specific parameter to which the message applies can be found in the event's parameter property. It is one of the ones defined in Enumerations.MIDI_REGISTERED_PARAMETERS.

Event Properties

PropertyTypeDescription
typestringrpn-dataentryfine
targetInputChannelThe object that dispatched the event.
portInputThe Input that triggered the event.
timestampnumberThe moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).
messageMessageA Message object containing information about the incoming MIDI message.
parameterstringThe registered parameter's name
parameterMsbnumberThe MSB portion of the registered parameter (0-127)
parameterLsb:numberThe LSB portion of the registered parameter (0-127)
valuenumberThe received value as a normalized number between 0 and 1.
rawValuenumberThe value as received (0-127)