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@eddy.dev>2021-11-29 22:24:37 +0100
commit9d92121a67188995ced4aa2cc26d320475bb8c94 (patch)
tree0625499feaa11638e2df2139e87982c839b3c371 /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):