diff --git a/main.py b/main.py index df72faa..6929685 100644 --- a/main.py +++ b/main.py @@ -97,9 +97,11 @@ def main(): if stt_trigger_type == "note_on" and hasattr(msg, 'note') and msg.note == stt_note: # For note_on messages, check velocity to determine press/release if hasattr(msg, 'velocity') and msg.velocity > 0: + midi_controller.send_message(mido.Message('note_on', note=msg.note, velocity=127, channel=msg.channel)) print("\nStarting speech recognition (button pressed)...") stt.start_recording() else: + midi_controller.send_message(mido.Message('note_on', note=msg.note, velocity=0, channel=msg.channel)) print("\nStopping speech recognition (button released)...") stt.stop_recording() elif stt_trigger_type == "control_change" and hasattr(msg, 'control') and msg.control == stt_note: