0

I am looking for a way to read the USB-MIDI input live and have triggers, that run when a certain note is played. For example it should run function x, when an "e" is being played. This is Python 3 based either on windows 10 machine or a raspberry pi.

All the information I found has been years to decades old with pygame, py-midi, pyportmidi. Is there any current library that supports this? Pygame seems to rely on polling causing a short delay, which is a problem for this scenario.

In MIDI-OX, the Monitor displays the notes being played in real-time, though I can't do anything useful with it from there, as I need the python triggers, or events.

Tasmotanizer
  • 337
  • 1
  • 5
  • 15
  • 1
    I don't think that you can distinguish a 1ms polling interval from "real time". How much "real time" does it really need to be? – user8408080 Dec 04 '20 at 23:55
  • [This](https://github.com/mido/mido/tree/stable) looks nice. See [here](https://mido.readthedocs.io/en/latest/ports.html#input-ports) – user8408080 Dec 05 '20 at 00:02
  • Looks great. Thank you. The "real time" is about reducing overall lag of the system, since there's already some in sending out the signal, but it works fine as of now. – Tasmotanizer Dec 05 '20 at 01:26

0 Answers0