Closed redraw closed 2 years ago
You need to create a client port and connect it to the SYSTEM_ANNOUNCE port to get all port events from the system.
from alsa_midi import SequencerClient, WRITE_PORT, SYSTEM_ANNOUNCE
client = SequencerClient("monitor")
port = client.create_port("in", WRITE_PORT)
port.connect_from(SYSTEM_ANNOUNCE)
while True:
event = client.event_input()
print(repr(event))
thanks!
Hi, I'm trying to intercept
PORT_*
events, but my code hangs polling.I'm connecting/disconnecting USB MIDI devices so that they announce/disappear from ALSA seq, not sure if that's expected to happen, but that's what I need to listen.
Testing with example from the docs,