Created
January 4, 2018 23:22
-
-
Save MaurizioB/3978bec97cd8b1fc2a7fae4f41563f87 to your computer and use it in GitHub Desktop.
Simple MIDI note to keyboard event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
from mididings import * | |
config( | |
client_name='MidiKeyPress', | |
in_ports = [('Mixer', 'USB Midi 4i4o:.*MIDI 1')], | |
out_ports = 0, | |
) | |
def keyPress(key): | |
return System('xdotool key {}'.format(key)) | |
keyDict = { | |
'c3': keyPress('Left'), | |
'd3': keyPress('Down'), | |
'd#3': keyPress('Up'), | |
'e3': keyPress('Right'), | |
'g3': keyPress('space'), | |
} | |
run(Filter(NOTEON) >> KeySplit(keyDict)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment