Skip to content

Instantly share code, notes, and snippets.

@yarogniew
Last active May 28, 2018 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yarogniew/6909e43f1d8f2f9174de3963b6781e2b to your computer and use it in GitHub Desktop.
Save yarogniew/6909e43f1d8f2f9174de3963b6781e2b to your computer and use it in GitHub Desktop.
Pyo RawMidi monitor
from pyo import *
import time
num = eval(input("Enter your Midi interface number: "))
s = Server(duplex=1)
s.setMidiInputDevice(num)
s.boot()
s.start()
def event(status, data1, data2):
print(status, data1, data2)
a = RawMidi(event)
again = "y"
while again == "y":
time.sleep(10)
a.stop()
again = input("Do you want to continue ? (y/n) : ")
if again == "y":
print("Continue...")
a.play()
s.stop()
time.sleep(1)
exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment