aboutsummaryrefslogtreecommitdiffstats
path: root/midi.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2021-11-21 18:03:11 +0100
committerEddy Pedroni <eddy@0xf7.com>2021-11-21 18:03:11 +0100
commit96fa61ed7a0f3e08b40f528e272fd73a7dbc9cf4 (patch)
tree99a912c7fbee863bc33a314b68b96038f7da02bd /midi.py
parentfa5b0f760892bcbc2548ec0e516a716bd854ceef (diff)
Fixed some bugs, added some midi buttons
Diffstat (limited to 'midi.py')
-rw-r--r--midi.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/midi.py b/midi.py
index 81b6703..7eca87e 100644
--- a/midi.py
+++ b/midi.py
@@ -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):