diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2021-11-21 18:03:11 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2021-11-21 18:03:11 +0100 |
commit | 96fa61ed7a0f3e08b40f528e272fd73a7dbc9cf4 (patch) | |
tree | 99a912c7fbee863bc33a314b68b96038f7da02bd /midi.py | |
parent | fa5b0f760892bcbc2548ec0e516a716bd854ceef (diff) |
Fixed some bugs, added some midi buttons
Diffstat (limited to 'midi.py')
-rw-r--r-- | midi.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -13,6 +13,8 @@ _outport = None _callbacks_on_press = dict() _callbacks_on_release = dict() +_debug = False + def midi_init(device_name="Launchpad Mini MIDI 1"): global _inport, _outport _inport = mido.open_input(device_name) @@ -21,10 +23,11 @@ def midi_init(device_name="Launchpad Mini MIDI 1"): _inport.callback = _callback def button_on(button, colour): - print(f"outport: {_outport}") + if _debug: print(f"outport: {_outport}") + if _outport: msg = _light_ctrl_msg.copy(note=button, velocity=colour) - print(f"sending {msg}") + if _debug: print(f"sending {msg}") _outport.send(msg) def button_off(button): |