Skip to content

Instantly share code, notes, and snippets.

@ology
Created April 21, 2026 15:14
Show Gist options
  • Select an option

  • Save ology/d5bf25d7636c2b953feabd0c57cc1c07 to your computer and use it in GitHub Desktop.

Select an option

Save ology/d5bf25d7636c2b953feabd0c57cc1c07 to your computer and use it in GitHub Desktop.
Working Python Clock Listener
import mido
# print("Available Inputs:", mido.get_input_names())
port_name = 'IAC Driver Bus 1'
try:
with mido.open_input(port_name) as inport:
print(f"Listening for MIDI clock on '{port_name}'...")
for msg in inport:
if msg.type == 'clock':
# This executes 24 times per beat
print("Tick")
elif msg.type == 'start':
print("DAW Playback Started")
elif msg.type == 'stop':
print("DAW Playback Stopped")
except KeyboardInterrupt:
print("\nStopping...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment