new InputChannel( input, number )

Description

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

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

The InputChannel class extends the EventEmitter class from the djipevents module. This means it also includes methods such as addListener(), removeListener(), hasListener() and several others. Check out the documentation for EventEmitter for more details.

Parameters
Name Type Description
input Input

The Input this channel belongs to

number number

The MIDI channel's number (1-16)

Details

3.0.0

Classes


new InputChannel( input, number )

Members


input :Input

Description

The Input this channel belongs to

Details

number :number

Description

This channel's number (1-16)

Details
number

Methods


<protected> _parseEvent( e )

Parameters
Name Type Description
e

Event

Details

getCcNameByNumber( number ) → {string|false}

Description

Returns the name of a control change message matching the specified number. Some valid control change numbers do not have a specific name or purpose assigned in the MIDI spec. In this case, the method returns false.

Parameters
Name Type Description
number number

An integer representing the control change message

Returns

The matching control change name or false if not match was found

Throws

Invalid control change number.

Details

2.0.0


getChannelModeByNumber( number ) → {string|false}

Description

Returns the channel mode name matching the specified number. If no match is found, the function returns false.

Parameters
Name Type Description
number number

An integer representing the channel mode message.

Returns

The name of the matching channel mode or false if not match could be found.

Details

2.0.0

Events


allnotesoff

Description

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

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"allnotesoff"

Details
Object

allsoundoff

Description

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

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"allsoundoff"

Details
Object

channelaftertouch

Description

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

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"channelaftertouch"

value number

The value expressed as a float between 0 and 1.

rawValue number

The value expressed as an integer (between 0 and 127).

Details
Object

channelmode

Description

Event emitted when a channel mode MIDI message has been received.

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"channelmode"

controller Object
Name Type Description
number Object

The number of the controller.

name Object

The usual name or function of the controller.

value number

The value expressed as a float between 0 and 1.

rawValue number

The value expressed as an integer (between 0 and 127).

Details
Object

controlchange

Description

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

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"controlchange"

controller Object
Name Type Description
number Object

The number of the controller.

name Object

The usual name or function of the controller.

value number

The value expressed as a float between 0 and 1.

rawValue number

The value expressed as an integer (between 0 and 127).

Details
Object

keyaftertouch

Description

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

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"keyaftertouch"

note Object

A Note object containing information such as note number, note name and octave.

value number

The aftertouch amount expressed as a float between 0 and 1.

rawValue number

The aftertouch amount expressed as an integer (between 0 and 127).

Details
Object

localcontrol

Description

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).

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"localcontrol"

value boolean

For local control on, the value is true. For local control off, the value is false.

Details
Object

midimessage

Description

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

Properties
Name Type Attributes Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

event.statusByte number

The message's status byte.

event.dataBytes Array.<number> <nullable>

The message's data bytes as an array of 0, 1 or 2 integers. This will be null for sysex messages.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"midimessage"

Details
Object

monomode

Description

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).

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"monomode"

value boolean

The value is true for omni mode on and false for omni mode off.

Details
Object

noteoff

Description

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

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"noteoff"

note Object

A Note object containing information such as note number, note name and octave.

release number

The release velocity expressed as a float between 0 and 1.

rawRelease number

The release velocity expressed as an integer (between 0 and 127).

Details
Object

noteon

Description

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

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"noteon"

note Object

A Note object containing information such as note number, note name and octave.

attack number

The attack velocity expressed as a float between 0 and 1.

rawAttack number

The attack velocity expressed as an integer (between 0 and 127).

Details
Object

omnimode

Description

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).

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"omnimode"

value boolean

The value is true for omni mode on and false for omni mode off.

Details
Object

pitchbend

Description

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

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"pitchbend"

value number

The value expressed as a float between 0 and 1.

rawValue number

The value expressed as an integer (between 0 and 16383).

Details
Object

programchange

Description

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

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"programchange"

value number

The value expressed as an integer between 1 and 128.

rawValue number

The value expressed as an integer between 0 and 127.

Details
Object

resetallcontrollers

Description

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

Properties
Name Type Description
target InputChannel

The InputChannel that triggered the event.

event.data Array

The MIDI message as an array of 8 bit values.

event.rawData Uint8Array

The raw MIDI message as a Uint8Array.

timestamp number

The moment (DOMHighResTimeStamp) when the event occurred (in milliseconds since the navigation start of the document).

type string

"resetallcontrollers"

Details
Object