Web MIDI API Operation Test

This page will automatically test whether the Web MIDI API is available in your environment, including your browser.

Connect a MIDI keyboard to your PC. In my case, I have a MIDI keyboard called Korg nanoKEY2, so I connect it to the USB port on my PC. After connecting the keyboard, restart Chrome or Edge.



Open this page, wait a moment, and if "Web MIDI API ready!" is displayed in the box at the bottom, you can use the Web MIDI API . If the Web MIDI API fails, you cannot use it on your browser. If it is ready, the number and names of input devices and the number and names of output devices are displayed.

NOW TESTING!!

Sometimes, even if you have a MIDI keyboard connected and it says "Web MIDI API ready!", it may say "input_device=0, output_device=0." In this case, try the following steps: 1) unplug the MIDI keyboard , 2) close the browser, 3) plug in the MIDI keyboard , 4) start the browser, and 5) open this page.

IN:

The pull-down menu labeled "IN" above is for monitoring which MIDI input devices are connected to the PC. If only one device is connected, the name of that device should be displayed. In my case, it is displayed as nanoKEY2. If the menu does not appear even though a device is connected, try reloading this page.



Now, try pressing the keys. If you press and release the leftmost key, it should be displayed as follows.

data.length=3: 0x90: 0x30: 0x57:
data.length=3: 0x80: 0x30: 0x40:

0x90 is the information that appears when you press a key. This information is called NOTE ON. 0x indicates a hexadecimal number. 0x90 is 144 in decimal. The decimal values ​​are shown in parentheses.

0x30 (=48) is an information about which key was pressed. This information is called Note number. The diagram above shows what numbers are output for each key. 0x57 (=87) indicates how hardly the key was pressed. (This information is called Velocity. The number varies depending on how hardly you press the key. If you press the key softly, a smaller number is output (if you press it more softly, an even smaller number may be output). If you press it hard, 0x7F (=127) is output. This 0x7F (=127) is the maximum value.

The next line, 0x80 (=128), indicates that the key was released. This information is called NOTE OFF. 0x30 (=48) is the number of the key that was released, and 0x40 is a number that indicates whether the key was released slowly or quickly. It's called Note off verocity. However, with the nanoKEY2 keyboard , the number was always the same 0x40 (=64).

In this example, key 0x30 (=48) was pressed with a strength of 0x57 (=87), and then key 0x30 (=48) was released.


MIDI Application