Skip to main content

Enumerations

The Enumerations class contains enumerations and arrays of elements used throughout the library. All properties are static and should be referenced using the class name. For example: Enumerations.MIDI_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.

.MIDI_CHANNEL_NUMBERSโ€‹

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

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


Enumsโ€‹

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

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

.MIDI_CONTROL_CHANGE_MESSAGESโ€‹

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

Enumeration of all control change messages identifying the control function associated to its control number.

Not all numbers have a preassigned control function. For those that don't, the control function is identified as the word "controller" followed by the number (e.g. controller123).

Control FunctionControl Number
bankselectcoarse0
modulationwheelcoarse1
breathcontrollercoarse2
controller33
footcontrollercoarse4
portamentotimecoarse5
dataentrycoarse6
volumecoarse7
balancecoarse8
controller99
pancoarse10
expressioncoarse11
effectcontrol1coarse12
effectcontrol2coarse13
controller1414
controller1515
generalpurposeslider116
generalpurposeslider217
generalpurposeslider318
generalpurposeslider419
controller2020
controller2121
controller2222
controller2323
controller2424
controller2525
controller2626
controller2727
controller2828
controller2929
controller3030
controller3131
bankselectfine32
modulationwheelfine33
breathcontrollerfine34
controller3535
footcontrollerfine36
portamentotimefine37
dataentryfine38
volumefine39
balancefine40
controller4141
panfine42
expressionfine43
effectcontrol1fine44
effectcontrol2fine45
controller4646
controller4747
controller4848
controller4949
controller5050
controller5151
controller5252
controller5353
controller5454
controller5555
controller5656
controller5757
controller5858
controller5959
controller6060
controller6161
controller6262
controller6363
holdpedal64
portamento65
sustenutopedal66
softpedal67
legatopedal68
hold2pedal69
soundvariation70
resonance71
soundreleasetime72
soundattacktime73
brightness74
soundcontrol675
soundcontrol776
soundcontrol877
soundcontrol978
soundcontrol1079
generalpurposebutton180
generalpurposebutton281
generalpurposebutton382
generalpurposebutton483
controller8484
controller8585
controller8686
controller8787
controller8888
controller8989
controller9090
reverblevel91
tremololevel92
choruslevel93
celestelevel94
phaserlevel95
databuttonincrement96
databuttondecrement97
nonregisteredparametercoarse98
nonregisteredparameterfine99
registeredparametercoarse100
registeredparameterfine101
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

.MIDI_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]

.MIDI_SYSTEM_MESSAGESโ€‹

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

Enumeration of all valid MIDI system messages and matching numerical values. WebMidi.js 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 WebMidi.js Messages

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

FunctionHexadecimalDecimal
midimessage0
unknownsystemmessage-1