Midi
Created: 2019-05-26 17:59:29 -0700 Modified: 2019-05-26 19:21:32 -0700
Simple sample code
Section titled Simple sample codeThis code opens the first MIDI input connected to the device, then prints every message received:
Sending keystrokes when taking in MIDI data
Section titled Sending keystrokes when taking in MIDI dataI use RobotJS, but on Windows, keyToggle has this issue where it won’t actually hold keys down, and the solution in the issue didn’t work for me:
- (remember: these instructions don’t work)
- cd node_modules/robotjs
- Find keypress.c
- Comment out this code around line 100
- yarn —dev
- Don’t bother doing “yarn run prebuild”; it doesn’t succeed.
- node-gyp rebuild
According to Raymond Chen’s SO comment, you just need to emulate key toggles by repeatedly sending the key.
MIDI messages
Section titled MIDI messageshttps://www.midi.org/specifications/item/table-1-summary-of-midi-message