Skip to content

Instantly share code, notes, and snippets.

@MaurizioB
Created January 4, 2018 23:22
Show Gist options
  • Save MaurizioB/3978bec97cd8b1fc2a7fae4f41563f87 to your computer and use it in GitHub Desktop.
Save MaurizioB/3978bec97cd8b1fc2a7fae4f41563f87 to your computer and use it in GitHub Desktop.
Simple MIDI note to keyboard event
#!/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