Skip to main content

Enumerations

The Enumerations class contains enumerations and arrays of elements used throughout the library. All its properties are static and should be referenced using the class name. For example: Enumerations.CHANNEL_MESSAGES.

Since: 3.0.0


Properties

.CHANNEL_EVENTS

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

Array of channel-specific event names that can be listened for. This includes channel mode events and RPN/NRPN events.

.CHANNEL_NUMBERS

Since: 3.1
Type: Array.<number>
Attributes: read-only, static

A simple array of the 16 valid MIDI channel numbers (1 to 16):

.CONTROL_CHANGE_MESSAGES

Since: 3.1
Type: Array.<object>
Attributes: read-only, static

An array of objects, ordered by control number, describing control change messages. Each object in the array has 3 properties with some objects having a fourth one (position) :

  • number: MIDI control number (0-127);
  • name: name of emitted event (eg: bankselectcoarse, choruslevel, etc) that can be listened to;
  • description: user-friendly description of the controller's purpose;
  • position (optional): whether this controller's value should be considered an msb or lsb

Not all controllers have a predefined function. For those that don't, name is the word "controller" followed by the number (e.g. controller112).

Event nameControl Number
bankselectcoarse0
modulationwheelcoarse1
breathcontrollercoarse2
controller33
footcontrollercoarse4
portamentotimecoarse5
dataentrycoarse6
volumecoarse7
balancecoarse8
controller99
pancoarse10
expressioncoarse11
effectcontrol1coarse12
effectcontrol2coarse13
controller1414
controller1515
generalpurposecontroller116
generalpurposecontroller217
generalpurposecontroller318
generalpurposecontroller419
controller2020
controller2121
controller2222
controller2323
controller2424
controller2525
controller2626
controller2727
controller2828
controller2929
controller3030
controller3131
bankselectfine32
modulationwheelfine33
breathcontrollerfine34
controller3535
footcontrollerfine36
portamentotimefine37
dataentryfine38
channelvolumefine39
balancefine40
controller4141
panfine42
expressionfine43
effectcontrol1fine44
effectcontrol2fine45
controller4646
controller4747
controller4848
controller4949
controller5050
controller5151
controller5252
controller5353
controller5454
controller5555
controller5656
controller5757
controller5858
controller5959
controller6060
controller6161
controller6262
controller6363
damperpedal64
portamento65
sostenuto66
softpedal67
legatopedal68
hold269
soundvariation70
resonance71
releasetime72
attacktime73
brightness74
decaytime75
vibratorate76
vibratodepth77
vibratodelay78
controller7979
generalpurposecontroller580
generalpurposecontroller681
generalpurposecontroller782
generalpurposecontroller883
portamentocontrol84
controller8585
controller8686
controller8787
highresolutionvelocityprefix88
controller8989
controller9090
effect1depth91
effect2depth92
effect3depth93
effect4depth94
effect5depth95
dataincrement96
datadecrement97
nonregisteredparameterfine98
nonregisteredparametercoarse99
nonregisteredparameterfine100
registeredparametercoarse101
controller102102
controller103103
controller104104
controller105105
controller106106
controller107107
controller108108
controller109109
controller110110
controller111111
controller112112
controller113113
controller114114
controller115115
controller116116
controller117117
controller118118
controller119119
allsoundoff120
resetallcontrollers121
localcontrol122
allnotesoff123
omnimodeoff124
omnimodeon125
monomodeon126
polymodeon127

Enums

.CHANNEL_MESSAGES

Type: Object.<string, number>
Attributes: static

Enumeration of all MIDI channel message names and their associated 4-bit numerical value:

Message NameHexadecimalDecimal
noteoff0x88
noteon0x99
keyaftertouch0xA10
controlchange0xB11
programchange0xC12
channelaftertouch0xD13
pitchbend0xE14

.CHANNEL_MODE_MESSAGES

Type: Object.<string, number>
Attributes: static

Enumeration of all MIDI channel mode message names and their associated numerical value:

Message NameHexadecimalDecimal
allsoundoff0x78120
resetallcontrollers0x79121
localcontrol0x7A122
allnotesoff0x7B123
omnimodeoff0x7C124
omnimodeon0x7D125
monomodeon0x7E126
polymodeon0x7F127

.REGISTERED_PARAMETERS

Type: Object.<string, Array.<number>>
Attributes: static

Enumeration of all MIDI registered parameters and their associated pair of numerical values. MIDI registered parameters extend the original list of control change messages. Currently, there are only a limited number of them:

Control Function[LSB, MSB]
pitchbendrange[0x00, 0x00]
channelfinetuning[0x00, 0x01]
channelcoarsetuning[0x00, 0x02]
tuningprogram[0x00, 0x03]
tuningbank[0x00, 0x04]
modulationrange[0x00, 0x05]
azimuthangle[0x3D, 0x00]
elevationangle[0x3D, 0x01]
gain[0x3D, 0x02]
distanceratio[0x3D, 0x03]
maximumdistance[0x3D, 0x04]
maximumdistancegain[0x3D, 0x05]
referencedistanceratio[0x3D, 0x06]
panspreadangle[0x3D, 0x07]
rollangle[0x3D, 0x08]

.SYSTEM_MESSAGES

Type: Object.<string, number>
Attributes: static

Enumeration of all valid MIDI system messages and matching numerical values. This library also uses two additional custom messages.

System Common Messages

FunctionHexadecimalDecimal
sysex0xF0240
timecode0xF1241
songposition0xF2242
songselect0xF3243
tunerequest0xF6246
sysexend0xF7247

The sysexend message is never actually received. It simply ends a sysex stream.

System Real-Time Messages

FunctionHexadecimalDecimal
clock0xF8248
start0xFA250
continue0xFB251
stop0xFC252
activesensing0xFE254
reset0xFF255

Values 249 and 253 are relayed by the Web MIDI API but they do not serve any specific purpose. The MIDI 1.0 spec simply states that they are undefined/reserved.

Custom Messages

These two messages are mostly for internal use. They are not MIDI messages and cannot be sent or forwarded.

FunctionHexadecimalDecimal
midimessage0
unknownsystemmessage-1